Changeset 3448736
- Timestamp:
- 01/28/2026 01:21:47 PM (2 months ago)
- Location:
- tabby-checkout
- Files:
-
- 6 edited
- 34 copied
-
tags/5.9.2 (copied) (copied from tabby-checkout/trunk)
-
tags/5.9.2/assets (copied) (copied from tabby-checkout/trunk/assets)
-
tags/5.9.2/assets/blocks/tabby-installments/index.js (copied) (copied from tabby-checkout/trunk/assets/blocks/tabby-installments/index.js)
-
tags/5.9.2/css (copied) (copied from tabby-checkout/trunk/css)
-
tags/5.9.2/css/tabby.css (copied) (copied from tabby-checkout/trunk/css/tabby.css)
-
tags/5.9.2/i18n (copied) (copied from tabby-checkout/trunk/i18n)
-
tags/5.9.2/i18n/languages/tabby-checkout-ar.mo (copied) (copied from tabby-checkout/trunk/i18n/languages/tabby-checkout-ar.mo)
-
tags/5.9.2/i18n/languages/tabby-checkout-ar.po (copied) (copied from tabby-checkout/trunk/i18n/languages/tabby-checkout-ar.po)
-
tags/5.9.2/i18n/languages/tabby-checkout.pot (copied) (copied from tabby-checkout/trunk/i18n/languages/tabby-checkout.pot)
-
tags/5.9.2/images (copied) (copied from tabby-checkout/trunk/images)
-
tags/5.9.2/includes (copied) (copied from tabby-checkout/trunk/includes)
-
tags/5.9.2/includes/class-wc-blocks-tabby-cart-promotion.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-blocks-tabby-cart-promotion.php)
-
tags/5.9.2/includes/class-wc-blocks-tabby-installments.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-blocks-tabby-installments.php)
-
tags/5.9.2/includes/class-wc-gateway-tabby-checkout-base.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-gateway-tabby-checkout-base.php) (2 diffs)
-
tags/5.9.2/includes/class-wc-gateway-tabby-credit-card-installments.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-gateway-tabby-credit-card-installments.php)
-
tags/5.9.2/includes/class-wc-gateway-tabby-installments.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-gateway-tabby-installments.php)
-
tags/5.9.2/includes/class-wc-rest-tabby-controller.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-rest-tabby-controller.php) (1 diff)
-
tags/5.9.2/includes/class-wc-settings-tab-tabby.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-settings-tab-tabby.php)
-
tags/5.9.2/includes/class-wc-tabby-ajax.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-ajax.php)
-
tags/5.9.2/includes/class-wc-tabby-api-feed.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-api-feed.php)
-
tags/5.9.2/includes/class-wc-tabby-api.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-api.php) (3 diffs)
-
tags/5.9.2/includes/class-wc-tabby-config.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-config.php)
-
tags/5.9.2/includes/class-wc-tabby-cron.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-cron.php)
-
tags/5.9.2/includes/class-wc-tabby-feed-product-exception.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-feed-product-exception.php)
-
tags/5.9.2/includes/class-wc-tabby-feed-product.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-feed-product.php)
-
tags/5.9.2/includes/class-wc-tabby-feed-sharing.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-feed-sharing.php)
-
tags/5.9.2/includes/class-wc-tabby-promo.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-promo.php)
-
tags/5.9.2/includes/class-wc-tabby-webhook.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-webhook.php)
-
tags/5.9.2/includes/class-wc-tabby.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby.php)
-
tags/5.9.2/js (copied) (copied from tabby-checkout/trunk/js)
-
tags/5.9.2/js/tabby.js (copied) (copied from tabby-checkout/trunk/js/tabby.js) (1 diff)
-
tags/5.9.2/log (copied) (copied from tabby-checkout/trunk/log)
-
tags/5.9.2/readme.txt (copied) (copied from tabby-checkout/trunk/readme.txt) (2 diffs)
-
tags/5.9.2/tabby-checkout.php (copied) (copied from tabby-checkout/trunk/tabby-checkout.php) (2 diffs)
-
trunk/includes/class-wc-gateway-tabby-checkout-base.php (modified) (2 diffs)
-
trunk/includes/class-wc-rest-tabby-controller.php (modified) (1 diff)
-
trunk/includes/class-wc-tabby-api.php (modified) (3 diffs)
-
trunk/js/tabby.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/tabby-checkout.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tabby-checkout/tags/5.9.2/includes/class-wc-gateway-tabby-checkout-base.php
r3415134 r3448736 185 185 186 186 public function payment_fields() { 187 echo '<script>window.tabbyConfig = '.$this->getTabbyConfig().'</script>'; 187 $config = $this->getFrontTabbyConfig(); 188 if (is_checkout_pay_page()) { 189 $order_id = $wp->query_vars['order-pay']; 190 if (empty($order_id)) { 191 $order_key = $wp->query_vars['key']; 192 $order_id = wc_get_order_id_by_order_key( $order_key ); 193 } 194 $order = wc_get_order($order_id); 195 $customer = new \WC_Customer($order->get_customer_id()); 196 $config['buyer'] = $this->getBuyerObject($order); 197 } 198 echo '<script>window.tabbyConfig = '.json_encode($config).'</script>'; 188 199 switch ($this->getDescriptionType()) { 189 200 case 0: … … 213 224 } 214 225 226 public function getFrontTabbyConfig() { 227 return [ 228 'debug' => $this->get_api_option('debug') == 'yes' ? 1 : 0, 229 'hideMethods' => $this->get_api_option('hide_methods') == 'yes', 230 'ignoreEmail' => apply_filters('tabby_checkout_ignore_email', false), 231 'language' => $this->getLanguage(), 232 'locale' => WC_Tabby_Config::get_lang(), 233 'localeSource' => $this->get_api_option('locale_html') == 'yes' ? 'html' : '', 234 'notAvailableMessage' => __('Sorry Tabby is unable to approve this purchase, please use an alternative payment method for your order.', 'tabby-checkout'), 235 ]; 236 } 215 237 public function getTabbyConfig($order = null) { 216 238 global $wp; 217 $config = [];239 $config = $this->getFrontTabbyConfig(); 218 240 $config['apiKey'] = $this->get_api_option('public_key'); 219 241 $config['merchantCode'] = WC_Tabby_Config::getMerchantCode($order); 220 $config['locale'] = WC_Tabby_Config::get_lang();221 $config['language']= $this->getLanguage();222 $config['hideMethods'] = $this->get_api_option('hide_methods') == 'yes';223 $config['localeSource'] = $this->get_api_option('locale_html') == 'yes' ? 'html' : '';224 $config['debug'] = $this->get_api_option('debug') == 'yes' ? 1 : 0;225 $config['notAvailableMessage'] = __('Sorry Tabby is unable to approve this purchase, please use an alternative payment method for your order.', 'tabby-checkout');226 242 // used to ignore email on checkout 227 $config['ignoreEmail'] = apply_filters('tabby_checkout_ignore_email', false);228 243 $config['buyer_history'] = null; 229 244 // buyer and shipping address for pay_for_order functionality -
tabby-checkout/tags/5.9.2/includes/class-wc-rest-tabby-controller.php
r3294207 r3448736 66 66 return new WP_Error( 67 67 'tabby_webhook_error', 68 __('Webhook execution error : ' . $e->getMessage()),68 __('Webhook execution error'), 69 69 array('status' => 503) 70 70 ); -
tabby-checkout/tags/5.9.2/includes/class-wc-tabby-api.php
r3385742 r3448736 100 100 if (!file_exists(__DIR__ . '/../log')) mkdir (__DIR__ . '/../log', 0777); 101 101 $fp = fopen(__DIR__ . '/../log/tabby.log', "a+"); 102 $msg = preg_replace("#Bearer sk_[^\n]*\-[0-9a-f]{8}([0-9a-f]{4})\n#s", "Bearer sk_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\\1\n",print_r($data, true));102 $msg = self::mask_secret_key(print_r($data, true)); 103 103 fputs($fp, date("[Y-m-d H:i:s] ") . $msg); 104 104 fclose($fp); … … 110 110 } 111 111 }; 112 } 113 public static function mask_secret_key($str) { 114 return preg_replace("#Bearer sk_[^\n]*\-[0-9a-f]{8}([0-9a-f]{4})#s", "Bearer sk_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\\1\n", $str); 112 115 } 113 116 … … 145 148 146 149 if ($data) { 150 if (array_key_exists('request.headers', $data)) { 151 array_walk($data['request.headers'], function (&$item) { 152 $item = WC_Tabby_Api::mask_secret_key($item); 153 }); 154 } 147 155 $log["data"] = $data; 148 156 } -
tabby-checkout/tags/5.9.2/js/tabby.js
r3415134 r3448736 209 209 return jQuery('input[name=woocommerce_pay]').length && (jQuery('input[name=woocommerce_pay]').val() == 1); 210 210 } 211 getShippingAddress() {212 if (this.isPayForOrderPage()) return this.config.shipping_address;213 const prefix = jQuery('#ship-to-different-address-checkbox:checked').length > 0 ? 'shipping' : 'billing';214 return {215 address: this.getAddressStreet(prefix),216 city: this.getAddressCity(prefix)217 }218 }219 getAddressStreet(prefix) {220 const street1 = jQuery('#' + prefix + '_address_1');221 const street2 = jQuery('#' + prefix + '_address_2');222 223 return (street1 ? street1.val() : '') + (street2 && street2.val() ? ', ' + street2.val() : '');224 }225 getAddressCity(prefix) {226 const city = jQuery('#' + prefix + '_city');227 return city ? city.val() : null;228 }229 211 } -
tabby-checkout/tags/5.9.2/readme.txt
r3447772 r3448736 4 4 Requires at least: 5.7 5 5 Tested up to: 6.9 6 Stable tag: 5.9. 16 Stable tag: 5.9.2 7 7 Requires PHP: 7.0 8 8 License: GPLv3 … … 28 28 29 29 == Changelog == 30 31 = 5.9.2 = 32 33 * Internal improvements and security hardening. 30 34 31 35 = 5.9.1 = -
tabby-checkout/tags/5.9.2/tabby-checkout.php
r3447772 r3448736 4 4 * Plugin URI: https://tabby.ai/ 5 5 * Description: Tabby Checkout 6 * Version: 5.9. 16 * Version: 5.9.2 7 7 * Author: Tabby 8 8 * Author URI: https://tabby.ai … … 15 15 defined( 'ABSPATH' ) || exit; 16 16 17 define ('MODULE_TABBY_CHECKOUT_VERSION', '5.9. 1');17 define ('MODULE_TABBY_CHECKOUT_VERSION', '5.9.2'); 18 18 define ('TABBY_CHECKOUT_DOMAIN', 'checkout.tabby.ai'); 19 19 define ('TABBY_CHECKOUT_API_DOMAIN', 'api.tabby.ai'); -
tabby-checkout/trunk/includes/class-wc-gateway-tabby-checkout-base.php
r3415134 r3448736 185 185 186 186 public function payment_fields() { 187 echo '<script>window.tabbyConfig = '.$this->getTabbyConfig().'</script>'; 187 $config = $this->getFrontTabbyConfig(); 188 if (is_checkout_pay_page()) { 189 $order_id = $wp->query_vars['order-pay']; 190 if (empty($order_id)) { 191 $order_key = $wp->query_vars['key']; 192 $order_id = wc_get_order_id_by_order_key( $order_key ); 193 } 194 $order = wc_get_order($order_id); 195 $customer = new \WC_Customer($order->get_customer_id()); 196 $config['buyer'] = $this->getBuyerObject($order); 197 } 198 echo '<script>window.tabbyConfig = '.json_encode($config).'</script>'; 188 199 switch ($this->getDescriptionType()) { 189 200 case 0: … … 213 224 } 214 225 226 public function getFrontTabbyConfig() { 227 return [ 228 'debug' => $this->get_api_option('debug') == 'yes' ? 1 : 0, 229 'hideMethods' => $this->get_api_option('hide_methods') == 'yes', 230 'ignoreEmail' => apply_filters('tabby_checkout_ignore_email', false), 231 'language' => $this->getLanguage(), 232 'locale' => WC_Tabby_Config::get_lang(), 233 'localeSource' => $this->get_api_option('locale_html') == 'yes' ? 'html' : '', 234 'notAvailableMessage' => __('Sorry Tabby is unable to approve this purchase, please use an alternative payment method for your order.', 'tabby-checkout'), 235 ]; 236 } 215 237 public function getTabbyConfig($order = null) { 216 238 global $wp; 217 $config = [];239 $config = $this->getFrontTabbyConfig(); 218 240 $config['apiKey'] = $this->get_api_option('public_key'); 219 241 $config['merchantCode'] = WC_Tabby_Config::getMerchantCode($order); 220 $config['locale'] = WC_Tabby_Config::get_lang();221 $config['language']= $this->getLanguage();222 $config['hideMethods'] = $this->get_api_option('hide_methods') == 'yes';223 $config['localeSource'] = $this->get_api_option('locale_html') == 'yes' ? 'html' : '';224 $config['debug'] = $this->get_api_option('debug') == 'yes' ? 1 : 0;225 $config['notAvailableMessage'] = __('Sorry Tabby is unable to approve this purchase, please use an alternative payment method for your order.', 'tabby-checkout');226 242 // used to ignore email on checkout 227 $config['ignoreEmail'] = apply_filters('tabby_checkout_ignore_email', false);228 243 $config['buyer_history'] = null; 229 244 // buyer and shipping address for pay_for_order functionality -
tabby-checkout/trunk/includes/class-wc-rest-tabby-controller.php
r3294207 r3448736 66 66 return new WP_Error( 67 67 'tabby_webhook_error', 68 __('Webhook execution error : ' . $e->getMessage()),68 __('Webhook execution error'), 69 69 array('status' => 503) 70 70 ); -
tabby-checkout/trunk/includes/class-wc-tabby-api.php
r3385742 r3448736 100 100 if (!file_exists(__DIR__ . '/../log')) mkdir (__DIR__ . '/../log', 0777); 101 101 $fp = fopen(__DIR__ . '/../log/tabby.log', "a+"); 102 $msg = preg_replace("#Bearer sk_[^\n]*\-[0-9a-f]{8}([0-9a-f]{4})\n#s", "Bearer sk_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\\1\n",print_r($data, true));102 $msg = self::mask_secret_key(print_r($data, true)); 103 103 fputs($fp, date("[Y-m-d H:i:s] ") . $msg); 104 104 fclose($fp); … … 110 110 } 111 111 }; 112 } 113 public static function mask_secret_key($str) { 114 return preg_replace("#Bearer sk_[^\n]*\-[0-9a-f]{8}([0-9a-f]{4})#s", "Bearer sk_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX\\1\n", $str); 112 115 } 113 116 … … 145 148 146 149 if ($data) { 150 if (array_key_exists('request.headers', $data)) { 151 array_walk($data['request.headers'], function (&$item) { 152 $item = WC_Tabby_Api::mask_secret_key($item); 153 }); 154 } 147 155 $log["data"] = $data; 148 156 } -
tabby-checkout/trunk/js/tabby.js
r3415134 r3448736 209 209 return jQuery('input[name=woocommerce_pay]').length && (jQuery('input[name=woocommerce_pay]').val() == 1); 210 210 } 211 getShippingAddress() {212 if (this.isPayForOrderPage()) return this.config.shipping_address;213 const prefix = jQuery('#ship-to-different-address-checkbox:checked').length > 0 ? 'shipping' : 'billing';214 return {215 address: this.getAddressStreet(prefix),216 city: this.getAddressCity(prefix)217 }218 }219 getAddressStreet(prefix) {220 const street1 = jQuery('#' + prefix + '_address_1');221 const street2 = jQuery('#' + prefix + '_address_2');222 223 return (street1 ? street1.val() : '') + (street2 && street2.val() ? ', ' + street2.val() : '');224 }225 getAddressCity(prefix) {226 const city = jQuery('#' + prefix + '_city');227 return city ? city.val() : null;228 }229 211 } -
tabby-checkout/trunk/readme.txt
r3447772 r3448736 4 4 Requires at least: 5.7 5 5 Tested up to: 6.9 6 Stable tag: 5.9. 16 Stable tag: 5.9.2 7 7 Requires PHP: 7.0 8 8 License: GPLv3 … … 28 28 29 29 == Changelog == 30 31 = 5.9.2 = 32 33 * Internal improvements and security hardening. 30 34 31 35 = 5.9.1 = -
tabby-checkout/trunk/tabby-checkout.php
r3447772 r3448736 4 4 * Plugin URI: https://tabby.ai/ 5 5 * Description: Tabby Checkout 6 * Version: 5.9. 16 * Version: 5.9.2 7 7 * Author: Tabby 8 8 * Author URI: https://tabby.ai … … 15 15 defined( 'ABSPATH' ) || exit; 16 16 17 define ('MODULE_TABBY_CHECKOUT_VERSION', '5.9. 1');17 define ('MODULE_TABBY_CHECKOUT_VERSION', '5.9.2'); 18 18 define ('TABBY_CHECKOUT_DOMAIN', 'checkout.tabby.ai'); 19 19 define ('TABBY_CHECKOUT_API_DOMAIN', 'api.tabby.ai');
Note: See TracChangeset
for help on using the changeset viewer.