Plugin Directory

Changeset 3303202


Ignore:
Timestamp:
05/29/2025 09:21:14 PM (9 months ago)
Author:
patternsinthecloud
Message:

version 2.8.9.1

Location:
autoship-cloud/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • autoship-cloud/trunk/app/Core/FeatureManager.php

    r3299545 r3303202  
    2323     */
    2424    protected static array $features = array(
    25         'quicklaunch'                          => false,
     25        'quicklaunch'                          => true,
    2626        'quicklaunch_lead_registration'        => true,
    2727        'quicklaunch_account_login'            => true,
  • autoship-cloud/trunk/app/Domain/PaymentIntegrationFactory.php

    r3299545 r3303202  
    6767                    return PayPalPaymentIntegration::build( $gateway_id, $settings );
    6868                case 'autoship-test-gateway':
    69                     return TestPaymentIntegration::build( $gateway_id );
     69                    return TestPaymentIntegration::build( $gateway_id, $settings );
    7070                case 'wc_checkout_com_cards':
    71                     return CheckoutPaymentIntegration::build( $gateway_id );
     71                    return CheckoutPaymentIntegration::build( $gateway_id, $settings );
    7272                case 'cybersource':
    73                     return CyberSourcePaymentIntegration::build( $gateway_id );
     73                    return CyberSourcePaymentIntegration::build( $gateway_id, $settings );
    7474                case 'sagepaydirect':
    75                     return SagePaymentIntegration::build( $gateway_id );
     75                    return SagePaymentIntegration::build( $gateway_id, $settings );
    7676                default:
    77                     return UnknownPaymentIntegration::build( $gateway_id );
     77                    return UnknownPaymentIntegration::build( $gateway_id, $settings );
    7878            }
    7979        } catch ( Exception $e ) {
    80             return UnknownPaymentIntegration::build( $gateway_id );
     80            return UnknownPaymentIntegration::build( $gateway_id, $settings );
    8181        }
    8282    }
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/AuthorizeNetPaymentIntegration.php

    r3299545 r3303202  
    4747        $integration->set_method_id( $gateway_id );
    4848        $integration->set_method_type( PaymentMethodType::AUTHORIZE_NET );
     49        $integration->set_method_name( $settings['title'] ?? '' );
    4950        $integration->set_authorize_only( false );
    5051
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/BraintreePaymentIntegration.php

    r3299545 r3303202  
    4848        $integration->set_method_id( $gateway_id );
    4949        $integration->set_method_type( PaymentMethodType::BRAINTREE );
     50        $integration->set_method_name( $settings['title'] ?? '' );
    5051        $integration->set_authorize_only( false );
    5152
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/CheckoutPaymentIntegration.php

    r3299545 r3303202  
    2121
    2222    /**
     23     * The allowed payment gateways for this integration.
     24     *
     25     * @var array
     26     */
     27    private static array $allowed = array(
     28        'wc_checkout_com_cards',
     29    );
     30
     31    /**
    2332     * Builds a Checkout.com payment integration.
    2433     *
    2534     * @param string $gateway_id The gateway ID.
     35     * @param array  $settings The gateway settings.
    2636     * @return CheckoutPaymentIntegration
    2737     */
    28     public static function build( string $gateway_id ): CheckoutPaymentIntegration {
    29         autoship_log_entry(
    30             __( 'Checkout.com Payment Gateway Detected', 'autoship' ),
    31             __( 'The following gateway was created as Checkout.com integration. This integration is disabled.' )
    32         );
    33 
     38    public static function build( string $gateway_id, array $settings ): CheckoutPaymentIntegration {
    3439        $integration = new self();
    3540        $integration->set_method_id( $gateway_id );
    3641        $integration->set_method_type( PaymentMethodType::CHECKOUT );
     42        $integration->set_method_name( $settings['title'] ?? '' );
    3743        $integration->set_authorize_only( false );
    3844        $integration->set_test_mode( true );
     45
     46        $environment = 'sandbox' === $settings['ckocom_environment'] ? 'test' : 'live';
     47
     48        if ( 'test' === $environment ) {
     49            $integration->set_api_key_1( $settings['ckocom_pk'] ?? '' );
     50            $integration->set_api_key_2( $settings['ckocom_sk'] ?? '' );
     51            $integration->set_test_mode( true );
     52        } else {
     53            $integration->set_api_key_1( $settings['ckocom_pk'] ?? '' );
     54            $integration->set_api_key_2( $settings['ckocom_sk'] ?? '' );
     55            $integration->set_test_mode( false );
     56        }
    3957
    4058        return $integration;
     
    4765     */
    4866    public function is_valid(): bool {
    49         // This enforces the payment integration to be disabled.
    50         return false;
     67        if ( PaymentMethodType::CHECKOUT !== $this->get_method_type() ) {
     68            return false;
     69        }
     70
     71        if ( ! in_array( $this->get_method_id(), self::$allowed, true ) ) {
     72            return false;
     73        }
     74
     75        // Checkout should contain the pk and the sk.
     76        if ( empty( $this->get_api_key_1() ) || empty( $this->get_api_key_2() ) ) {
     77            return false;
     78        }
     79
     80        return true;
    5181    }
    5282}
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/CyberSourcePaymentIntegration.php

    r3299545 r3303202  
    2424     *
    2525     * @param string $gateway_id The gateway ID.
     26     * @param array  $settings The gateway settings.
    2627     * @return CyberSourcePaymentIntegration
    2728     */
    28     public static function build( string $gateway_id ): CyberSourcePaymentIntegration {
     29    public static function build( string $gateway_id, array $settings ): CyberSourcePaymentIntegration {
    2930        autoship_log_entry(
    3031            __( 'CyberSource V1 Payment Gateway Detected', 'autoship' ),
     
    3536        $integration->set_method_id( $gateway_id );
    3637        $integration->set_method_type( PaymentMethodType::CYBER_SOURCE );
     38        $integration->set_method_name( $settings['title'] ?? '' );
    3739        $integration->set_authorize_only( false );
    3840        $integration->set_test_mode( true );
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/CyberSourceV2PaymentIntegration.php

    r3299545 r3303202  
    4747        $integration->set_method_id( $gateway_id );
    4848        $integration->set_method_type( PaymentMethodType::CYBER_SOURCE_V2 );
     49        $integration->set_method_name( $settings['title'] ?? '' );
    4950        $integration->set_authorize_only( false );
    5051
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/NmiPaymentIntegration.php

    r3299545 r3303202  
    4848        $integration->set_method_id( $gateway_id );
    4949        $integration->set_method_type( PaymentMethodType::NMI );
     50        $integration->set_method_name( $settings['title'] ?? '' );
    5051        $integration->set_authorize_only( false );
    5152
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/PayPalPaymentIntegration.php

    r3299545 r3303202  
    4747        $integration->set_method_id( $gateway_id );
    4848        $integration->set_method_type( PaymentMethodType::PAYPAL );
     49        $integration->set_method_name( $settings['title'] ?? '' );
    4950        $integration->set_authorize_only( false );
    5051
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/PayaV1PaymentIntegration.php

    r3299545 r3303202  
    4646        $integration->set_method_id( $gateway_id );
    4747        $integration->set_method_type( PaymentMethodType::PAYA_V1 );
     48        $integration->set_method_name( $settings['title'] ?? '' );
    4849        $integration->set_authorize_only( false );
    4950
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/SagePaymentIntegration.php

    r3299545 r3303202  
    2424     *
    2525     * @param string $gateway_id The gateway ID.
     26     * @param array  $settings The gateway settings.
    2627     * @return SagePaymentIntegration
    2728     */
    28     public static function build( string $gateway_id ): SagePaymentIntegration {
     29    public static function build( string $gateway_id, array $settings ): SagePaymentIntegration {
    2930        autoship_log_entry(
    3031            __( 'Sage Payment Gateway Detected', 'autoship' ),
     
    3536        $integration->set_method_id( $gateway_id );
    3637        $integration->set_method_type( PaymentMethodType::SAGE );
     38        $integration->set_method_name( $settings['title'] ?? '' );
    3739        $integration->set_authorize_only( false );
    3840        $integration->set_test_mode( true );
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/TestPaymentIntegration.php

    r3299545 r3303202  
    2424     *
    2525     * @param string $gateway_id The gateway ID.
     26     * @param array  $settings The gateway settings.
    2627     * @return TestPaymentIntegration
    2728     */
    28     public static function build( string $gateway_id ): TestPaymentIntegration {
     29    public static function build( string $gateway_id, array $settings ): TestPaymentIntegration {
    2930        autoship_log_entry(
    3031            __( 'Autoship Test Payment Gateway Detected', 'autoship' ),
     
    3536        $integration->set_method_id( $gateway_id );
    3637        $integration->set_method_type( PaymentMethodType::TEST );
     38        $integration->set_method_name( $settings['title'] ?? '' );
    3739        $integration->set_authorize_only( false );
    3840        $integration->set_test_mode( true );
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/TrustCommercePaymentIntegration.php

    r3299545 r3303202  
    4646        $integration->set_method_id( $gateway_id );
    4747        $integration->set_method_type( PaymentMethodType::TRUST_COMMERCE );
     48        $integration->set_method_name( $settings['title'] ?? '' );
    4849        $integration->set_authorize_only( false );
    4950
  • autoship-cloud/trunk/app/Domain/PaymentIntegrations/UnknownPaymentIntegration.php

    r3299545 r3303202  
    2424     *
    2525     * @param string $gateway_id The gateway ID.
     26     * @param array  $settings The gateway settings.
    2627     * @return UnknownPaymentIntegration
    2728     */
    28     public static function build( string $gateway_id ): UnknownPaymentIntegration {
     29    public static function build( string $gateway_id, array $settings ): UnknownPaymentIntegration {
    2930        autoship_log_entry(
    3031            __( 'Unknown Autoship Payment Gateway Detected', 'autoship' ),
     
    3536        $integration->set_method_id( $gateway_id );
    3637        $integration->set_method_type( PaymentMethodType::UNDEFINED );
     38        $integration->set_method_name( $settings['title'] ?? '' );
    3739        $integration->set_authorize_only( false );
    3840        $integration->set_test_mode( true );
  • autoship-cloud/trunk/autoship.php

    r3299545 r3303202  
    88 * Plugin URI: https://autoship.cloud
    99 * Description: Autoship Cloud for WooCommerce
    10  * Version: 2.8.9
     10 * Version: 2.8.9.1
    1111 * Author: Patterns In the Cloud LLC
    1212 * Author URI: https://qpilot.cloud
     
    1717 */
    1818
    19 define( 'Autoship_Version', '2.8.9' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
     19define( 'Autoship_Version', '2.8.9.1' ); // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
    2020
    2121if ( ! defined( 'Autoship_Plugin_Dir' ) ) {
  • autoship-cloud/trunk/readme.txt

    r3299545 r3303202  
    1010WC tested up to: 9.8.5
    1111Requires PHP: 7.4
    12 Stable tag: 2.8.9
     12Stable tag: 2.8.9.1
    1313License: GPLv2 or later
    1414License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    291291
    292292== Changelog ==
     293
     294= 2.8.9.1 - 2025-05-29 =
     295
     296 - New! Streamlined and improved onboarding experience for new plugin installs to make setup faster, clearer, and easier than ever.
    293297
    294298= 2.8.9 - 2025-05-23 =
  • autoship-cloud/trunk/templates/admin/no-token.php

    r3299545 r3303202  
    99use Autoship\Core\FeatureManager;
    1010
    11 $display_beacon = FeatureManager::is_enabled( 'quicklaunch_display_beacon' );
    12 $settings_page  = admin_url( 'admin.php?page=settings' );
    13 $quicklaunch_page = admin_url( 'admin.php?page=quicklaunch' );
     11$display_beacon      = FeatureManager::is_enabled( 'quicklaunch_display_beacon' );
     12$display_quicklaunch = FeatureManager::is_enabled( 'quicklaunch' );
     13$settings_page       = admin_url( 'admin.php?page=settings' );
     14$quicklaunch_page    = admin_url( 'admin.php?page=quicklaunch' );
    1415
    1516wp_enqueue_style( 'autoship-quicklaunch-style', plugin_dir_url( Autoship_Plugin_File ) . 'styles/quicklaunch.css', array(), Autoship_Version );
    1617?>
    1718
     19<div class="autoship-quicklaunch-container">
     20    <div class="autoship-quicklaunch-header-wrapper">
     21        <div class="autoship-quicklaunch-header-container">
     22            <div class="autoship-quicklaunch-header-cta-container">
     23                <button id="autoship-button-demo" class="autoship-button-demo"><?php echo esc_html( __( 'Schedule a demo', 'autoship' ) ); ?></button>
     24            </div>
     25            <div class="autoship-quicklaunch-header-logo-container">
     26                <img class="autoship-quicklaunch-header-logo" src="<?php echo esc_url( Autoship_Plugin_Url ); ?>/images/autoship_logo_white.svg"  alt="Autoship"/>
     27            </div>
     28        </div>
     29        <div id="autoship-progress">
     30            <span id="autoship-progress-bar" style="width: 0"></span>
     31        </div>
     32    </div>
     33    <div class="autoship-quicklaunch-content-wrapper">
     34        <div class="autoship-quicklaunch-content-steps-container">
     35            <div id="autoship-quicklaunch-content">
     36                <div class="autoship-quicklaunch-content-step">
     37                    <h1><?php echo esc_html( __( 'Ready to get', 'autoship' ) ); ?> <span class="autoship-orange-text"><?php echo esc_html( __( 'started', 'autoship' ) ); ?></span>?</h1>
    1838
     39                    <p class="autoship-font-md autoship-w-700 autoship-mb-50"><?php echo esc_html( __( 'Autoship lets your customers', 'autoship' ) ); ?> <span class="autoship-highlighted-text"><?php echo esc_html( __( 'subscribe to any product', 'autoship' ) ); ?></span>, <?php echo esc_html( __( 'in any quantity', 'autoship' ) ); ?>, <span class="autoship-highlighted-text"><?php echo esc_html( __( 'on their terms', 'autoship' ) ); ?></span>.</p>
    1940
    20 <!--
    21 <div class="wrap" style="padding: 20px;">
    22     <div id="autoship-pending-setup-content">
     41                    <img src="<?php echo esc_url( Autoship_Plugin_Url ); ?>/images/b2c-image.png"  class="autoship-step-image" alt="Autoship"/>
    2342
    24         <div style="max-width: 500px; text-align: center; margin: 0 auto; ">
     43                    <p class="autoship-font-md autoship-w-700 autoship-mt-40">
     44                        Give your customers flexibility and scale your revenue with confidence.
     45                    </p>
    2546
    26             <h1 style="font-weight: bolder; margin-bottom: 50px;">Ready to get started?</h1>
    27 
    28             <p style="font-size: 1.5em">
    29                 You can use our Quick Launch to walk through setup in just a few steps — or, if you prefer more control, follow our step-by-step documentation <a href="#" style="text-decoration: none;">here</a>.
    30             </p>
    31 
    32             <p style="margin-top: 50px; margin-bottom: 30px; font-size: 1.4em">Get started in just 5 minutes!</p>
    33 
    34             <div style="max-width: 400px; text-align: center; margin: 0 auto; ">
    35                 <div style="margin-bottom: 20px;">
    36                     <button type="button" id="welcome-next-button" class="button button-primary button-hero" style="width: 100%; margin-bottom: 20px;">Start Quick Launch</button>
    37 
    38                     <a href="#" id="welcome-dismiss-button" style="text-decoration: none;">I'll set up my store manually</a>
    39                 </div>
    40 
    41 
    42 
    43             </div>
    44         </div>
    45     </div>
    46 </div>
    47 -->
    48 
    49 
    50 
    51 
    52 
    53 
    54 
    55 <div class="autoship-quicklaunch-container">
    56     <div class="autoship-quicklaunch-header-wrapper">
    57         <div class="autoship-quicklaunch-header-container">
    58             <div class="autoship-quicklaunch-header-cta-container">
    59                 <button id="autoship-button-demo" class="autoship-button-demo"><?php echo esc_html( __( 'Schedule a demo', 'autoship' ) ); ?></button>
    60             </div>
    61             <div class="autoship-quicklaunch-header-logo-container">
    62                 <img class="autoship-quicklaunch-header-logo" src="<?php echo esc_url( Autoship_Plugin_Url ); ?>/images/autoship_logo_white.svg"  alt="Autoship"/>
    63             </div>
    64         </div>
    65         <div id="autoship-progress">
    66             <span id="autoship-progress-bar" style="width: 0"></span>
    67         </div>
    68     </div>
    69     <div class="autoship-quicklaunch-content-wrapper">
    70         <div class="autoship-quicklaunch-content-steps-container">
    71             <div id="autoship-quicklaunch-content">
    72                 <div class="autoship-quicklaunch-content-step">
    73                     <h1><?php echo esc_html( __( 'Ready to get', 'autoship' ) ); ?> <span class="autoship-orange-text"><?php echo esc_html(__( 'started', 'autoship' ) ); ?></span>?</h1>
    74 
    75                     <p class="autoship-font-md autoship-w-700 autoship-mb-50"><?php echo esc_html( __( 'Autoship lets your customers', 'autoship' ) ); ?> <span class="autoship-highlighted-text"><?php echo esc_html( __( 'subscribe to any product', 'autoship' ) ); ?></span>, <?php echo esc_html( __( 'in any quantity', 'autoship' ) ); ?>, <span class="autoship-highlighted-text"><?php echo esc_html( __( 'on their terms', 'autoship' ) ); ?></span>.</p>
    76 
    77                     <img src="<?php echo esc_url( Autoship_Plugin_Url ); ?>/images/b2c-image.png"  class="autoship-step-image" alt="Autoship"/>
    78 
    79                     <p class="autoship-font-md autoship-w-700 autoship-mt-40">
    80                         <!--<?php echo esc_html( __( "The world's", 'autoship' ) ); ?> <span class="autoship-orange-text"><?php echo esc_html( __( 'most flexible', 'autoship' ) ); ?></span> <?php echo esc_html( __( 'subscription tool', 'autoship' ) ); ?>-->
    81 
    82                         Give your customers flexibility and scale your revenue with confidence.
    83                     </p>
    84 
    85 
    86 
    87                     <p class="autoship-mb-40 autoship-mt-50 autoship-font-md"><?php echo esc_html( __( 'Get started in just 5 minutes!', 'autoship' ) ); ?></p>
    88                     <div class="autoship-quicklaunch-content-step-actions">
    89                         <div class="autoship-mb-20">
    90                             <button type="button" id="autoship-go-to-quicklaunch-button" data-quicklaunch-url="<?php echo esc_url( $quicklaunch_page ) ?>" class="autoship-button-call-to-action autoship-mb-20 autoship-width-100"><?php echo esc_html( __( 'Install Now', 'autoship' ) ); ?></button>
    91                             <a href="<?php echo esc_url( $settings_page ); ?>" class="autoship-quicklaunch-content-steps-action-link"><?php echo esc_html( __( "Go to Settings", 'autoship' ) ); ?></a>
    92                         </div>
    93                     </div>
    94                 </div>
    95 
    96 
    97             </div>
    98         </div>
    99     </div>
     47                    <p class="autoship-mb-40 autoship-mt-50 autoship-font-md"><?php echo esc_html( __( 'Get started in just 5 minutes!', 'autoship' ) ); ?></p>
     48                    <div class="autoship-quicklaunch-content-step-actions">
     49                        <div class="autoship-mb-20">
     50                            <?php if ( $display_quicklaunch ) : ?>
     51                                <button type="button" id="autoship-go-to-quicklaunch-button" data-quicklaunch-url="<?php echo esc_url( $quicklaunch_page ); ?>" class="autoship-button-call-to-action autoship-mb-20 autoship-width-100"><?php echo esc_html( __( 'Install Now', 'autoship' ) ); ?></button>
     52                            <?php endif; ?>
     53                            <a href="<?php echo esc_url( $settings_page ); ?>" class="autoship-quicklaunch-content-steps-action-link"><?php echo esc_html( __( "Go to Settings", 'autoship' ) ); ?></a>
     54                        </div>
     55                    </div>
     56                </div>
     57            </div>
     58        </div>
     59    </div>
    10060</div>
    10161
    102 <?php if ( $display_beacon ): ?>
    103     <script type="text/javascript">!function(e,t,n){function a(){var e=t.getElementsByTagName("script")[0],n=t.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://beacon-v2.helpscout.net",e.parentNode.insertBefore(n,e)}if(e.Beacon=n=function(t,n,a){e.Beacon.readyQueue.push({method:t,options:n,data:a})},n.readyQueue=[],"complete"===t.readyState)return a();e.attachEvent?e.attachEvent("onload",a):e.addEventListener("load",a,!1)}(window,document,window.Beacon||function(){});</script>
    104     <script type="text/javascript">window.Beacon('init', '5ecf2750-6b64-45fc-83bf-7ad5c7af08a0')</script>
     62<?php if ( $display_beacon ) : ?>
     63    <script type="text/javascript">!function(e,t,n){function a(){var e=t.getElementsByTagName("script")[0],n=t.createElement("script");n.type="text/javascript",n.async=!0,n.src="https://beacon-v2.helpscout.net",e.parentNode.insertBefore(n,e)}if(e.Beacon=n=function(t,n,a){e.Beacon.readyQueue.push({method:t,options:n,data:a})},n.readyQueue=[],"complete"===t.readyState)return a();e.attachEvent?e.attachEvent("onload",a):e.addEventListener("load",a,!1)}(window,document,window.Beacon||function(){});</script>
     64    <script type="text/javascript">window.Beacon('init', '5ecf2750-6b64-45fc-83bf-7ad5c7af08a0')</script>
    10565<?php endif; ?>
  • autoship-cloud/trunk/templates/quicklaunch/step-payments.php

    r3299545 r3303202  
    2424$supported_methods         = autoship_get_valid_payment_methods();
    2525$installed                 = array();
     26$keys                      = array_keys( $supported_methods );
    2627
    2728foreach ( $installed_payment_methods as $method ) {
    28     if ( in_array( $method->id, $supported_methods, true ) ) {
     29    if ( in_array( $method->id, $keys, true ) ) {
    2930        $installed[] = PaymentIntegrationFactory::create( $method->id, $method->settings );
    3031    }
     
    8384            ?>
    8485
    85         <div style="background-color: white; padding: 20px; border-radius: 10px; border: 1px solid orange; " >
     86        <div style="background-color: white; padding: 20px; border-radius: 10px; border: 1px solid orange; margin-bottom:20px;" >
    8687
    8788            <div style="display:flex; justify-content: space-between;">
Note: See TracChangeset for help on using the changeset viewer.