Changeset 3073241
- Timestamp:
- 04/18/2024 02:58:48 PM (2 years ago)
- Location:
- tabby-checkout
- Files:
-
- 5 edited
- 29 copied
-
tags/4.10.4 (copied) (copied from tabby-checkout/trunk)
-
tags/4.10.4/assets (copied) (copied from tabby-checkout/trunk/assets)
-
tags/4.10.4/css (copied) (copied from tabby-checkout/trunk/css)
-
tags/4.10.4/css/tabby.css (copied) (copied from tabby-checkout/trunk/css/tabby.css)
-
tags/4.10.4/i18n (copied) (copied from tabby-checkout/trunk/i18n)
-
tags/4.10.4/i18n/languages/tabby-checkout-ar.mo (copied) (copied from tabby-checkout/trunk/i18n/languages/tabby-checkout-ar.mo)
-
tags/4.10.4/i18n/languages/tabby-checkout-ar.po (copied) (copied from tabby-checkout/trunk/i18n/languages/tabby-checkout-ar.po)
-
tags/4.10.4/i18n/languages/tabby-checkout.pot (copied) (copied from tabby-checkout/trunk/i18n/languages/tabby-checkout.pot)
-
tags/4.10.4/images (copied) (copied from tabby-checkout/trunk/images)
-
tags/4.10.4/includes (copied) (copied from tabby-checkout/trunk/includes)
-
tags/4.10.4/includes/class-wc-blocks-tabby-cart-promotion.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-blocks-tabby-cart-promotion.php)
-
tags/4.10.4/includes/class-wc-blocks-tabby-installments.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-blocks-tabby-installments.php)
-
tags/4.10.4/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/4.10.4/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/4.10.4/includes/class-wc-gateway-tabby-installments.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-gateway-tabby-installments.php)
-
tags/4.10.4/includes/class-wc-rest-tabby-controller.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-rest-tabby-controller.php)
-
tags/4.10.4/includes/class-wc-settings-tab-tabby.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-settings-tab-tabby.php)
-
tags/4.10.4/includes/class-wc-tabby-ajax.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-ajax.php) (2 diffs)
-
tags/4.10.4/includes/class-wc-tabby-api.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-api.php)
-
tags/4.10.4/includes/class-wc-tabby-config.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-config.php)
-
tags/4.10.4/includes/class-wc-tabby-cron.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-cron.php)
-
tags/4.10.4/includes/class-wc-tabby-promo.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-promo.php) (1 diff)
-
tags/4.10.4/includes/class-wc-tabby-webhook.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby-webhook.php)
-
tags/4.10.4/includes/class-wc-tabby.php (copied) (copied from tabby-checkout/trunk/includes/class-wc-tabby.php)
-
tags/4.10.4/js (copied) (copied from tabby-checkout/trunk/js)
-
tags/4.10.4/js/tabby.js (copied) (copied from tabby-checkout/trunk/js/tabby.js)
-
tags/4.10.4/log (copied) (copied from tabby-checkout/trunk/log)
-
tags/4.10.4/readme.txt (copied) (copied from tabby-checkout/trunk/readme.txt) (2 diffs)
-
tags/4.10.4/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-tabby-ajax.php (modified) (2 diffs)
-
trunk/includes/class-wc-tabby-promo.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/tabby-checkout.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tabby-checkout/tags/4.10.4/includes/class-wc-gateway-tabby-checkout-base.php
r3053766 r3073241 291 291 public function getMerchantCode($order = null) { 292 292 if ($order) { 293 $code = $order->get_ shipping_country() ?: $order->get_billing_country();293 $code = $order->get_billing_country() ?: $order->get_shipping_country(); 294 294 } else { 295 $code = WC()->customer->get_ shipping_country() ?: WC()->customer->get_billing_country();295 $code = WC()->customer->get_billing_country() ?: WC()->customer->get_shipping_country(); 296 296 } 297 297 if ($code == 'undefined' || empty($code)) $code = wc_get_base_location()['country']; … … 340 340 ]; 341 341 342 $result = WC_Tabby_Api::request('checkout', 'POST', $request); 343 344 if ($result && property_exists($result, 'status') && $result->status == 'created') { 345 if (property_exists($result->configuration->available_products, static::TABBY_METHOD_CODE)) { 346 return true; 342 $is_available = false; 343 344 $sha256 = hash('sha256', json_encode($request)); 345 $tr_name = 'tabby_api_cache_' . $sha256; 346 347 if (($available_products = get_transient($tr_name)) === false) { 348 $result = WC_Tabby_Api::request('checkout', 'POST', $request); 349 350 if ($result && property_exists($result, 'status') && $result->status == 'created') { 351 $available_products = $result->configuration->available_products; 352 } else { 353 $available_products = new \StdClass(); 347 354 } 348 } 349 350 return false; 355 set_transient($tr_name, $available_products, HOUR_IN_SECONDS); 356 } 357 358 if (is_object($available_products) && property_exists($available_products, static::TABBY_METHOD_CODE)) { 359 $is_available = true; 360 } 361 362 return $is_available; 351 363 } 352 364 -
tabby-checkout/tags/4.10.4/includes/class-wc-tabby-ajax.php
r3049660 r3073241 36 36 if (!$email) return $result; 37 37 38 $sha256 = hash('sha256', json_encode([$email, $phone])); 39 $tr_name = 'tabby_oh_' . $sha256; 40 if (($order_history = get_transient($tr_name)) !== false) { 41 return $order_history; 42 } 43 38 44 $wc2tabby = [ 39 45 //'pending' => 'processing', … … 60 66 } 61 67 } 68 69 set_transient($tr_name, $result, HOUR_IN_SECONDS); 70 62 71 return $result; 63 72 } -
tabby-checkout/tags/4.10.4/includes/class-wc-tabby-promo.php
r3049660 r3073241 208 208 } 209 209 public static function getMaxPrice() { 210 return get_option('tabby_checkout_promo_price', 0);210 return (int)get_option('tabby_checkout_promo_price', 0); 211 211 } 212 212 public static function getMinTotal() { 213 return get_option('tabby_checkout_promo_min_total', 0);213 return (int)get_option('tabby_checkout_promo_min_total', 0); 214 214 } 215 215 public static function getEmail() { -
tabby-checkout/tags/4.10.4/readme.txt
r3053766 r3073241 4 4 Requires at least: 5.7 5 5 Tested up to: 6.5 6 Stable tag: 4.10. 16 Stable tag: 4.10.4 7 7 Requires PHP: 7.0 8 8 License: GPLv3 … … 28 28 29 29 == Changelog == 30 31 = 4.10.4 = 32 33 * Fix merchant code country selection order 34 35 = 4.10.2 = 36 37 * Cache added for prescoring and order history 30 38 31 39 = 4.10.1 = -
tabby-checkout/tags/4.10.4/tabby-checkout.php
r3053766 r3073241 4 4 * Plugin URI: https://tabby.ai/ 5 5 * Description: Tabby Checkout 6 * Version: 4.10. 16 * Version: 4.10.4 7 7 * Author: Tabby 8 8 * Author URI: https://tabby.ai … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 define ('MODULE_TABBY_CHECKOUT_VERSION', '4.10. 1');16 define ('MODULE_TABBY_CHECKOUT_VERSION', '4.10.4'); 17 17 define ('TABBY_CHECKOUT_DOMAIN', 'checkout.tabby.ai'); 18 18 define ('TABBY_CHECKOUT_API_DOMAIN', 'api.tabby.ai'); -
tabby-checkout/trunk/includes/class-wc-gateway-tabby-checkout-base.php
r3053766 r3073241 291 291 public function getMerchantCode($order = null) { 292 292 if ($order) { 293 $code = $order->get_ shipping_country() ?: $order->get_billing_country();293 $code = $order->get_billing_country() ?: $order->get_shipping_country(); 294 294 } else { 295 $code = WC()->customer->get_ shipping_country() ?: WC()->customer->get_billing_country();295 $code = WC()->customer->get_billing_country() ?: WC()->customer->get_shipping_country(); 296 296 } 297 297 if ($code == 'undefined' || empty($code)) $code = wc_get_base_location()['country']; … … 340 340 ]; 341 341 342 $result = WC_Tabby_Api::request('checkout', 'POST', $request); 343 344 if ($result && property_exists($result, 'status') && $result->status == 'created') { 345 if (property_exists($result->configuration->available_products, static::TABBY_METHOD_CODE)) { 346 return true; 342 $is_available = false; 343 344 $sha256 = hash('sha256', json_encode($request)); 345 $tr_name = 'tabby_api_cache_' . $sha256; 346 347 if (($available_products = get_transient($tr_name)) === false) { 348 $result = WC_Tabby_Api::request('checkout', 'POST', $request); 349 350 if ($result && property_exists($result, 'status') && $result->status == 'created') { 351 $available_products = $result->configuration->available_products; 352 } else { 353 $available_products = new \StdClass(); 347 354 } 348 } 349 350 return false; 355 set_transient($tr_name, $available_products, HOUR_IN_SECONDS); 356 } 357 358 if (is_object($available_products) && property_exists($available_products, static::TABBY_METHOD_CODE)) { 359 $is_available = true; 360 } 361 362 return $is_available; 351 363 } 352 364 -
tabby-checkout/trunk/includes/class-wc-tabby-ajax.php
r3049660 r3073241 36 36 if (!$email) return $result; 37 37 38 $sha256 = hash('sha256', json_encode([$email, $phone])); 39 $tr_name = 'tabby_oh_' . $sha256; 40 if (($order_history = get_transient($tr_name)) !== false) { 41 return $order_history; 42 } 43 38 44 $wc2tabby = [ 39 45 //'pending' => 'processing', … … 60 66 } 61 67 } 68 69 set_transient($tr_name, $result, HOUR_IN_SECONDS); 70 62 71 return $result; 63 72 } -
tabby-checkout/trunk/includes/class-wc-tabby-promo.php
r3049660 r3073241 208 208 } 209 209 public static function getMaxPrice() { 210 return get_option('tabby_checkout_promo_price', 0);210 return (int)get_option('tabby_checkout_promo_price', 0); 211 211 } 212 212 public static function getMinTotal() { 213 return get_option('tabby_checkout_promo_min_total', 0);213 return (int)get_option('tabby_checkout_promo_min_total', 0); 214 214 } 215 215 public static function getEmail() { -
tabby-checkout/trunk/readme.txt
r3053766 r3073241 4 4 Requires at least: 5.7 5 5 Tested up to: 6.5 6 Stable tag: 4.10. 16 Stable tag: 4.10.4 7 7 Requires PHP: 7.0 8 8 License: GPLv3 … … 28 28 29 29 == Changelog == 30 31 = 4.10.4 = 32 33 * Fix merchant code country selection order 34 35 = 4.10.2 = 36 37 * Cache added for prescoring and order history 30 38 31 39 = 4.10.1 = -
tabby-checkout/trunk/tabby-checkout.php
r3053766 r3073241 4 4 * Plugin URI: https://tabby.ai/ 5 5 * Description: Tabby Checkout 6 * Version: 4.10. 16 * Version: 4.10.4 7 7 * Author: Tabby 8 8 * Author URI: https://tabby.ai … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 define ('MODULE_TABBY_CHECKOUT_VERSION', '4.10. 1');16 define ('MODULE_TABBY_CHECKOUT_VERSION', '4.10.4'); 17 17 define ('TABBY_CHECKOUT_DOMAIN', 'checkout.tabby.ai'); 18 18 define ('TABBY_CHECKOUT_API_DOMAIN', 'api.tabby.ai');
Note: See TracChangeset
for help on using the changeset viewer.