Plugin Directory

Changeset 3433172


Ignore:
Timestamp:
01/06/2026 02:41:46 AM (8 days ago)
Author:
ThemeHigh
Message:

version 5.0.7.0

Location:
payment-gateway-stripe-and-woocommerce-integration/trunk
Files:
2 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/admin/class-stripe-admin-handler.php

    r3351963 r3433172  
    3030   
    3131            add_action('in_plugin_update_message-payment-gateway-stripe-and-woocommerce-integration/payment-gateway-stripe-and-woocommerce-integration.php', array($this, 'wt_stripe_upgrade_notice'), 10, 2);
     32
     33            /* * Themehigh added */
     34            add_action('init', array($this, 'redirect_to_stripe_settings'));
    3235   
    3336        });
     
    6467       
    6568        add_menu_page(
    66             __( 'WebToffee Stripe','payment-gateway-stripe-and-woocommerce-integration' ),
    67             __( 'WebToffee Stripe','payment-gateway-stripe-and-woocommerce-integration' ),
     69            __( 'ThemeHigh Stripe','payment-gateway-stripe-and-woocommerce-integration' ),
     70            __( 'ThemeHigh Stripe','payment-gateway-stripe-and-woocommerce-integration' ),
    6871            'manage_options',
    6972            'wt_stripe_menu',
     
    137140
    138141            /* translators: %1$s: Opening paragraph and h2 tags, %2$s: Closing h2 tag, %3$s: Opening paragraph tag, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Link opening, %7$s: Link closing, %8$s: Button opening, %9$s: Button closing */
    139             $message = sprintf(esc_html__('%1$sUrgent: Switch to OAuth for Secure Stripe Integration%2$sWe are enhancing security and requires you to switch from using API keys to OAuth 2.0 for connecting with Stripe account. OAuth provides better control and limits access to only the necessary data, protecting your business from unauthorized access. %3$sEnsure to connect your Stripe account using the new authentication method before the year ends. %4$sClick %5$s"Connect Now"%6$s to update your integration today! Need help? Check out our %7$sintegration article%8$s. Please upgrade soon to avoid service disruptions.%9$sConnect Now%10$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<p><h2>', '</h2>','<p>', '</p><p>', '<b>', '</b>', '<a href="https://www.webtoffee.com/switch-stripe-integration-oauth/" style="text-decoration: none;">', '</a>', '</p><p><a href="' . esc_url($install_link) .'" class="button button-primary">', '</a></p>');
     142            $message = sprintf(esc_html__('%1$sUrgent: Switch to OAuth for Secure Stripe Integration%2$sWe are enhancing security and requires you to switch from using API keys to OAuth 2.0 for connecting with Stripe account. OAuth provides better control and limits access to only the necessary data, protecting your business from unauthorized access. %3$sEnsure to connect your Stripe account using the new authentication method before the year ends. %4$sClick %5$s"Connect Now"%6$s to update your integration today! Need help? Check out our %7$sintegration article%8$s. Please upgrade soon to avoid service disruptions.%9$sConnect Now%10$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<p><h2>', '</h2>','<p>', '</p><p>', '<b>', '</b>', '<a href="https://www.themehigh.com/docs/upgrade-your-stripe-integration-to-oauth-2-0-for-enhanced-security-2/" style="text-decoration: none;">', '</a>', '</p><p><a href="' . esc_url($install_link) .'" class="button button-primary">', '</a></p>');
    140143           
    141144            /* translators: %1$s: Opening paragraph and h2 tags, %2$s: Closing h2 tag, %3$s: Bold tag opening, %4$s: Bold tag closing, %5$s: Link opening, %6$s: Link closing, %7$s: Button opening, %8$s: Button closing */
     
    203206        $stripe_params['disconnect_secondary_btn_title'] = __("Cancel", "payment-gateway-stripe-and-woocommerce-integration");
    204207        $stripe_params['disconnect_title'] = __("Are you sure?", "payment-gateway-stripe-and-woocommerce-integration");
    205         $stripe_params['disconnect_text'] = __("Disconnecting your Stripe account from WebToffee stops payments. To fully remove the WebToffee app, head to 'Installed apps' in your Stripe dashboard.", "payment-gateway-stripe-and-woocommerce-integration");
     208        $stripe_params['disconnect_text'] = __("Disconnecting your Stripe account from ThemeHigh stops payments. To fully remove the ThemeHigh app, head to 'Installed apps' in your Stripe dashboard.", "payment-gateway-stripe-and-woocommerce-integration");
    206209        wp_localize_script('eh_stripe_oauth', 'eh_stripe_oauth_val',  $stripe_params);
    207210
     
    223226                    $webtoffee_logo='&nbsp;&nbsp;<img src="'.EH_STRIPE_MAIN_URL_PATH.'assets/img/wt_logo.png" style="" />&nbsp;';
    224227
    225                     ?><div class="wfte_branding">
     228                    ?>
     229                    <?php /*
     230                    <div class="wfte_branding">
    226231                        <div class="wfte_branding_label"><?php esc_html_e('Developed by', 'payment-gateway-stripe-and-woocommerce-integration'); echo wp_kses_post($webtoffee_logo);?>
    227232                        </div>
    228233                        <!-- <div style="width: 100%; padding: 5px;">
    229                             <?php echo wp_kses_post($webtoffee_logo); ?>
     234                            <?php //echo wp_kses_post($webtoffee_logo); ?>
    230235                        </div> -->
    231                     </div>
     236                    </div> */ ?>
    232237
    233238                    <?php
     
    285290                                        else{
    286291                                            /* translators: %1$s: Opening paragraph and h2 tags, %2$s: Closing h2 tag, %3$s: Opening paragraph tag, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Link opening, %7$s: Link closing, %8$s: Button opening, %9$s: Button closing */
    287                                             $message = sprintf(esc_html__('%1$sUrgent: Switch to OAuth for Secure Stripe Integration%2$sWe are enhancing security and requires you to switch from using API keys to OAuth 2.0 for connecting with Stripe account. OAuth provides better control and limits access to only the necessary data, protecting your business from unauthorized access. %3$sEnsure to connect your Stripe account using the new authentication method before the year ends.%4$sClick %5$s"Connect Now"%6$s to update your integration today! Need help? Check out our %7$sintegration article%8$s. Please upgrade soon to avoid service disruptions.%9$sConnect Now%10$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<p><h2>', '</h2>', '<p>', '</p><p>', '<b>', '</b>', '<a href="https://www.webtoffee.com/switch-stripe-integration-oauth/" style="text-decoration: none;">', '</a>', '</p><p><a href="' . esc_url($install_link) .'" class="button button-primary">', '</a></p>');
     292                                            $message = sprintf(esc_html__('%1$sUrgent: Switch to OAuth for Secure Stripe Integration%2$sWe are enhancing security and requires you to switch from using API keys to OAuth 2.0 for connecting with Stripe account. OAuth provides better control and limits access to only the necessary data, protecting your business from unauthorized access. %3$sEnsure to connect your Stripe account using the new authentication method before the year ends.%4$sClick %5$s"Connect Now"%6$s to update your integration today! Need help? Check out our %7$sintegration article%8$s. Please upgrade soon to avoid service disruptions.%9$sConnect Now%10$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<p><h2>', '</h2>', '<p>', '</p><p>', '<b>', '</b>', '<a href="https://www.themehigh.com/docs/upgrade-your-stripe-integration-to-oauth-2-0-for-enhanced-security-2/" style="text-decoration: none;">', '</a>', '</p><p><a href="' . esc_url($install_link) .'" class="button button-primary">', '</a></p>');
    288293                                            echo wp_kses_post("<div class='wtst-notice wtst-notice-error ' ><div style='padding:10px'>$message</div></div>");
    289294                                        }
     
    346351                                            }
    347352
     353                                             //themehigh added
     354                                            jQuery(document).ready(function ($) {
     355                                                $('#th_test_mode_type').on('click', function (e) {
     356                                                    e.preventDefault();
     357                                                    $('#woocommerce_eh_stripe_test_mode_type_hidden').val('sandbox');
     358                                                    $('form').submit(); // Automatically saves and reloads
     359                                                });
     360
     361                                                $('#th_sandbox_mode_type').on('click', function (e) {
     362                                                    e.preventDefault();
     363                                                    $('#woocommerce_eh_stripe_test_mode_type_hidden').val('test');
     364                                                    $('form').submit(); // Automatically saves and reloads
     365                                                });
     366                                            });
    348367                                           
    349368                                        ");
     
    665684                                                                     <h3><?php esc_html_e('Documentation','payment-gateway-stripe-and-woocommerce-integration'); ?></h3>
    666685                                                                     <p><?php esc_html_e('Refer to our documentation to set up and get started.','payment-gateway-stripe-and-woocommerce-integration'); ?></p>
    667                                                                      <a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/" class="button button-primary">
     686                                                                     <a target="_blank" href="https://www.themehigh.com/docs/stripe-payment-plugin-for-woocommerce-free/" class="button button-primary">
    668687                                                                         <?php esc_html_e('Documentation','payment-gateway-stripe-and-woocommerce-integration'); ?>       
    669688                                                                     </a>
     
    673692                                                                     <h3><?php esc_html_e('Support','payment-gateway-stripe-and-woocommerce-integration'); ?></h3>
    674693                                                                     <p><?php esc_html_e('We would love to help you on any queries or issues.','payment-gateway-stripe-and-woocommerce-integration'); ?></p>
    675                                                                      <a target="_blank" href="https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/" class="button button-primary">
     694                                                                     <a target="_blank" href="https://www.themehigh.com/docs/support/" class="button button-primary">
    676695                                                                         <?php esc_html_e('Contact us','payment-gateway-stripe-and-woocommerce-integration'); ?>
    677696                                                                     </a>
     
    13131332            $mode = isset($settings['eh_stripe_mode']) ? $settings['eh_stripe_mode'] : 'live';           
    13141333        }
    1315 
    1316         $option = ('test' === $mode) ? 'wt_stripe_oauth_connected_test' : 'wt_stripe_oauth_connected_live';
    1317        
     1334        //$option = ('test' === $mode) ? 'wt_stripe_oauth_connected_test' : 'wt_stripe_oauth_connected_live';
     1335        if ( 'test' === $mode ) {
     1336
     1337            $test_mode_type = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     1338            $option = ( 'sandbox' === $test_mode_type )
     1339                ? 'wt_stripe_oauth_connected_sandbox'
     1340                : 'wt_stripe_oauth_connected_test';
     1341        } else {
     1342            $option = 'wt_stripe_oauth_connected_live';
     1343        }
     1344
    13181345        if("yes" === EH_Stripe_Token_Handler::wtst_get_site_option('get', array('name' => $option))){
    13191346            return true;
     
    13241351    }
    13251352
    1326     static function wt_get_install_link($mode)
     1353    static function wt_get_install_link($mode, $test_mode_type = false)
    13271354    {
     1355        if ( is_admin() ) {
     1356            if ( isset( $_REQUEST['oauth_error'] ) || isset( $_REQUEST['oauth_status'] ) ) {
     1357
     1358            unset(
     1359                $_GET['oauth_error'],
     1360                $_GET['oauth_status'],
     1361                $_REQUEST['oauth_error'],
     1362                $_REQUEST['oauth_status']
     1363            );
     1364        }
     1365        }
    13281366        //Stripe oAuth customer site URL
    1329         $site_url = add_query_arg( array( 'wc-api'=> 'wt_stripe_oauth_update', 'mode' => $mode, 'name' => EH_STRIPE_PLUGIN_NAME), trailingslashit( get_home_url() ));
    1330         //sandbox
    1331         $client_id_test = 'ca_Pl5sdRX9ZIbMhFni2PDjsnkMEERxD3Ye';
    1332 
    1333         //live
    1334         $client_id_live = 'ca_Pl5sCXjmB1vQPLI6ewCrUibnq1DojGbA';   
    1335        
     1367        $site_url = add_query_arg( array(
     1368            'wc-api'=> 'wt_stripe_oauth_update',
     1369            'mode' => $mode,
     1370            'test_mode_type' => $test_mode_type,
     1371            'name' => EH_STRIPE_PLUGIN_NAME),
     1372            trailingslashit( home_url( '/', 'https' ) )
     1373        );
     1374         
    13361375        $user_id = get_current_user_id();
    1337 
    13381376        if ( $user_id ) {
     1377            delete_user_meta( $user_id, 'wtst_random_key' );
    13391378            // Generate a random secure key (32 characters)
    13401379            $random_key = wp_generate_password(32, true, true);
     
    13481387                'key'     => $random_key,
    13491388            );
    1350 
    13511389         
    13521390        }
    13531391       
    1354 
    13551392        $state = base64_encode(wp_json_encode(array(
    13561393            'site' => $site_url,
     
    13581395        )));
    13591396
     1397        $test_mode_type = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     1398
     1399        //Stripe oAuth URL       
     1400        //themehigh ids - need to change after publish the app
     1401        //test mode - https://marketplace.stripe.com/oauth/v2/authorize?client_id=ca_SrijWXrA8Rsh8T1Ol5Ebrist8calvSni&redirect_uri=https://verify-stripe.themehigh.com/wp-json/wt-stripe/v1/oauth
     1402        //sandbox mode -  https://marketplace.stripe.com/oauth/v2/authorize?client_id=ca_Srijfd5TDVdeLI8pWEMvcHp0NYNxqlxk&redirect_uri=https://verify-stripe.themehigh.com/wp-json/wt-stripe/v1/oauth
     1403        //live mode - https://marketplace.stripe.com/oauth/v2/authorize?client_id=ca_SrijCzqvjxjpzH7hnfQKzcMSEEJ4YaUJ&redirect_uri=https://verify-stripe.themehigh.com/wp-json/wt-stripe/v1/oauth
     1404
     1405        //test
     1406        $client_id_test = 'ca_SrijWXrA8Rsh8T1Ol5Ebrist8calvSni';
     1407        //sandbox
     1408        $client_id_sandbox = 'ca_Srijfd5TDVdeLI8pWEMvcHp0NYNxqlxk';
     1409        //live
     1410        $client_id_live = 'ca_SrijCzqvjxjpzH7hnfQKzcMSEEJ4YaUJ';
     1411
    13601412
    13611413        if('test' === $mode){
    1362             return add_query_arg( array('client_id' => $client_id_test, "redirect_uri" => EH_STRIPE_OAUTH_WT_URL ."oauth", "state" => $state, 'scope' => 'read_write' ), "https://marketplace.stripe.com/oauth/v2/authorize" );
    1363 
     1414            if($test_mode_type && 'sandbox' === $test_mode_type){
     1415
     1416                return add_query_arg( array(
     1417                    'client_id' => $client_id_sandbox,
     1418                    "redirect_uri" => EH_STRIPE_OAUTH_TH_URL ."oauth",
     1419                    "state" => $state,
     1420                    'scope' => 'read_write' ),
     1421                    "https://marketplace.stripe.com/oauth/v2/authorize"
     1422                );
     1423            }else{
     1424                return add_query_arg( array(
     1425                    'client_id' => $client_id_test,
     1426                    "redirect_uri" => EH_STRIPE_OAUTH_TH_URL ."oauth",
     1427                    "state" => $state,
     1428                    'scope' => 'read_write' ),
     1429                    "https://marketplace.stripe.com/oauth/v2/authorize"
     1430                );
     1431            }
    13641432        }
    13651433        else{
    1366             return add_query_arg( array('client_id' => $client_id_live, "redirect_uri" => EH_STRIPE_OAUTH_WT_URL ."oauth", "state" => $state, 'scope' => 'read_write' ), "https://marketplace.stripe.com/oauth/v2/authorize" );
    1367 
     1434            return add_query_arg( array(
     1435                'client_id' => $client_id_live,
     1436                "redirect_uri" => EH_STRIPE_OAUTH_TH_URL ."oauth",
     1437                "state" => $state,
     1438                'scope' => 'read_write' ),
     1439                "https://marketplace.stripe.com/oauth/v2/authorize"
     1440            );
    13681441        }
    13691442    }
     
    15071580        </script>
    15081581        <?php
    1509     }     
     1582    } 
     1583   
     1584    /**
     1585     * @since 5.0.7
     1586     * Function to redirect to the settings page after plugin activation
     1587     * Themehigh added
     1588    */
     1589    public function redirect_to_stripe_settings(){
     1590
     1591        if ( ! is_admin() && defined( 'DOING_AJAX' ) ) {
     1592            return;
     1593        }
     1594        if(get_option('th_stripe_since',false)){
     1595            return;
     1596        }
     1597        update_option('th_stripe_since', time(), 'no');
     1598        wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wt_stripe_menu' ) ) );
     1599        exit();
     1600       
     1601    }
    15101602   
    15111603}
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-eh-security-helper.php

    r3351963 r3433172  
    66
    77/**
    8  * Webtoffee Security Library
     8 * ThemeHigh Security Library
    99 *
    1010 * Includes Data sanitization, Access checking
    11  * @author     WebToffee <info@webtoffee.com>
     11 * @author     ThemeHigh <info@themehigh.com>
    1212 */
    1313
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-eh-stripe-token-handler.php

    r3351963 r3433172  
    3535                'WordPress Stripe Payment Gateway for WooCommerce',
    3636                EH_STRIPE_VERSION,
    37                 'https://www.webtoffee.com/product/woocommerce-stripe-payment-gateway/',
     37                'https://www.themehigh.com/product/woocommerce-stripe-payment-gateway/',
    3838                'pp_partner_KHip9dhhenLx0S'
    3939            );
     
    4949    private static function get_stripe_api_key(){
    5050       
    51         $stripe_settings  = get_option( 'woocommerce_eh_stripe_pay_settings' );
     51        $stripe_settings  = get_option( 'woocommerce_eh_stripe_pay_settings');
    5252        if(!$stripe_settings){
    5353            return false;
    5454        }       
    5555        $mode = isset($stripe_settings['eh_stripe_mode']) ? $stripe_settings['eh_stripe_mode'] : 'live';
     56        $test_mode = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
    5657        if(!empty($mode)){
    5758            if(Eh_Stripe_Admin_Handler::wtst_oauth_compatible($mode)){
    5859                if(!self::wtst_get_oauth_expired($mode)){
    59                     $wt_stripe_access_token = $mode === 'test' ? 'wt_stripe_access_token_test' : 'wt_stripe_access_token_live';
     60                    //$wt_stripe_access_token = $mode === 'test' ? 'wt_stripe_access_token_test' : 'wt_stripe_access_token_live';
     61                    if ( 'test' === $mode ) {
     62                        $wt_stripe_access_token = ( 'sandbox' === $test_mode )
     63                            ? 'wt_stripe_access_token_sandbox'
     64                            : 'wt_stripe_access_token_test';
     65                    } else {
     66                        $wt_stripe_access_token = 'wt_stripe_access_token_live';
     67                    }
    6068                    return base64_decode(self::wtst_get_site_option('get', array('name' => $wt_stripe_access_token)));
    6169                } else {
    6270                    return self::wtst_refresh_token();
    63                  }
     71                }
    6472            }
    6573   
     
    8997     *
    9098     */
    91     private static function wtst_refresh_token($force = false)
     99   /* private static function wtst_refresh_token($force = false)
    92100    {
    93101        $lock_folder_path = self::get_temp_dir();
     
    104112            }
    105113
    106             $stripe_settings = get_option("woocommerce_eh_stripe_pay_settings");
     114            $stripe_settings = get_option("woocommerce_eh_stripe_pay_settings", array());
    107115            $stripe_settings["eh_stripe_mode"] = (isset($stripe_settings["eh_stripe_mode"]) && !empty($stripe_settings["eh_stripe_mode"])) ? $stripe_settings["eh_stripe_mode"] : 'live';
     116            $test_mode = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
    108117
    109118            if(!self::wtst_get_oauth_expired($stripe_settings["eh_stripe_mode"]) && !$force){
    110119                $wt_stripe_access_token =  $stripe_settings["eh_stripe_mode"] === 'test' ? 'wt_stripe_access_token_test' : 'wt_stripe_access_token_live';
     120                $wt_stripe_access_token = ($stripe_settings["eh_stripe_mode"] === 'test' && $test_mode === 'sandbox') ? 'wt_stripe_access_token_sandbox' : $wt_stripe_access_token;
    111121                return base64_decode(self::wtst_get_site_option('get', array('name' => $wt_stripe_access_token)));
    112122            }
     123
     124            $app_author = get_option('eh_stripe_connected_app_author');
    113125
    114126            // Ensure the file handle is a valid resource before attempting to lock
    115127            if (is_resource($lock_handle) && flock($lock_handle, LOCK_EX | LOCK_NB)) {
    116128                try {
     129                    $access_token_url = EH_STRIPE_OAUTH_TH_URL . 'get-access-token';
     130                    if(!$app_author || $app_author !== 'themehigh'){
     131                        $access_token_url = EH_STRIPE_OAUTH_WT_URL . 'get-access-token';
     132                    }
    117133                   
    118                     $access_token_url = EH_STRIPE_OAUTH_WT_URL . 'get-access-token';
    119 
    120134                    $instance = self::get_instance();
    121135
    122136                    if('test' === $stripe_settings["eh_stripe_mode"]){
    123137                        //Clear cache for the tokens to get the newly updated values
    124                         $instance->wtst_clear_cache_for_options(array('wt_stripe_refresh_token_test', 'wt_stripe_account_id_test'));
    125 
    126                         $refresh_token = base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_test')));
    127                         $account_id = self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_test'));
     138                        if($test_mode === 'sandbox'){
     139                            $instance->wtst_clear_cache_for_options(array('wt_stripe_refresh_token_sandbox', 'wt_stripe_account_id_sandbox'));
     140
     141                            $refresh_token = base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_sandbox')));
     142                            $account_id = self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_sandbox'));
     143
     144                        }else{
     145                            $instance->wtst_clear_cache_for_options(array('wt_stripe_refresh_token_test', 'wt_stripe_account_id_test'));
     146
     147                            $refresh_token = base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_test')));
     148                            $account_id = self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_test'));
     149                        }
    128150                    }
    129151                    else{
     
    145167                        'refresh_token' => sanitize_text_field($refresh_token),
    146168                        'mode' => sanitize_text_field($stripe_settings["eh_stripe_mode"]),
     169                        'test_mode_type' => sanitize_text_field($test_mode),
    147170                        'account_id' => sanitize_text_field($account_id),
    148171
     
    212235                       
    213236                            $mode_prefix = ('test' === $stripe_settings["eh_stripe_mode"]) ? 'test' : 'live';
     237                            $mode_prefix = ('test' === $stripe_settings ["eh_stripe_mode"] && $test_mode === 'sandbox'] ? 'sandbox' : $mode_prefix;
    214238                            $option_names = [
    215239                                'wtst_oauth_expriy_' . $mode_prefix => time(),
     
    258282                    if(!is_admin()){
    259283                        if (function_exists('wc_add_notice')) {
    260                             /* translators: Error message asking user to try again later */
     284                            // translators: Error message asking user to try again later
    261285                            wc_add_notice(__('Please try again after some time', 'payment-gateway-stripe-and-woocommerce-integration'), 'error');
    262286                        }
     
    286310                    if(!is_admin()){
    287311                        if (function_exists('wc_add_notice')) {
    288                             /* translators: Error message asking user to try again later */
     312                            // translators: Error message asking user to try again later
    289313                            wc_add_notice(__('Please try again after some time', 'payment-gateway-stripe-and-woocommerce-integration'), 'error');
    290314                        }
     
    293317            }
    294318        }
    295     }
     319    }*/
     320
     321    /*************  Refresh token function -START ***********/
     322
     323    private static function wtst_refresh_token( $force = false ) {
     324
     325        $lock_file_path = self::get_temp_dir() . '/stripe_token_refresh.lock';
     326        $max_retries    = 3;
     327        $retry_delay    = 2;
     328
     329        // Resolve settings safely
     330        $stripe_settings = get_option( 'woocommerce_eh_stripe_pay_settings', array() );
     331        $mode = ! empty( $stripe_settings['eh_stripe_mode'] ) ? $stripe_settings['eh_stripe_mode'] : 'live';
     332        $test_mode = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     333
     334        // Fast-path: token still valid and no force refresh
     335        if ( ! self::wtst_get_oauth_expired( $mode ) && ! $force ) {
     336            return self::get_current_access_token($mode, $test_mode);
     337        }
     338
     339        for ( $attempt = 1; $attempt <= $max_retries; $attempt++ ) {
     340            // Open lock file
     341            // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen -- Needed for file locking with flock()
     342            $lock_handle = fopen( $lock_file_path, 'c+' );
     343            if ( ! $lock_handle ) {
     344                EH_Stripe_Log::log_update( 'oauth', 'Unable to open lock file', 'Refresh token error' );
     345                return false;
     346            }
     347
     348            // Try to acquire lock
     349            if ( ! flock( $lock_handle, LOCK_EX | LOCK_NB ) ) {
     350                // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Closing lock file
     351                fclose( $lock_handle );
     352
     353                if ( $attempt < $max_retries ) {
     354                    sleep( $retry_delay );
     355                    continue;
     356                }
     357
     358                EH_Stripe_Log::log_update( 'oauth', 'Failed to acquire refresh lock after retries', 'Refresh token error');
     359                self::handle_refresh_error();
     360                return false;
     361            }
     362            // Lock acquired - proceed with refresh
     363            try {
     364                // Double-check expiry after acquiring lock (another process may have refreshed)
     365                if ( ! self::wtst_get_oauth_expired( $mode ) && ! $force ) {
     366                    // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_flock -- Required for atomic locking
     367                    flock( $lock_handle, LOCK_UN );
     368                    // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Closing lock file
     369                    fclose( $lock_handle );
     370                    return self::get_current_access_token($mode, $test_mode);
     371                }
     372                return self::execute_token_refresh($mode, $test_mode);
     373               
     374            } catch ( Exception $e ) {
     375
     376                EH_Stripe_Log::log_update( 'oauth', $e->getMessage(), 'Refresh token error' );
     377                self::handle_refresh_error();
     378
     379            } finally {
     380                // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_flock -- Required for atomic locking
     381                flock( $lock_handle, LOCK_UN );
     382                // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose -- Closing lock file
     383                fclose( $lock_handle );
     384            }
     385        }
     386
     387        return false;
     388    }
     389
     390    /**
     391     * Get current valid access token
     392     */
     393    private static function get_current_access_token($mode, $test_mode){
     394        $token_option = ('test' === $mode)
     395            ? ('sandbox' === $test_mode ? 'wt_stripe_access_token_sandbox' : 'wt_stripe_access_token_test')
     396            : 'wt_stripe_access_token_live';
     397       
     398        $token = self::wtst_get_site_option('get', array('name' => $token_option));
     399        return $token ? base64_decode($token) : false;
     400    }
     401    /**
     402     * Execute the actual token refresh logic
     403    */
     404    private static function execute_token_refresh($mode, $test_mode) {
     405
     406        $instance   = self::get_instance();
     407        $app_author = get_option( 'eh_stripe_connected_app_author' );
     408
     409        $access_token_url = ( $app_author === 'themehigh' )
     410            ? EH_STRIPE_OAUTH_TH_URL . 'get-access-token'
     411            : EH_STRIPE_OAUTH_WT_URL . 'get-access-token';
     412
     413        // Resolve refresh token + account ID
     414        if ( 'test' === $mode ) {
     415
     416            if ( 'sandbox' === $test_mode ) {
     417                $instance->wtst_clear_cache_for_options(
     418                    array( 'wt_stripe_refresh_token_sandbox', 'wt_stripe_account_id_sandbox' )
     419                );
     420                $refresh_token = base64_decode(
     421                    self::wtst_get_site_option( 'get', array( 'name' => 'wt_stripe_refresh_token_sandbox' ) )
     422                );
     423                $account_id = self::wtst_get_site_option( 'get', array( 'name' => 'wt_stripe_account_id_sandbox' ) );
     424                $mode_prefix = 'sandbox';
     425            } else {
     426                $instance->wtst_clear_cache_for_options(
     427                    array( 'wt_stripe_refresh_token_test', 'wt_stripe_account_id_test' )
     428                );
     429                $refresh_token = base64_decode(
     430                    self::wtst_get_site_option( 'get', array( 'name' => 'wt_stripe_refresh_token_test' ) )
     431                );
     432                $account_id = self::wtst_get_site_option( 'get', array( 'name' => 'wt_stripe_account_id_test' ) );
     433                $mode_prefix = 'test';
     434            }
     435        } else {
     436            $instance->wtst_clear_cache_for_options(
     437                array( 'wt_stripe_refresh_token_live', 'wt_stripe_account_id_live' )
     438            );
     439            $refresh_token = base64_decode(
     440                self::wtst_get_site_option( 'get', array( 'name' => 'wt_stripe_refresh_token_live' ) )
     441            );
     442            $account_id = self::wtst_get_site_option( 'get', array( 'name' => 'wt_stripe_account_id_live' ) );
     443            $mode_prefix = 'live';
     444        }
     445
     446        if ( ! $refresh_token ) {
     447            require_once EH_STRIPE_MAIN_PATH . 'includes/class-stripe-oauth.php';
     448            EH_Stripe_Oauth::wtst_oauth_disconnect( true );
     449            throw new Exception( 'Refresh token missing' );
     450        }
     451        // Make API request
     452        $response = self::make_refresh_request($access_token_url, $refresh_token, $mode, $test_mode, $account_id);
     453        // Process and store response
     454        return self::process_refresh_response($response, $mode_prefix);
     455
     456    }
     457
     458    private static function make_refresh_request($url, $refresh_token, $mode, $test_mode, $account_id){
     459
     460        $request_body = wp_json_encode(
     461            array(
     462                'refresh_token'  => sanitize_text_field( $refresh_token ),
     463                'mode'           => $mode,
     464                'test_mode_type' => $test_mode,
     465                'account_id'     => sanitize_text_field( $account_id ),
     466            )
     467        );
     468
     469        $response = wp_safe_remote_post(
     470            $url,
     471            array(
     472                'body'    => $request_body,
     473                'headers' => array(
     474                    'Content-Type' => 'application/json',
     475                    'User-Agent'   => self::wt_get_api_user_agent(),
     476                ),
     477                'timeout' => apply_filters("wtst_refresh_token_timeout", 60), // Optional: Set a timeout for the request.
     478                'connect_timeout' => apply_filters("wtst_refresh_token_connect_timeout", 25), // Connection timeout
     479            )
     480        );
     481
     482        EH_Stripe_Log::log_update('oauth', $response,'Refresh token API response');
     483
     484        if ( is_wp_error( $response ) ) {
     485            // There was an error in the request.
     486            throw new Exception(
     487                'WP error - ' . esc_html( $response->get_error_message() )
     488            );
     489        }
     490        return $response;
     491    }
     492
     493    /**
     494     * Process the refresh token response
     495     */
     496    private static function process_refresh_response($response, $mode_prefix){
     497
     498        $body = wp_remote_retrieve_body( $response );
     499        if ( empty( $body ) ) {
     500            throw new Exception( 'Empty OAuth response body' );
     501        }
     502
     503        $response_body = json_decode( $body, true );
     504        if ( ! is_array( $response_body ) ) {
     505            throw new Exception( 'Invalid OAuth JSON response' );
     506        }
     507
     508        $should_disconnect = false;
     509
     510        if ( isset( $response_body['error'] ) ) {
     511
     512            if ( $response_body['error'] === 'invalid_grant' ) {
     513                $should_disconnect = true;
     514            }
     515
     516            if (
     517                isset( $response_body['error_description'] ) &&
     518                stripos( $response_body['error_description'], 'invalid_grant' ) !== false
     519            ) {
     520                $should_disconnect = true;
     521            }
     522
     523            if (
     524                isset( $response_body['error_description'] ) &&
     525                stripos( $response_body['error_description'], 'refresh_token' ) !== false &&
     526                stripos( $response_body['error_description'], 'empty' ) !== false
     527            ) {
     528                $should_disconnect = true;
     529            }
     530        }
     531
     532        if ( $should_disconnect ) {
     533            require_once EH_STRIPE_MAIN_PATH . 'includes/class-stripe-oauth.php';
     534            EH_Stripe_Oauth::wtst_oauth_disconnect( true );
     535            throw new Exception( 'OAuth refresh token revoked' );
     536        }
     537
     538        // reuse parsed response
     539        $decoded = $response_body;
     540        EH_Stripe_Log::log_update('oauth', $decoded,'Refresh token API response parsed');
     541
     542        if ( isset( $decoded['error'] ) ) {
     543           
     544            throw new Exception(
     545                'Error: ' .
     546                esc_html( $decoded['error'] ?? '' ) . ' ' .
     547                esc_html( $decoded['error_description'] ?? '' )
     548            );
     549        }
     550        if ( empty( $decoded['access_token'] ) || empty( $decoded['refresh_token'] ) ) {
     551            throw new Exception( 'Invalid refresh response' );
     552        }
     553
     554        $option_updates = array(
     555            'wtst_oauth_expriy_' . $mode_prefix        => time(),
     556            'wt_stripe_access_token_' . $mode_prefix  => base64_encode( sanitize_text_field( $decoded['access_token'] ) ),
     557            'wt_stripe_refresh_token_' . $mode_prefix => base64_encode( sanitize_text_field( $decoded['refresh_token'] ) ),
     558            'wt_stripe_' . $mode_prefix . '_publishable_key'
     559                => sanitize_text_field( $decoded['stripe_publishable_key'] ?? '' ),
     560        );
     561
     562        foreach ( $option_updates as $name => $value ) {
     563            self::wtst_get_site_option( 'update', array( 'name' => $name, 'value' => $value ) );
     564        }
     565
     566        // Schedule recurring refresh
     567        if (function_exists('as_unschedule_all_actions')) {
     568            as_unschedule_all_actions('eh_stripe_refresh_oauth_token', null);
     569        }
     570        if (!as_next_scheduled_action('eh_stripe_refresh_oauth_token')) {
     571            as_schedule_recurring_action(
     572                time() + 50 * MINUTE_IN_SECONDS, // ✅ first run AFTER 50 minutes
     573                50 * MINUTE_IN_SECONDS,
     574                'eh_stripe_refresh_oauth_token'
     575            );
     576        }
     577
     578        return sanitize_text_field( $decoded['access_token'] );
     579
     580    }
     581
     582    /**
     583     * Handle refresh errors consistently
     584     */
     585    private static function handle_refresh_error(){
     586
     587        if (!is_admin() && ! wp_doing_cron() && function_exists('wc_add_notice')) {
     588            wc_add_notice(
     589                __('Please try again after some time', 'payment-gateway-stripe-and-woocommerce-integration'),
     590                'error'
     591            );
     592        }
     593    }
     594
     595    /*************  Refresh token function - End ***********/
    296596
    297597    /**
     
    301601     *
    302602     */
    303     public static function wtst_get_stripe_tokens($mode) {
    304         if(!empty($mode)) {
    305             $instance = self::get_instance();
    306             if ('test' === $mode) {
    307                 //Clear cache for the tokens to get the newly updated values
    308                 $instance->wtst_clear_cache_for_options(array('wt_stripe_refresh_token_test', 'wt_stripe_account_id_test', 'wt_stripe_access_token_test', 'wt_stripe_test_publishable_key'));
    309 
    310                 return array(
    311                    "wt_stripe_account_id" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_test')),
    312                    "wt_stripe_access_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_test'))),
    313                    "wt_stripe_refresh_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_test'))),
    314                    "wt_stripe_publishable_key" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_test_publishable_key')),
    315                 );
    316             } else {
    317                 //Clear cache for the tokens to get the newly updated values
    318                 $instance->wtst_clear_cache_for_options(array('wt_stripe_account_id_live', 'wt_stripe_access_token_live', 'wt_stripe_refresh_token_live', 'wt_stripe_live_publishable_key'));
    319 
    320                 return array(
    321                    "wt_stripe_account_id" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_live')),
    322                    "wt_stripe_access_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_live'))),
    323                    "wt_stripe_refresh_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_live'))),
    324                    "wt_stripe_publishable_key" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_live_publishable_key')),
    325                 );             
    326             }
    327         }
    328     }
     603    // public static function wtst_get_stripe_tokens($mode, $test_mode = false) {
     604    //     if(!empty($mode)) {
     605    //         $instance = self::get_instance();
     606           
     607    //         if ('test' === $mode) {
     608
     609    //             $test_mode =  !$test_mode ? EH_Stripe_Token_Handler::get_stripe_test_mode_type() : $test_mode;
     610    //             if($test_mode === 'sandbox'){
     611    //                 //Clear cache for the tokens to get the newly updated values
     612    //                 $instance->wtst_clear_cache_for_options(array('wt_stripe_refresh_token_sandbox', 'wt_stripe_account_id_sandbox', 'wt_stripe_access_token_sandbox', 'wt_stripe_sandbox_publishable_key'));
     613
     614    //                 return array(
     615    //                    "wt_stripe_account_id" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_sandbox')),
     616    //                    "wt_stripe_access_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_sandbox'))),
     617    //                    "wt_stripe_refresh_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_sandbox'))),
     618    //                    "wt_stripe_publishable_key" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_sandbox_publishable_key')),
     619    //                 );
     620    //             }
     621    //             //Clear cache for the tokens to get the newly updated values
     622    //             $instance->wtst_clear_cache_for_options(array('wt_stripe_refresh_token_test', 'wt_stripe_account_id_test', 'wt_stripe_access_token_test', 'wt_stripe_test_publishable_key'));
     623
     624    //             return array(
     625    //                "wt_stripe_account_id" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_test')),
     626    //                "wt_stripe_access_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_test'))),
     627    //                "wt_stripe_refresh_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_test'))),
     628    //                "wt_stripe_publishable_key" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_test_publishable_key')),
     629    //             );
     630    //         } else {
     631    //             //Clear cache for the tokens to get the newly updated values
     632    //             $instance->wtst_clear_cache_for_options(array('wt_stripe_account_id_live', 'wt_stripe_access_token_live', 'wt_stripe_refresh_token_live', 'wt_stripe_live_publishable_key'));
     633
     634    //             return array(
     635    //                "wt_stripe_account_id" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_live')),
     636    //                "wt_stripe_access_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_live'))),
     637    //                "wt_stripe_refresh_token" => base64_decode(self::wtst_get_site_option('get', array('name' => 'wt_stripe_refresh_token_live'))),
     638    //                "wt_stripe_publishable_key" => self::wtst_get_site_option('get', array('name' => 'wt_stripe_live_publishable_key')),
     639    //             );             
     640    //         }
     641    //     }
     642    // }
     643
     644    public static function wtst_get_stripe_tokens( $mode, $test_mode = null ) {
     645
     646        if ( empty( $mode ) ) {
     647            return false;
     648        }
     649
     650        $instance = self::get_instance();
     651
     652        if ( 'test' === $mode ) {
     653
     654            $test_mode = $test_mode ?: EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     655            $prefix    = ( 'sandbox' === $test_mode ) ? 'sandbox' : 'test';
     656
     657        } else {
     658            $prefix = 'live';
     659        }
     660
     661        // Clear cache (if required)
     662        $instance->wtst_clear_cache_for_options( array(
     663            "wt_stripe_account_id_{$prefix}",
     664            "wt_stripe_access_token_{$prefix}",
     665            "wt_stripe_refresh_token_{$prefix}",
     666            "wt_stripe_{$prefix}_publishable_key",
     667        ) );
     668
     669        $account_id     = self::wtst_get_site_option( 'get', array( 'name' => "wt_stripe_account_id_{$prefix}" ) );
     670        $access_token   = self::wtst_get_site_option( 'get', array( 'name' => "wt_stripe_access_token_{$prefix}" ) );
     671        $refresh_token  = self::wtst_get_site_option( 'get', array( 'name' => "wt_stripe_refresh_token_{$prefix}" ) );
     672        $publishable_key = self::wtst_get_site_option( 'get', array( 'name' => "wt_stripe_{$prefix}_publishable_key" ) );
     673
     674        return array(
     675            'wt_stripe_account_id'      => $account_id ?: '',
     676            'wt_stripe_access_token'    => $access_token ? base64_decode( $access_token ) : '',
     677            'wt_stripe_refresh_token'   => $refresh_token ? base64_decode( $refresh_token ) : '',
     678            'wt_stripe_publishable_key' => $publishable_key ?: '',
     679        );
     680    }
    329681
    330682
     
    358710            // Clear specific option cache
    359711            wp_cache_delete($option_name, 'options');
     712            // Multisite (network) options
     713            wp_cache_delete($option_name, 'site-options');
    360714
    361715        }
     
    466820     */
    467821    public static function wtst_get_oauth_expired($mode){
    468         $wtst_oauth_expriy_name = $mode === 'test' ? 'wtst_oauth_expriy_test' : 'wtst_oauth_expriy_live';
    469         $expiry_time = self::wtst_get_site_option('get', array('name' => $wtst_oauth_expriy_name ));
     822       
     823        $test_mode = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     824        if ( 'test' === $mode ) {
     825            $option = ( 'sandbox' === $test_mode )
     826                ? 'wtst_oauth_expriy_sandbox'
     827                : 'wtst_oauth_expriy_test';
     828        } else {
     829            $option = 'wtst_oauth_expriy_live';
     830        }
     831        $expiry_time = self::wtst_get_site_option('get', array('name' => $option ));
    470832        if ($expiry_time && (time() - $expiry_time) <= 3000) { // 3000 seconds = 50 minutes
    471833            return false;
     
    524886
    525887        return apply_filters('eh_stripe_api_user_agent', $user_agent);
    526     }     
     888    } 
     889   
     890    /** Themehigh added */
     891    public static function get_stripe_test_mode_type() {
     892        $mode = get_option("woocommerce_eh_stripe_test_mode_type");
     893        return ( $mode === 'sandbox' ) ? 'sandbox' : 'test';
     894    }
    527895}
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-gateway-stripe-alipay.php

    r3351963 r3433172  
    6666                'type' => 'title',
    6767                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    68                 'description' => sprintf( __('%1$sSupported currencies: %2$s CNY, AUD, CAD, EUR, GBP, HKD, JPY, MYR, NZD, SGD, USD %3$s.%4$sStripe accounts in the following countries can accept the payment: %5$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malaysia, Malta, Netherlands, New Zealand, Norway, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%6$s %7$s Read documentation %8$s ', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b>', '</li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#alipay">', '</a></p>'),
     68                'description' => sprintf( __('%1$sSupported currencies: %2$s CNY, AUD, CAD, EUR, GBP, HKD, JPY, MYR, NZD, SGD, USD %3$s.%4$sStripe accounts in the following countries can accept the payment: %5$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malaysia, Malta, Netherlands, New Zealand, Norway, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%6$s %7$s Read documentation %8$s ', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b>', '</li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-alipay-payment-method-for-a-woocommerce-store/">', '</a></p>'),
    6969            ),
    7070            'eh_stripe_alipay_form_title'   => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-afterpay.php

    r3351963 r3433172  
    6666                'type' => 'title',
    6767                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    68                 'description' => sprintf(__('%1$sSupported currencies: %2$sUSD, CAD, GBP, AUD, NZD, EUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Canada, New Zealand, United Kingdom, United States%5$s%6$s%7$sRead documentation%8$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#afterpay">', '</a></p>', ''),
     68                'description' => sprintf(__('%1$sSupported currencies: %2$sUSD, CAD, GBP, AUD, NZD, EUR%3$sStripe accounts in the following countries can accept the payment: %2$sAustralia, Canada, New Zealand, United Kingdom, United States%3$s</li></ul><p><a target="_blank" href="https://www.themehigh.com/docs/set-up-afterpay-or-clearpay-payment-method-for-a-woocommerce-store/">Read documentation</a></p></div>', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>'),
    6969            ),
    7070
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-api.php

    r3351963 r3433172  
    6868
    6969        /* translators: %s: Documentation link text */
    70         $this->method_description = sprintf(__("Accepts Stripe payments via credit or debit card. <p><a target='_blank' href='https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#credit_debit'>%s</a></p>", 'payment-gateway-stripe-and-woocommerce-integration'), esc_html__("Read documentation", 'payment-gateway-stripe-and-woocommerce-integration'));
     70        $this->method_description = sprintf(__("Accepts Stripe payments via credit or debit card. <p><a target='_blank' href='https://www.themehigh.com/docs/stripe-payment-plugin-for-woocommerce-free/#credit_debit_cards'>%s</a></p>", 'payment-gateway-stripe-and-woocommerce-integration'), esc_html__("Read documentation", 'payment-gateway-stripe-and-woocommerce-integration'));
    7171
    7272        if ('test' === $this->eh_stripe_mode) {
     
    122122     */
    123123    public function process_admin_options(){
     124
     125        //save test mode types
     126        if (isset($_POST['woocommerce_eh_stripe_test_mode_type_hidden'])) {
     127            $mode = sanitize_text_field($_POST['woocommerce_eh_stripe_test_mode_type_hidden']);
     128            if (in_array($mode, ['test', 'sandbox'], true)) {
     129                update_option('woocommerce_eh_stripe_test_mode_type', $mode);
     130            }
     131        }
    124132
    125133        parent::process_admin_options();
     
    858866                $card_brand = $wc_token->get_card_type();
    859867                $payment_method = $token;
    860                  $customer = get_user_meta($logged_in_userid, '_stripe_customer_id', true);
     868                //$customer = get_user_meta($logged_in_userid, '_stripe_customer_id', true);
     869                $customer = EH_Stripe_Payment::validate_and_clean_customer_id($logged_in_userid);
    861870                if (!$payment_method || !$customer) {
    862871                    throw new Exception(__("Invalid card. Please select another card or input a new card number", 'payment-gateway-stripe-and-woocommerce-integration'));
     
    881890               
    882891                   //check customer token is exist for the logged in user
    883                     $customer = get_user_meta($logged_in_userid, '_stripe_customer_id', true);
     892                    //$customer = get_user_meta($logged_in_userid, '_stripe_customer_id', true);
     893                    $customer = EH_Stripe_Payment::validate_and_clean_customer_id($logged_in_userid);
    884894                }
    885895
     
    10371047            $logged_in_userid = get_current_user_id();
    10381048           //check customer token is exist for the logged in user
    1039             $customer = get_user_meta($logged_in_userid, '_stripe_customer_id', true);
     1049            //$customer = get_user_meta($logged_in_userid, '_stripe_customer_id', true);
     1050            $customer = EH_Stripe_Payment::validate_and_clean_customer_id($logged_in_userid);
    10401051
    10411052             //create stripe customer
     
    15871598            return false;
    15881599        }
    1589     }     
     1600    }
     1601   
     1602    // public function save_custom_settings_for_test_mode() {
     1603       
     1604    //     if (isset($_POST['woocommerce_eh_stripe_test_mode_type_hidden'])) {
     1605    //         $mode = sanitize_text_field($_POST['woocommerce_eh_stripe_test_mode_type_hidden']);
     1606    //         if (in_array($mode, ['test', 'sandbox'], true)) {
     1607    //             update_option('woocommerce_eh_stripe_test_mode_type', $mode);
     1608    //         }
     1609    //     }
     1610    // }
     1611   
     1612     /**
     1613     * Themehigh added
     1614     * Validate Customer
     1615     * @since 5.0.0
     1616     * @param string $customer_id
     1617     *
     1618     */
     1619
     1620    public static function validate_and_clean_customer_id($user_id) {
     1621        $customer_id = get_user_meta($user_id, '_stripe_customer_id', true);
     1622       
     1623        if (empty($customer_id)) {
     1624            return '';
     1625        }
     1626       
     1627        try {
     1628            \Stripe\Customer::retrieve($customer_id);
     1629            return $customer_id;
     1630        } catch (\Stripe\Exception\InvalidRequestException $e) {
     1631            // Customer doesn't exist, remove invalid ID
     1632            delete_user_meta($user_id, '_stripe_customer_id');
     1633            return '';
     1634        }
     1635    }
    15901636 
    15911637}
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-apple-pay.php

    r3348088 r3433172  
    2626                'title' => sprintf('<span style="font-weight: bold; font-size: 15px; color:#23282d;">'.__( 'Apple Pay','payment-gateway-stripe-and-woocommerce-integration' ).'<span>'),
    2727                'type' => 'title',
    28                 'description' => __('Accepts payments via Apple Pay.', 'payment-gateway-stripe-and-woocommerce-integration') .' <div class="wt_info_div"><p> '.__('To use Apple Pay, you need to register all your web domains that display the Apple Pay button with Apple and verify ownership of each domain.', 'payment-gateway-stripe-and-woocommerce-integration').' </p> <p>'.__('Steps to register:', 'payment-gateway-stripe-and-woocommerce-integration').'</p><ol><li>Register your domain with Apple.</li><ul class="wt_notice_bar_style"><li> '.__('To do this, navigate to <a href="https://dashboard.stripe.com/settings/payment_method_domains" target="_blank">Settings > Payments > Payment method domains </a> from your Stripe dashboard and add your domain. All domains, whether in production or testing, must be registered. Don’t register your domain more than once per account.', 'payment-gateway-stripe-and-woocommerce-integration').' </li></ul><li>Verify ownership of your domain with Apple Pay.</li><ul class="wt_notice_bar_style"><li>'.__('Download the <a href="https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association"> domain association file </a> and host it at /.well-known/apple-developer-merchantid-domain-association on your site. For example, if you’re registering https://example.com, make that file available at https://example.com/.well-known/apple-developer-merchantid-domain-association.', 'payment-gateway-stripe-and-woocommerce-integration').'</li></ul></ol>  <p> '.__('Payment methods are only available when you use a', 'payment-gateway-stripe-and-woocommerce-integration').' <a href="https://docs.stripe.com/elements/express-checkout-element#supported-browsers" target="_blank">'.__(' supported browser', 'payment-gateway-stripe-and-woocommerce-integration').'</a> and pay in a supported currency.</p> </div><p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#apple_pay"> '.__('Read documentation', 'payment-gateway-stripe-and-woocommerce-integration').' </a></p>',
     28                'description' => __('Accepts payments via Apple Pay.', 'payment-gateway-stripe-and-woocommerce-integration') .' <div class="wt_info_div"><p> '.__('To use Apple Pay, you need to register all your web domains that display the Apple Pay button with Apple and verify ownership of each domain.', 'payment-gateway-stripe-and-woocommerce-integration').' </p> <p>'.__('Steps to register:', 'payment-gateway-stripe-and-woocommerce-integration').'</p><ol><li>Register your domain with Apple.</li><ul class="wt_notice_bar_style"><li> '.__('To do this, navigate to <a href="https://dashboard.stripe.com/settings/payment_method_domains" target="_blank">Settings > Payments > Payment method domains </a> from your Stripe dashboard and add your domain. All domains, whether in production or testing, must be registered. Don’t register your domain more than once per account.', 'payment-gateway-stripe-and-woocommerce-integration').' </li></ul><li>Verify ownership of your domain with Apple Pay.</li><ul class="wt_notice_bar_style"><li>'.__('Download the <a href="https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association"> domain association file </a> and host it at /.well-known/apple-developer-merchantid-domain-association on your site. For example, if you’re registering https://example.com, make that file available at https://example.com/.well-known/apple-developer-merchantid-domain-association.', 'payment-gateway-stripe-and-woocommerce-integration').'</li></ul></ol>  <p> '.__('Payment methods are only available when you use a', 'payment-gateway-stripe-and-woocommerce-integration').' <a href="https://docs.stripe.com/elements/express-checkout-element#supported-browsers" target="_blank">'.__(' supported browser', 'payment-gateway-stripe-and-woocommerce-integration').'</a> and pay in a supported currency.</p> </div><p><a target="_blank" href="https://www.themehigh.com/docs/stripe-payment-plugin-for-woocommerce-free/#apple_pay"> '.__('Read documentation', 'payment-gateway-stripe-and-woocommerce-integration').' </a></p>',
    2929            ),
    3030            'eh_stripe_apple_pay_title' => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-bacs.php

    r3348088 r3433172  
    147147                'type' => 'title',
    148148                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    149                 'description' => sprintf(__('%1$sTo accept payments via Bacs Direct Debit payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     149                'description' => sprintf(__('%1$sTo accept payments via Bacs Direct Debit payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    150150            ),           
    151151        );   
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-bancontact.php

    r3351963 r3433172  
    6969                'type' => 'title',
    7070                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    71                 'description' => sprintf(__('%1$sSupported currencies: %2$sEUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$sRead documentation%7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#bancontact">', '</a></p>'),
     71                'description' => sprintf(__('%1$sSupported currencies: %2$sEUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$sRead documentation%7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-bancontact-payment-method-for-a-woocommerce-store/">', '</a></p>'),
    7272            ),
    7373            'eh_stripe_bancontact_form_title'   => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-becs.php

    r3351963 r3433172  
    117117                'type' => 'title',
    118118                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    119                 'description' => sprintf(__('%1$sTo accept payments via BECS payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     119                'description' => sprintf(__('%1$sTo accept payments via BECS payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    120120            ),             
    121121        );   
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-boleto.php

    r3351963 r3433172  
    109109                'type' => 'title',
    110110                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    111                 'description' => sprintf(__('%1$sTo accept payments via Boleto payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     111                'description' => sprintf(__('%1$sTo accept payments via Boleto payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    112112            ),
    113113        );   
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-checkout.php

    r3348088 r3433172  
    3737        $this->description             = $this->get_option( 'eh_stripe_checkout_description' );
    3838        /* translators: %1$s: Opening paragraph tag with style, %2$s: Dashboard link opening, %3$s: Dashboard link closing, %4$s: Preview link opening, %5$s: Preview link closing, %6$s: Closing paragraph tag, %7$s: Documentation link opening, %8$s: Documentation link closing, %9$s: Closing paragraph tag */
    39         $this->method_description      = sprintf( __( '%1$sStripe Checkout redirects users to a secure, Stripe-hosted payment page to accept payment. You will have to specify an account name in Stripe %2$sDashboard%3$s prior to configuring the settings. %4$sPreview%5$s%6$s%7$sRead documentation%8$s%9$s', 'payment-gateway-stripe-and-woocommerce-integration' ), '<p style="max-width: 97%;">', '<a href="https://dashboard.stripe.com/account" target="_blank">', '</a>', '<a class="thickbox" href="' . EH_STRIPE_MAIN_URL_PATH . 'assets/img/stripe_checkout_line_items.gif?TB_iframe=true&width=100&height=100" >', '</a>', '</p>','<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#stripe_checkout">', '</a>', '</p>' );
     39        $this->method_description      = sprintf( __( '%1$sStripe Checkout redirects users to a secure, Stripe-hosted payment page to accept payment. You will have to specify an account name in Stripe %2$sDashboard%3$s prior to configuring the settings. %4$sPreview%5$s%6$s%7$sRead documentation%8$s%9$s', 'payment-gateway-stripe-and-woocommerce-integration' ), '<p style="max-width: 97%;">', '<a href="https://dashboard.stripe.com/account" target="_blank">', '</a>', '<a class="thickbox" href="' . EH_STRIPE_MAIN_URL_PATH . 'assets/img/stripe_checkout_line_items.gif?TB_iframe=true&width=100&height=100" >', '</a>', '</p>','<p><a target="_blank" href="https://www.themehigh.com/docs/stripe-payment-plugin-for-woocommerce-free//#stripe_checkout">', '</a>', '</p>' );
    4040       
    4141        $this->enabled                 = $this->get_option( 'enabled' );
     
    181181                'type' => 'title',
    182182                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    183                 'description' => sprintf(__('%1$sTo accept payments via delayed payment methods from Stripe hosted page, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     183                'description' => sprintf(__('%1$sTo accept payments via delayed payment methods from Stripe hosted page, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    184184            ),             
    185185        );   
     
    567567        $user = wp_get_current_user();
    568568        $logged_in_userid = $user->ID;
    569         $customer_id = get_user_meta($logged_in_userid, '_stripe_ch_customer_id', true);
     569        //$customer_id = get_user_meta($logged_in_userid, '_stripe_ch_customer_id', true);
     570        $customer_id = $this->validate_and_clean_stripe_ch_customer_id($logged_in_userid);
    570571        //create stripe customer
    571572        if (empty($customer_id)) {
     
    893894
    894895    }
     896
     897    /**
     898     * Validates and cleans the Stripe Checkout customer ID.
     899     *themehigh added
     900     * @param int $user_id The user ID to validate.
     901     * @return string The valid Stripe Checkout customer ID or an empty string if invalid.
     902     */
     903    public function validate_and_clean_stripe_ch_customer_id($user_id) {
     904        $customer_id = get_user_meta($user_id, '_stripe_ch_customer_id', true);
     905       
     906        if (empty($customer_id)) {
     907            return '';
     908        }
     909       
     910        try {
     911            \Stripe\Customer::retrieve($customer_id);
     912            return $customer_id;
     913        } catch (\Stripe\Exception\InvalidRequestException $e) {
     914            // Customer doesn't exist, remove invalid ID
     915            delete_user_meta($user_id, '_stripe_ch_customer_id');
     916            return '';
     917        }
     918    }
    895919}
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-eps.php

    r3351963 r3433172  
    6969                'type' => 'title',
    7070                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    71                 'description' => sprintf(__('%1$sSupported currencies: %2$sEUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$sRead documentation%7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#eps">', '</a></p>'),
     71                'description' => sprintf(__('%1$sSupported currencies: %2$sEUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$sRead documentation%7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-eps-payment-method-for-a-woocommerce-store/">', '</a></p>'),
    7272            ),
    7373            'eh_stripe_eps_form_title'   => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-general-settings.php

    r3348088 r3433172  
    354354        $html = '';
    355355        $settings = get_option("woocommerce_eh_stripe_pay_settings");
    356          $mode = isset($settings['eh_stripe_mode']) ? $settings['eh_stripe_mode'] : 'live';
    357          if('test' === $mode ){       
     356        $mode = isset($settings['eh_stripe_mode']) ? $settings['eh_stripe_mode'] : 'live';
     357        $test_mode_type = get_option( 'woocommerce_eh_stripe_test_mode_type', 'test' );
     358        if('test' === $mode ){
     359
     360            $token_option = ( 'sandbox' === $test_mode_type )
     361                ? 'wt_stripe_access_token_sandbox'
     362                : 'wt_stripe_access_token_test';
     363
     364            $account_id_option = ( 'sandbox' === $test_mode_type )
     365                ? 'wt_stripe_account_id_sandbox'
     366                : 'wt_stripe_account_id_test';   
    358367            if(true === Eh_Stripe_Admin_Handler::wtst_oauth_compatible() &&
    359                 !empty(EH_Stripe_Token_Handler::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_test')))) {
    360                 $wt_stripe_account_id = EH_Stripe_Token_Handler::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_test'));
    361 
    362 
    363 
    364                $html = '<tr valign="top">
     368                !empty(EH_Stripe_Token_Handler::wtst_get_site_option('get', array('name' => $token_option)))) {
     369
     370                $wt_stripe_account_id = EH_Stripe_Token_Handler::wtst_get_site_option(
     371                    'get',
     372                    array( 'name' => $account_id_option )
     373                );
     374
     375                $html = $this->get_oauth_connection_warning_html($settings);
     376                $html .= '<tr valign="top">
    365377                    <th scope="row" class="titledesc">
    366378                        <label for="woocommerce_eh_stripe_test_oauth">Stripe account </label>
     
    373385            }
    374386            else{
    375                 $install_link = Eh_Stripe_Admin_Handler::wt_get_install_link($mode);
     387
     388                $html = $this->generate_test_mode_switch_button_html();
     389                $install_link = Eh_Stripe_Admin_Handler::wt_get_install_link($mode, $test_mode_type);
    376390                $message = __("You are in test mode. Connect to Stripe in live mode to receive payments.", "payment-gateway-stripe-and-woocommerce-integration");
    377                  $html = '<div class="wtst-notice wtst-notice-warning " ><div style="padding:10px">' . $message .'</div></div><tr valign="top"><td colspan="2" class="forminp forminp-' . sanitize_text_field($value['type']) . '"><div class="wtst-oauth-banner">
     391                 $html .= '<div class="wtst-notice wtst-notice-warning " ><div style="padding:10px">' . $message .'</div></div><tr valign="top"><td colspan="2" class="forminp forminp-' . sanitize_text_field($value['type']) . '"><div class="wtst-oauth-banner">
    378392                    <div class="wtst-oauth-banner-img" style="background-image: url(' . esc_url(EH_STRIPE_MAIN_URL_PATH."assets/img/oauth-banner.svg" ). ')"></div>
    379393                    <div class="wtst-oauth-banner-container"><div>' .  esc_html__("Connect your Stripe account to start testing", "payment-gateway-stripe-and-woocommerce-integration") .'</div>
     
    389403                !empty(EH_Stripe_Token_Handler::wtst_get_site_option('get', array('name' => 'wt_stripe_access_token_live')))) {
    390404                $wt_stripe_account_id = EH_Stripe_Token_Handler::wtst_get_site_option('get', array('name' => 'wt_stripe_account_id_live'));
    391 
    392                 $html = '<tr valign="top">
     405                $html = $this->get_oauth_connection_warning_html($settings);
     406                $html .= '<tr valign="top">
    393407                    <th scope="row" class="titledesc">
    394408                        <label for="woocommerce_eh_stripe_live_oauth">Stripe account </label>
     
    403417                $install_link = Eh_Stripe_Admin_Handler::wt_get_install_link($mode);
    404418
    405                  $html = '<tr valign="top"><td colspan="2" class="forminp forminp-' . sanitize_text_field($value['type']) . '"><div class="wtst-oauth-banner">
     419                $html = '<tr valign="top"><td colspan="2" class="forminp forminp-' . sanitize_text_field($value['type']) . '"><div class="wtst-oauth-banner">
    406420                    <div class="wtst-oauth-banner-img" style="background-image: url(' . esc_url(EH_STRIPE_MAIN_URL_PATH."assets/img/oauth-banner.svg" ). ')"></div>
    407421                    <div class="wtst-oauth-banner-container"><div>' .  esc_html__("You haven’t connected your Stripe account yet. Connect now to start receiving payments", "payment-gateway-stripe-and-woocommerce-integration") .'</div>
     
    449463        return $html;
    450464    }
    451 
    452 
     465    /**
     466     *
     467     * Function to generate payment mode switch html
     468     * @since 5.0.7
     469     */
     470    public function generate_test_mode_switch_button_html(){
     471
     472        $current_mode = get_option("woocommerce_eh_stripe_test_mode_type", 'test');
     473        $test_mode_text = $current_mode === 'sandbox' ?  __('Sandbox', 'payment-gateway-stripe-and-woocommerce-integration') : __('Test', 'payment-gateway-stripe-and-woocommerce-integration');
     474        $html = sprintf(
     475            '<tr>
     476                <th scope="row" style="width:100px;" >%1$s : %2$s</th>
     477                <td>
     478                   
     479                    <input type="hidden" name="woocommerce_eh_stripe_test_mode_type_hidden" id="woocommerce_eh_stripe_test_mode_type_hidden" value="%3$s" />
     480                    <p><em>Stripe supports two test modes: “Test” and “Sandbox”. Choose the appropriate mode based on your integration setup.</em></p>
     481
     482                    <span>
     483                        <a href="#" id="th_test_mode_type"  style="display:%4$s;">%5$s</a>
     484                        <a href="#" id="th_sandbox_mode_type"  style="display:%6$s;">%7$s</a>
     485                    </span>
     486                </td>
     487            </tr>',
     488            esc_html__('Test Mode', 'payment-gateway-stripe-and-woocommerce-integration'),
     489            esc_html($test_mode_text),
     490            esc_attr($current_mode), // for hidden input
     491            esc_attr($current_mode === 'test' ? 'inline-block' : 'none'),
     492            esc_html__('Switch to Sandbox Mode', 'payment-gateway-stripe-and-woocommerce-integration'),
     493            esc_attr($current_mode === 'sandbox' ? 'inline-block' : 'none'),
     494            esc_html__('Switch to Test Mode', 'payment-gateway-stripe-and-woocommerce-integration')
     495        );
     496
     497        return $html;
     498    }
     499
     500    public function get_oauth_connection_warning_html( $stripe_settings ) {
     501
     502        if ( empty( $stripe_settings ) ) {
     503            return '';
     504        }
     505
     506        $app_author = get_option( 'eh_stripe_connected_app_author', '' );
     507
     508        // Show warning unless explicitly connected via ThemeHigh
     509        if ( $app_author !== 'themehigh' ) {
     510            return '<tr valign="top">
     511                <td colspan="2" class="forminp">
     512                    <div class="wtst-oauth-warning" style="background:#f8d7da;border-left:4px solid #dc3545;padding:12px 15px;border-radius:4px;display:flex;align-items:center;">
     513                        <span style="color:#dc3545;font-size:18px;margin-right:10px;">&#9888;</span>
     514                        <span style="color:#721c24;font-size:14px;line-height:1.5;font-weight:500;">
     515                            ' . esc_html__(
     516                                'If you are currently connected through WebToffee, please disconnect and reconnect using ThemeHigh. The WebToffee connection will be discontinued soon.',
     517                                'payment-gateway-stripe-and-woocommerce-integration'
     518                            ) . '
     519                        </span>
     520                    </div>
     521                </td>
     522            </tr>';
     523        }
     524
     525        return '';
     526    }
    453527
    454528}
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-ideal.php

    r3351963 r3433172  
    7171                'type' => 'title',
    7272                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    73                 'description' => sprintf(__('%1$sSupported currency: %2$sEUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s %6$s Read documentation %7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#ideal">', '</a></p>'),
     73                'description' => sprintf(__('%1$sSupported currency: %2$sEUR%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s %6$s Read documentation %7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-ideal-payment-method-for-a-woocommerce-store/">', '</a></p>'),
    7474            ),
    7575            'eh_stripe_ideal_form_title'   => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-klarna.php

    r3351963 r3433172  
    6868                'type' => 'title',
    6969                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    70                 'description' => sprintf(__('%1$sSupported currencies: %2$sEUR, USD, GBP, DKK, SEK, NOK%3$s %4$sStripe accounts in the following countries can accept the payment: %5$sAustria, Belgium, Denmark, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Latvia, Lithuania, Netherlands, Norway, Slovakia, Slovenia, Spain, Sweden, United Kingdom, United States %6$s %7$s Read documentation %8$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b>', '</li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#klarna">', '</a></p>', ''),
     70                'description' => sprintf(__('%1$sSupported currencies: %2$sEUR, USD, GBP, DKK, SEK, NOK%3$s %4$sStripe accounts in the following countries can accept the payment: %5$sAustria, Belgium, Denmark, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Latvia, Lithuania, Netherlands, Norway, Slovakia, Slovenia, Spain, Sweden, United Kingdom, United States %6$s %7$s Read documentation %8$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b>', '</li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-klarna-payment-method-for-a-woocommerce-store/">', '</a></p>', ''),
    7171            ),
    7272            'eh_stripe_klarna_form_title'   => array(
     
    107107                'type' => 'title',
    108108                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    109                 'description' => sprintf(__('%1$sTo accept payments via Klarna payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     109                'description' => sprintf(__('%1$sTo accept payments via Klarna payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    110110            ),           
    111111        );   
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-oauth.php

    r3351963 r3433172  
    2424    /**
    2525     *
    26      * Function to retrieve tokens send from Stripe to WebToffee server and save tokens to db
     26     * Function to retrieve tokens send from Stripe to ThemeHigh server and save tokens to db
    2727     * @since 4.0.0
    2828     */
     
    4444                    $account_id = (isset($decoded['account_id']) ? sanitize_text_field($decoded['account_id'])  : '');
    4545                    $stripe_publishable_key = (isset($decoded['stripe_publishable_key']) ? sanitize_text_field($decoded['stripe_publishable_key'])  : '');
     46                    //Check connection platform
     47                    $app_author = (isset($decoded['author']) && isset($decoded['author']) ) ? sanitize_text_field($decoded['author']) : null;
    4648   
    4749                    $arr_oauth_tokens = array(
     
    5557                    $stripe_settings = get_option("woocommerce_eh_stripe_pay_settings");
    5658                    $mode = (isset($stripe_settings["eh_stripe_mode"]) ?  $stripe_settings["eh_stripe_mode"] : 'live');
     59
     60                    $test_mode = get_option("woocommerce_eh_stripe_test_mode_type");
     61                    $test_mode = ($test_mode === 'sandbox' ) ? 'sandbox' : 'test';
    5762                   
    5863                    if('test' === $mode){
    59                         EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
    60                             'name' => 'wt_stripe_account_id_test',
    61                             'value' => $account_id
    62                         ));
    63                         EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
    64                             'name' => 'wt_stripe_access_token_test',
    65                             'value' => base64_encode($access_token)
    66                         ));
    67                         EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
    68                             'name' => 'wt_stripe_refresh_token_test',
    69                             'value' => base64_encode($refresh_token)
    70                         ));
    71                         EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
    72                             'name' => 'wt_stripe_test_publishable_key',
    73                             'value' => $stripe_publishable_key
    74                         ));
    75                         EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
    76                             'name' => 'wtst_oauth_expriy_test',
    77                             'value' => time()
    78                         ));
    79                         EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
    80                             'name' => 'wt_stripe_oauth_connected_test',
    81                             'value' => 'yes'
    82                         ));
    83    
     64                        if($test_mode === 'sandbox'){
     65                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     66                                'name' => 'wt_stripe_account_id_sandbox',
     67                                'value' => $account_id
     68                            ));
     69                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     70                                'name' => 'wt_stripe_access_token_sandbox',
     71                                'value' => base64_encode($access_token)
     72                            ));
     73                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     74                                'name' => 'wt_stripe_refresh_token_sandbox',
     75                                'value' => base64_encode($refresh_token)
     76                            ));
     77                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     78                                'name' => 'wt_stripe_sandbox_publishable_key',
     79                                'value' => $stripe_publishable_key
     80                            ));
     81                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     82                                'name' => 'wtst_oauth_expriy_sandbox',
     83                                'value' => time()
     84                            ));
     85                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     86                                'name' => 'wt_stripe_oauth_connected_sandbox',
     87                                'value' => 'yes'
     88                            ));
     89
     90                        }else{
     91
     92                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     93                                'name' => 'wt_stripe_account_id_test',
     94                                'value' => $account_id
     95                            ));
     96                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     97                                'name' => 'wt_stripe_access_token_test',
     98                                'value' => base64_encode($access_token)
     99                            ));
     100                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     101                                'name' => 'wt_stripe_refresh_token_test',
     102                                'value' => base64_encode($refresh_token)
     103                            ));
     104                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     105                                'name' => 'wt_stripe_test_publishable_key',
     106                                'value' => $stripe_publishable_key
     107                            ));
     108                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     109                                'name' => 'wtst_oauth_expriy_test',
     110                                'value' => time()
     111                            ));
     112                            EH_Stripe_Token_Handler::wtst_get_site_option('update', array(
     113                                'name' => 'wt_stripe_oauth_connected_test',
     114                                'value' => 'yes'
     115                            ));
     116                        }
    84117                        $stripe_settings['eh_stripe_mode'] = 'test';
    85118                        update_option("woocommerce_eh_stripe_pay_settings", $stripe_settings);
     
    118151                        EH_Stripe_Oauth::eh_stripe_schedule_oauth_refresh();
    119152                    }
     153
     154                    update_option('eh_stripe_connected_app_author', $app_author);
    120155                   
    121156                }else{
     
    180215        $mode = (isset($_REQUEST['mode']) ? sanitize_text_field( wp_unslash($_REQUEST['mode']) ): $mode);
    181216        if('test' === $mode){
    182             //phpcs:ignore WordPress.Security.NonceVerification.Recommended
    183             if(isset($_REQUEST['expire']) && 'access_token' === sanitize_text_field(wp_unslash($_REQUEST['expire'])) ){
    184                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wtst_oauth_expriy_test'));
    185                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', null, array('name' => 'wtst_refresh_token_calling'));                   
    186             }
    187             else{ 
    188                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_account_id_test'));
    189                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_access_token_test'));
    190                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_refresh_token_test'));
    191                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_oauth_connected_test'));
    192                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wtst_oauth_expriy_test'));
    193                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', null, array('name' => 'wtst_refresh_token_calling'));   
    194                 EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_test_publishable_key'));
     217            $test_mode = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     218            if($test_mode === 'sandbox'){
     219                if(isset($_REQUEST['expire']) && 'access_token' === sanitize_text_field($_REQUEST['expire']) ){
     220                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wtst_oauth_expriy_sandbox'));
     221                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', null, array('name' => 'wtst_refresh_token_calling'));                   
     222                }else{
     223                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_account_id_sandbox'));
     224                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_access_token_sandbox'));
     225                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_refresh_token_sandbox'));
     226                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_sandbox_publishable_key'));
     227                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_oauth_connected_sandbox'));
     228           
     229                }
     230            }else{
     231                //phpcs:ignore WordPress.Security.NonceVerification.Recommended
     232                if(isset($_REQUEST['expire']) && 'access_token' === sanitize_text_field(wp_unslash($_REQUEST['expire'])) ){
     233                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wtst_oauth_expriy_test'));
     234                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', null, array('name' => 'wtst_refresh_token_calling'));                   
     235                }
     236                else{ 
     237                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_account_id_test'));
     238                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_access_token_test'));
     239                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_refresh_token_test'));
     240                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_oauth_connected_test'));
     241                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wtst_oauth_expriy_test'));
     242                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', null, array('name' => 'wtst_refresh_token_calling'));   
     243                    EH_Stripe_Token_Handler::wtst_get_site_option('delete', array('name' => 'wt_stripe_test_publishable_key'));
     244                }
    195245            }
    196246
     
    239289        // Check if the connection is disabled
    240290        $settings = get_option("woocommerce_eh_stripe_pay_settings");
    241         $mode = isset($settings['eh_stripe_mode']) ? $settings['eh_stripe_mode'] : 'live';
     291        $mode = isset($settings['eh_stripe_mode']) ? $settings['eh_stripe_mode'] : 'live';
     292        $test_mode = EH_Stripe_Token_Handler::get_stripe_test_mode_type();
     293        $mode = ($settings['eh_stripe_mode']==='test' && $test_mode === 'sandbox') ? 'sandbox' : $mode;
    242294        $connection_key = 'wt_stripe_oauth_connected_' . $mode;
    243295
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-oxxo.php

    r3351963 r3433172  
    108108                'type' => 'title',
    109109                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    110                 'description' => sprintf(__('%1$sTo accept payments via OXXO payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     110                'description' => sprintf(__('%1$sTo accept payments via OXXO payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    111111            ),
    112112        );
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-p24.php

    r3351963 r3433172  
    6868                'type' => 'title',
    6969                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    70                 'description' => sprintf(__('%1$sSupported currencies: %2$sEUR, PLN%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$sRead documentation%7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#przelewy24">', '</a></p>'),
     70                'description' => sprintf(__('%1$sSupported currencies: %2$sEUR, PLN%3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$sRead documentation%7$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>', '</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-przelewy24-payment-method-for-a-woocommerce-store/">', '</a></p>'),
    7171            ),
    7272            'eh_stripe_p24_form_title'   => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-payment-request-tab.php

    r3348088 r3433172  
    2525                'type' => 'title',
    2626                /* translators: %1$s: "To use Google Pay," text, %2$s: Domain registration instructions, %3$s: HTTPS requirement text, %4$s: "Payment methods are only available when you use a" text, %5$s: "supported browser" text */
    27                 'description' => sprintf(__( 'Google Pay allows customers to make payments using any credit or debit card saved to their Google Account. It works when customers have Google Pay set up on their devices <div class="wt_info_div"><p> %1$s </p><ol><li>Enable Google Pay in your Stripe <a href="https://dashboard.stripe.com/settings/payment_methods">payment methods settings</a>.</li><li>Register your domain</li><ul class="wt_notice_bar_style"><li> %2$s </li></ul><li>%3$s</li></ol>  <p> %4$s <a href="https://docs.stripe.com/elements/express-checkout-element#supported-browsers" target="_blank">%5$s</a> and pay in a supported currency.</p> </div>.<p> <a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#google_pay"> Read documentation </a></p> ','payment-gateway-stripe-and-woocommerce-integration' ), __('To use Google Pay,', 'payment-gateway-stripe-and-woocommerce-integration'), __('To do this, navigate to <a href="https://dashboard.stripe.com/settings/payment_method_domains"> Settings > Payments > Payment method domains </a> from your Stripe dashboard and add your domain. All domains, whether in production or testing, must be registered. Don\'t register your domain more than once per account.', 'payment-gateway-stripe-and-woocommerce-integration'), __('To accept Google Pay payments on the web, you need to serve from an HTTPS webpage with a TLS domain-validated certificate.', 'payment-gateway-stripe-and-woocommerce-integration'), __('Payment methods are only available when you use a ', 'payment-gateway-stripe-and-woocommerce-integration'), __(' supported browser', 'payment-gateway-stripe-and-woocommerce-integration')),
     27                'description' => sprintf(__( 'Google Pay allows customers to make payments using any credit or debit card saved to their Google Account. It works when customers have Google Pay set up on their devices <div class="wt_info_div"><p> %1$s </p><ol><li>Enable Google Pay in your Stripe <a href="https://dashboard.stripe.com/settings/payment_methods">payment methods settings</a>.</li><li>Register your domain</li><ul class="wt_notice_bar_style"><li> %2$s </li></ul><li>%3$s</li></ol>  <p> %4$s <a href="https://docs.stripe.com/elements/express-checkout-element#supported-browsers" target="_blank">%5$s</a> and pay in a supported currency.</p> </div>.<p> <a target="_blank" href="https://www.themehigh.com/docs/stripe-payment-plugin-for-woocommerce-free/#google_pay"> Read documentation </a></p> ','payment-gateway-stripe-and-woocommerce-integration' ), __('To use Google Pay,', 'payment-gateway-stripe-and-woocommerce-integration'), __('To do this, navigate to <a href="https://dashboard.stripe.com/settings/payment_method_domains"> Settings > Payments > Payment method domains </a> from your Stripe dashboard and add your domain. All domains, whether in production or testing, must be registered. Don\'t register your domain more than once per account.', 'payment-gateway-stripe-and-woocommerce-integration'), __('To accept Google Pay payments on the web, you need to serve from an HTTPS webpage with a TLS domain-validated certificate.', 'payment-gateway-stripe-and-woocommerce-integration'), __('Payment methods are only available when you use a ', 'payment-gateway-stripe-and-woocommerce-integration'), __(' supported browser', 'payment-gateway-stripe-and-woocommerce-integration')),
    2828
    2929            ),
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-sepa-pay.php

    r3351963 r3433172  
    7777                'type' => 'title',
    7878                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    79                 'description' => sprintf(__('%1$sSupported currency: %2$s EUR %3$sStripe accounts in the following countries can accept the payment: %4$sAustralia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States%5$s%6$s%7$s Read documentation %8$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b></li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#sepa_pay">', '</a></p>', ''),
     79                'description' => sprintf(__('%1$s<ul><li>%2$sSupported currency:%3$s EUR</li><li>%2$sStripe accounts in the following countries can accept this payment:%3$s Australia, Austria, Belgium, Bulgaria, Canada, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, United Kingdom, United States</li></ul><p><a target="_blank" href="https://www.themehigh.com/docs/set-up-sepa-payment-method-for-a-woocommerce-store/">Read documentation</a></p>%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div">', '<b>', '</b>', '</div>'),
    8080            ),
    8181            'eh_stripe_sepa_form_title'   => array(
     
    116116                'type' => 'title',
    117117                /* translators: %1$s: Opening HTML div and paragraph tags, %2$s: Documentation link opening, %3$s: Documentation link closing, %4$s: Closing HTML paragraph and div tags */
    118                 'description' => sprintf(__('%1$sTo accept payments via SEPA payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.webtoffee.com/setting-up-webhooks-and-supported-webhooks/">', '</a>', '</p></div>'),
     118                'description' => sprintf(__('%1$sTo accept payments via SEPA payment method, you must configure the webhook endpoint and subscribe to relevant events. %2$sClick here%3$s to know more%4$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><p>', '<a target="_blank" href="https://www.themehigh.com/docs/configuring-webhook-endpoints-to-receive-woocommerce-order-status-updates/">', '</a>', '</p></div>'),
    119119            ),
    120120        );   
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/class-stripe-wechat.php

    r3351963 r3433172  
    7979                'type' => 'title',
    8080                /* translators: %1$s: Opening HTML div and list tags, %2$s: Bold tag opening, %3$s: Bold tag closing, %4$s: Bold tag opening, %5$s: Bold tag closing, %6$s: Closing HTML list and div tags, %7$s: Documentation link opening, %8$s: Documentation link closing */
    81                 'description' => sprintf(__('%1$sSupported currencies: %2$sCNY, AUD, CAD, EUR, GBP, HKD, JPY, SGD, USD, DKK, NOK, SEK, CHF%3$s %4$sStripe accounts in the following countries can accept the payment: %5$sAustralia, Austria, Belgium, Canada, Denmark, Finland, France, Germany, Hong Kong, Ireland, Italy, Japan, Luxembourg, Netherlands, Norway, Portugal, Singapore, Spain, Sweden, Switzerland, United Kingdom, United States%6$s %7$s Read documentation %8$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b>', '</li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/#wechat">', '</a></p>', ''),
     81                'description' => sprintf(__('%1$sSupported currencies: %2$sCNY, AUD, CAD, EUR, GBP, HKD, JPY, SGD, USD, DKK, NOK, SEK, CHF%3$s %4$sStripe accounts in the following countries can accept the payment: %5$sAustralia, Austria, Belgium, Canada, Denmark, Finland, France, Germany, Hong Kong, Ireland, Italy, Japan, Luxembourg, Netherlands, Norway, Portugal, Singapore, Spain, Sweden, Switzerland, United Kingdom, United States%6$s %7$s Read documentation %8$s', 'payment-gateway-stripe-and-woocommerce-integration'), '<div class="wt_info_div"><ul><li>', '<b>','</b>', '</li><li>', '<b>', '</b></li></ul></div>', '<p><a target="_blank" href="https://www.themehigh.com/docs/set-up-wechat-payment-method-for-a-woocommerce-store/">', '</a></p>', ''),
    8282            ),
    8383            'eh_stripe_wechat_form_title'   => array(
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/eh-goto-pro.php

    r3351963 r3433172  
    153153      </ul>
    154154      <div class="eh_section_button">
    155         <a href="https://www.webtoffee.com/product/woocommerce-stripe-payment-gateway/?utm_source=free_plugin_sidebar&utm_medium=Stripe_basic&utm_campaign=Stripe&utm_content=<?php echo esc_attr(EH_STRIPE_VERSION); ?>" target="_blank">
     155        <a href="https://www.themehigh.com/product/woocommerce-stripe-payment-gateway/" target="_blank">
    156156          <img src="<?php echo esc_url(EH_STRIPE_MAIN_URL_PATH.'assets/img/white-crown.svg'); ?>" alt="Crown" style="width:16px; vertical-align:middle; margin-right:6px;">
    157157          <?php esc_html_e('Upgrade to Premium', 'payment-gateway-stripe-and-woocommerce-integration'); ?>
     
    165165    <div class="eh_section_header" style="background-color: #DDF9E4;">
    166166      <img src="<?php echo esc_url(EH_STRIPE_MAIN_URL_PATH.'assets/img/subscription-cta.svg'); ?>" alt="Calendar Icon">
    167       <span><?php esc_html_e('WebToffee WooCommerce Subscription Plugin', 'payment-gateway-stripe-and-woocommerce-integration'); ?></span>
     167      <span><?php esc_html_e('ThemeHigh WooCommerce Subscription Plugin', 'payment-gateway-stripe-and-woocommerce-integration'); ?></span>
    168168    </div>
    169169    <div class="eh_section_content">
     
    182182      </ul>
    183183      <div class="eh_section_button">
    184         <a href="https://www.webtoffee.com/product/woocommerce-subscription/?utm_source=free_plugin_sidebar&utm_medium=Stripe_basic&utm_campaign=Stripe&utm_content=<?php echo esc_attr(EH_STRIPE_VERSION); ?>" target="_blank">
     184        <a href="https://www.themehigh.com/product/subscriptions-for-woocommerce/" target="_blank">
    185185          <img src="<?php echo esc_url(EH_STRIPE_MAIN_URL_PATH.'assets/img/white-crown.svg'); ?>" alt="Crown" style="width:16px; vertical-align:middle; margin-right:6px;">
    186186          <?php esc_html_e('Get woo Subscription', 'payment-gateway-stripe-and-woocommerce-integration'); ?>
     
    203203  </div>
    204204</div>
    205 
     205<?php /*
    206206<!-- Like This Plugin -->
    207207<div class="eh_like_plugin">
     
    215215  </p>
    216216</div>
     217*/ ?>
  • payment-gateway-stripe-and-woocommerce-integration/trunk/includes/log.php

    r3351963 r3433172  
    99    public static function init_live_log()
    1010    {
    11         $content="<------------------- WebToffee Stripe Payment Live Log File ( ".EH_STRIPE_VERSION." ) ------------------->\n";
     11        $content="<------------------- ThemeHigh Stripe Payment Live Log File ( ".EH_STRIPE_VERSION." ) ------------------->\n";
    1212        return $content;
    1313    }
    1414    public static function init_dead_log()
    1515    {
    16         $content="<------------------- WebToffee Stripe Payment Dead Log File ( ".EH_STRIPE_VERSION." ) ------------------->\n";
     16        $content="<------------------- ThemeHigh Stripe Payment Dead Log File ( ".EH_STRIPE_VERSION." ) ------------------->\n";
    1717        return $content;
    1818    }
     
    2525            {
    2626                $log = wc_get_logger();
    27                 $head="<------------------- WebToffee Stripe Payment ( ".$title." ) ------------------->\n";
     27                $head="<------------------- ThemeHigh Stripe Payment ( ".$title." ) ------------------->\n";
    2828                switch ($type)
    2929                {
     
    5252            {
    5353                $log=new WC_Logger();
    54                 $head="<------------------- WebToffee Stripe Payment ( ".$title." ) ------------------->\n";
     54                $head="<------------------- ThemeHigh Stripe Payment ( ".$title." ) ------------------->\n";
    5555                switch ($type)
    5656                {
  • payment-gateway-stripe-and-woocommerce-integration/trunk/payment-gateway-stripe-and-woocommerce-integration.php

    r3351963 r3433172  
    11<?php
    22/*
    3  * Plugin Name: Payment Gateway for Stripe and for WooCommerce
     3 * Plugin Name: Payment Gateway of Stripe for WooCommerce
    44 * Requires Plugins: woocommerce
    55 * Plugin URI: https://wordpress.org/plugins/payment-gateway-stripe-and-woocommerce-integration/
    66 * Description: Accept payments from your WooCommerce store via Credit/Debit Cards, Stripe Checkout, Apple Pay, Google Pay, Alipay, SEPA Pay, Klarna, Afterpay, WeChat Pay, iDEAL, Bancontact, EPS, P24, Bacs Debit, BECS Debit, FPX, Boleto, OXXO, GrabPay, Multibanco and Affirm using Stripe.
    7  * Author: WebToffee
    8  * Author URI: https://www.webtoffee.com/product/woocommerce-stripe-payment-gateway/
    9  * Version: 5.0.6
    10  * WC requires at least: 3.0
    11  * WC tested up to: 10.0.2
     7 * Author: ThemeHigh
     8 * Author URI: https://www.themehigh.com
     9 * Version: 5.0.7
     10 * WC requires at least: 7.0
     11 * WC tested up to: 10.4
    1212 * License: GPLv3
    1313 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2727}
    2828if (!defined('EH_STRIPE_VERSION')) {
    29     define('EH_STRIPE_VERSION', '5.0.6');
     29    define('EH_STRIPE_VERSION', '5.0.7');
    3030}
    3131if (!defined('EH_STRIPE_MAIN_FILE')) {
     
    4040if (!defined('EH_STRIPE_OAUTH_WT_URL')) {
    4141    define ( 'EH_STRIPE_OAUTH_WT_URL', 'https://verify-stripe.webtoffee.com/wp-json/wt-stripe/v1/' );
     42}
     43if (!defined('EH_STRIPE_OAUTH_TH_URL')) {
     44    //themehigh updated url
     45    define ( 'EH_STRIPE_OAUTH_TH_URL', 'https://verify-stripe.themehigh.com/wp-json/wt-stripe/v1/' );
    4246}
    4347
     
    8084            add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'eh_stripe_plugin_action_links');
    8185            eh_stripe_init();
    82             add_filter( "wt_promotion_banner_screens", "wt_promotion_banner_screens" );
     86            // add_filter( "wt_promotion_banner_screens", "wt_promotion_banner_screens" );
    8387        } else{
    8488
     
    101105                        "Selected plugins activated."
    102106                    );
    103                     $new = "<span style='color:red'>Stripe Payment for Woocommerce ( BASIC ) (WebToffee)-</span> Plugin Needs WooCommerce to Work.";
     107                    $new = "<span style='color:red'>Stripe Payment for Woocommerce ( BASIC ) (ThemeHigh)-</span> Plugin Needs WooCommerce to Work.";
    104108                    if (in_array($untranslated_text, $old, true)) {
    105109                        $translated_text = $new;
     
    113117        $plugin_links = array(
    114118            '<a href="' . $setting_link . '">' . __('Settings', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
    115             '<a href="https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/" target="_blank">' . __('Documentation', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
    116             '<a href="https://www.webtoffee.com/product/woocommerce-stripe-payment-gateway/?utm_source=free_plugin_sidebar&utm_medium=Stripe_basic&utm_campaign=Stripe&utm_content='.EH_STRIPE_VERSION.'" target="_blank" style="color:#3db634;">' . __('Premium Upgrade', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
    117             '<a href="https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/" target="_blank">' . __('Support', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
     119            '<a href="https://www.themehigh.com/docs/category/stripe-payment-gateway/" target="_blank">' . __('Documentation', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
     120            '<a href="https://www.themehigh.com/product/woocommerce-stripe-payment-gateway/" target="_blank" style="color:#3db634;">' . __('Premium Upgrade', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
     121            '<a href="https://www.themehigh.com/docs/support/" target="_blank">' . __('Support', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',
    118122            // '<a href="https://wordpress.org/support/plugin/payment-gateway-stripe-and-woocommerce-integration/reviews/" target="_blank">' . __('Review', 'payment-gateway-stripe-and-woocommerce-integration') . '</a>',     
    119123                   
     
    209213                include_once(EH_STRIPE_MAIN_PATH . "includes/class-stripe-affirm.php");
    210214   
    211                 include_once(EH_STRIPE_MAIN_PATH . 'includes/admin/class-wt-promotion-banner.php');
     215                // include_once(EH_STRIPE_MAIN_PATH . 'includes/admin/class-wt-promotion-banner.php');
    212216   
    213217   
     
    219223         * Includes the Black Friday and Cyber Monday CTA banners for 2024
    220224         */
    221         require_once EH_STRIPE_MAIN_PATH . 'includes/admin/banner/class-wtst-bfcm-twenty-twenty-four.php';       
     225        // require_once EH_STRIPE_MAIN_PATH . 'includes/admin/banner/class-wtst-bfcm-twenty-twenty-four.php';       
    222226        new Eh_Stripe_Admin_Handler(); 
    223227
  • payment-gateway-stripe-and-woocommerce-integration/trunk/readme.txt

    r3352474 r3433172  
    1 === Payment Gateway for Stripe and for WooCommerce ===
    2 Contributors: webtoffee, themehigh
    3 Donate link: https://www.webtoffee.com/plugins/
     1=== Payment Gateway of Stripe for WooCommerce ===
     2Contributors: themehigh
     3Donate link: https://www.themehigh.com/product/woocommerce-stripe-payment-gateway/
    44Tags: stripe checkout, credit card, google pay, apple pay, stripe payments
    55Requires at least: 5.6
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 5.6
    8 Stable tag: 5.0.6
     8Stable tag: 5.0.7
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1111
    12 Easily accept Stripe payments on your WooCommerce store — including credit cards, Apple Pay, Google Pay, and more. Get started with Stripe Checkout and the Stripe payment gateway in just a few minutes.
     12Integrate Stripe Payment Gateway in WooCommerce and accept cards, Google Pay, Apple Pay, Klarna, Alipay, and more with seamless, secure checkout.
    1313
    1414== Description ==
     
    1717### Introduction ###
    1818
    19 Payment Gateway for Stripe and for WooCommerce enables your store to accept a wide range of payment methods, including credit cards and debit cards (Visa, Mastercard, American Express, Discover, JCB, Diners Club), along with region-specific and digital wallets like Alipay, Apple Pay, Google Pay, Klarna, SEPA, Afterpay, iDEAL, and WeChat Pay — all through the Payment Gateway for Stripe and for WooCommerce plugin.
     19Payment Gateway of Stripe for WooCommerce nables your store to accept a wide range of payment methods, including credit cards and debit cards (Visa, Mastercard, American Express, Discover, JCB, Diners Club), along with region-specific and digital wallets like Alipay, Apple Pay, Google Pay, Klarna, SEPA, Afterpay, iDEAL, and WeChat Pay — all through the Payment Gateway for Stripe and for WooCommerce plugin.
    2020
    2121With this WooCommerce Stripe plugin, you can activate Stripe checkout on your store site and make Stripe payments with their credit or debit cards at the checkout. This ensures a smooth and secure payment experience for your users.
     
    7272The Stripe checkout page is well optimized for conversion with less loading time, address auto-complete, real-time card validation, descriptive error messages, responsive checkout, [and more](https://stripe.com/in/payments/checkout).
    7373
    74 To learn how to install the plugin, navigate to the Installation tab. For detailed guidance on the installation and setup of the plugin, refer to the [plugin documentation](https://www.webtoffee.com/woocommerce-stripe-payment-gateway-plugin-user-guide/).
     74To learn how to install the plugin, navigate to the Installation tab. For detailed guidance on the installation and setup of the plugin, refer to the [plugin documentation](https://www.themehigh.com/docs/category/stripe-payment-gateway/).
    7575
    7676
     
    9595## Payment Gateway for Stripe and for WooCommerce - Premium Features##
    9696
    97  *  Supports [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) and [Subscriptions for WooCommerce by WebToffee](https://www.webtoffee.com/product/woocommerce-subscriptions/).
     97 *  Supports [WooCommerce Subscriptions](https://woocommerce.com/products/woocommerce-subscriptions/) and [Subscriptions for WooCommerce by ThemeHigh](https://www.themehigh.com/product/subscriptions-for-woocommerce/).
    9898 *  Link payment method
    9999 *  Multiple payment methods in Stripe checkout
     
    106106
    107107
    108 For complete list of features and details, please visit <a rel="nofollow" href="https://www.webtoffee.com/product/woocommerce-stripe-payment-gateway/">Stripe Payment Gateway for WooCommerce</a>
     108For complete list of features and details, please visit <a rel="nofollow" href="https://www.themehigh.com/product/woocommerce-stripe-payment-gateway/">Stripe Payment Gateway for WooCommerce</a>
    109109
    110110### About Stripe ###
     
    203203* **Privacy Policy**: [Stripe Privacy Policy](https://stripe.com/privacy)
    204204
    205 **WebToffee Service**: The plugin integrates with WebToffee's external service for OAuth token management and automatic token refresh functionality.
    206 
    207 * **Service Provider**: WebToffee, Inc.
     205**ThemeHigh Service**: The plugin integrates with ThemeHigh's external service for OAuth token management and automatic token refresh functionality.
     206
     207* **Service Provider**: ThemeHigh, Inc.
    208208* **Data Sent**: OAuth tokens, connection status, and service health data
    209209* **Purpose**: External service integration for Stripe OAuth management and token refresh
    210 * **Privacy Policy**: [WebToffee Privacy Policy](https://www.webtoffee.com/privacy-policy/)
     210* **Privacy Policy**: [ThemeHigh Privacy Policy](https://www.themehigh.com/privacy-policy/)
    211211
    212212
     
    231231Step 2: Navigate to Plugins and select Add New.
    232232Step 3: In the search bar, type “Payment Gateway for Stripe and for WooCommerce” and click Search Plugins.
    233 Step 4: Once you find the Stripe Payment plugin by WebToffee, click on “Install Now”.
     233Step 4: Once you find the Stripe Payment plugin by ThemeHigh, click on “Install Now”.
    234234Step 5: After installation, click “Activate” to activate the plugin.
    235235
     
    287287
    288288== Changelog ==
     289= 5.0.7 =
     290* [Ownership] – Plugin acquired by ThemeHigh.
     291* [Enhancement] - Updated OAuth with Themehigh Stripe app
     292* [Enhancement] - Sandbox mode (test mode) support added for Stripe payments.
     293* [Compatibility] - WordPress 6.9
     294* [Compatibility] - WooCommerce 10.4
    289295
    290296= 5.0.6 2025-08-28 =
Note: See TracChangeset for help on using the changeset viewer.