Changeset 2907371
- Timestamp:
- 05/03/2023 09:01:20 AM (3 years ago)
- Location:
- bread-finance
- Files:
-
- 5 edited
- 19 copied
-
tags/release-3.3.3 (copied) (copied from bread-finance/trunk)
-
tags/release-3.3.3/README.md (copied) (copied from bread-finance/trunk/README.md) (2 diffs)
-
tags/release-3.3.3/assets/js/v1/main.js (copied) (copied from bread-finance/trunk/assets/js/v1/main.js)
-
tags/release-3.3.3/assets/js/v2/main.js (copied) (copied from bread-finance/trunk/assets/js/v2/main.js) (2 diffs)
-
tags/release-3.3.3/bread-finance.php (copied) (copied from bread-finance/trunk/bread-finance.php) (2 diffs)
-
tags/release-3.3.3/classes/class-bread-finance-ajax.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-ajax.php)
-
tags/release-3.3.3/classes/class-bread-finance-button-helper.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-button-helper.php)
-
tags/release-3.3.3/classes/class-bread-finance-button.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-button.php)
-
tags/release-3.3.3/classes/class-bread-finance-classic-api.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-classic-api.php)
-
tags/release-3.3.3/classes/class-bread-finance-form-fields.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-form-fields.php)
-
tags/release-3.3.3/classes/class-bread-finance-gateway.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-gateway.php)
-
tags/release-3.3.3/classes/class-bread-finance-logger.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-logger.php)
-
tags/release-3.3.3/classes/class-bread-finance-options-cart-checkout.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-options-cart-checkout.php)
-
tags/release-3.3.3/classes/class-bread-finance-options-cart.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-options-cart.php)
-
tags/release-3.3.3/classes/class-bread-finance-options-category.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-options-category.php)
-
tags/release-3.3.3/classes/class-bread-finance-options-checkout.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-options-checkout.php) (3 diffs)
-
tags/release-3.3.3/classes/class-bread-finance-options-product.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-options-product.php)
-
tags/release-3.3.3/classes/class-bread-finance-utilities.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-utilities.php) (1 diff)
-
tags/release-3.3.3/classes/class-bread-finance-v2-api.php (copied) (copied from bread-finance/trunk/classes/class-bread-finance-v2-api.php)
-
trunk/README.md (modified) (2 diffs)
-
trunk/assets/js/v2/main.js (modified) (2 diffs)
-
trunk/bread-finance.php (modified) (2 diffs)
-
trunk/classes/class-bread-finance-options-checkout.php (modified) (3 diffs)
-
trunk/classes/class-bread-finance-utilities.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bread-finance/tags/release-3.3.3/README.md
r2897614 r2907371 4 4 Requires at least: 4.9 5 5 Tested up to: 6.1.1 6 Stable tag: 3.3. 26 Stable tag: 3.3.3 7 7 Requires PHP: 5.6 8 8 WC requires at least: 3.0 … … 73 73 == Changelog == 74 74 75 = 3.3.3 76 * Current release 77 * Bug fix for discount codes applied with Avatax enabled 78 75 79 = 3.3.2 76 * Current release77 80 * Added admin notices to notify merchants of re-configuration they need to make if upgrading to v3.3.0+ 78 81 * Added local logging of data for Transaction service -
bread-finance/tags/release-3.3.3/assets/js/v2/main.js
r2853897 r2907371 896 896 totalDiscounts: { 897 897 currency: opts.currency, 898 value: ( opts.discounts != undefined&& opts.discounts.length > 0 ) ? opts.discounts[0].amount : 0898 value: (typeof(opts.discounts) !== 'undefined' && opts.discounts.length > 0 ) ? opts.discounts[0].amount : 0 899 899 }, 900 900 totalShipping: { 901 901 currency: opts.currency, 902 value: ( opts.shippingOptions != undefined&& opts.shippingOptions.length > 0 ) ? opts.shippingOptions[0].cost : 0902 value: (typeof(opts.shippingOptions) !== 'undefined' && opts.shippingOptions.length > 0 ) ? opts.shippingOptions[0].cost : 0 903 903 }, 904 904 totalTax: { 905 905 currency: opts.currency, 906 value: ( opts.tax != undefined) ? opts.tax : 0906 value: (typeof(opts.tax) !== 'undefined') ? opts.tax : 0 907 907 } 908 908 } … … 940 940 var tokenField = breadController.breadCheckoutHandler.$form.find('input[name="bread_tx_token"]'); 941 941 942 if ( application.transactionID == undefined) {942 if (typeof(application.transactionID) === 'undefined') { 943 943 var errorInfo = { 944 944 err: application -
bread-finance/tags/release-3.3.3/bread-finance.php
r2897614 r2907371 6 6 * Author: Bread Pay 7 7 * Author URI: https://payments.breadfinancial.com/ 8 * Version: 3.3. 28 * Version: 3.3.3 9 9 * Text Domain: bread-finance 10 10 * Domain Path: /i18n/languages/ … … 22 22 23 23 //Require minimums and constants 24 define('WC_BREAD_FINANCE_VERSION', '3.3. 2');24 define('WC_BREAD_FINANCE_VERSION', '3.3.3'); 25 25 define('WC_BREAD_FINANCE_MIN_PHP_VER', '5.6.0'); 26 26 define('WC_BREAD_FINANCE_MIN_WC_VER', '3.4.0'); -
bread-finance/tags/release-3.3.3/classes/class-bread-finance-options-checkout.php
r2897614 r2907371 43 43 ); 44 44 45 $options['customTotal'] = $this->bread_finance_utilities->priceToCents(WC()->cart->get_total('float')); 45 //Get cart totals 46 $cartTotal = $this->bread_finance_utilities->priceToCents(WC()->cart->get_total('float')); 46 47 $cartSubtotal = $this->bread_finance_utilities->priceToCents(WC()->cart->get_subtotal('float')); 47 48 /* Include shipping cost in tax calculations to ensure Avalara accounts for shipping tax amount */ 48 49 //Get Discounts 50 $discountResponse = $this->getDiscounts(); 51 $discountTotal = $this->bread_finance_utilities->getDiscountTotal($discountResponse["discounts"] ?: array()); 52 53 /* 54 * Include shipping cost in tax calculations to ensure 55 * Avalara accounts for shipping tax amount 56 */ 49 57 $shippingCost = 0; 50 58 $shippingResponse = $this->getShipping(); … … 52 60 $shippingCost = $shippingResponse['shippingOptions'][0]['cost']; 53 61 } 62 $options['shippingCountry'] = WC()->customer->get_shipping_country(); 63 64 //Get tax 54 65 $taxResponse = $this->getTax($shippingCost); 55 $discountResponse = $this->getDiscounts(); 56 /* If AvaTax is enabled, calculate customTotal using subtotal + shipping cost + tax - discounts */ 57 if ($this->bread_finance_utilities->isAvataxEnabled()) { 58 $discountTotal = $this->bread_finance_utilities->getDiscountTotal($discountResponse["discounts"] ?: array()); 59 $cartSubtotal = $this->bread_finance_utilities->priceToCents(WC()->cart->get_subtotal('float')); 60 } 61 66 $taxTotal = isset($taxResponse['tax']) ? $taxResponse['tax'] : 0; 67 68 //Get items 62 69 $options['items'] = $this->getItems(); 63 70 … … 69 76 } 70 77 78 //Totals 71 79 $options['subTotal'] = $cartSubtotal; 72 $options['customTotal'] = ($cartSubtotal + $shippingCost + $taxResponse['tax']) - $discountTotal; 73 $options['shippingCountry'] = WC()->customer->get_shipping_country(); 74 80 $options['customTotal'] = ($cartSubtotal + $shippingCost + $taxTotal) - $discountTotal; 81 $options['cartTotal'] = $cartTotal; 82 83 //Currency options 75 84 $currency = get_woocommerce_currency(); 76 85 $options['currency'] = $currency; -
bread-finance/tags/release-3.3.3/classes/class-bread-finance-utilities.php
r2897614 r2907371 201 201 202 202 public function getTaxHelper($shippingCost) { 203 $tax ;203 $tax = 0; 204 204 $cart = WC()->cart; 205 205 -
bread-finance/trunk/README.md
r2897614 r2907371 4 4 Requires at least: 4.9 5 5 Tested up to: 6.1.1 6 Stable tag: 3.3. 26 Stable tag: 3.3.3 7 7 Requires PHP: 5.6 8 8 WC requires at least: 3.0 … … 73 73 == Changelog == 74 74 75 = 3.3.3 76 * Current release 77 * Bug fix for discount codes applied with Avatax enabled 78 75 79 = 3.3.2 76 * Current release77 80 * Added admin notices to notify merchants of re-configuration they need to make if upgrading to v3.3.0+ 78 81 * Added local logging of data for Transaction service -
bread-finance/trunk/assets/js/v2/main.js
r2853897 r2907371 896 896 totalDiscounts: { 897 897 currency: opts.currency, 898 value: ( opts.discounts != undefined&& opts.discounts.length > 0 ) ? opts.discounts[0].amount : 0898 value: (typeof(opts.discounts) !== 'undefined' && opts.discounts.length > 0 ) ? opts.discounts[0].amount : 0 899 899 }, 900 900 totalShipping: { 901 901 currency: opts.currency, 902 value: ( opts.shippingOptions != undefined&& opts.shippingOptions.length > 0 ) ? opts.shippingOptions[0].cost : 0902 value: (typeof(opts.shippingOptions) !== 'undefined' && opts.shippingOptions.length > 0 ) ? opts.shippingOptions[0].cost : 0 903 903 }, 904 904 totalTax: { 905 905 currency: opts.currency, 906 value: ( opts.tax != undefined) ? opts.tax : 0906 value: (typeof(opts.tax) !== 'undefined') ? opts.tax : 0 907 907 } 908 908 } … … 940 940 var tokenField = breadController.breadCheckoutHandler.$form.find('input[name="bread_tx_token"]'); 941 941 942 if ( application.transactionID == undefined) {942 if (typeof(application.transactionID) === 'undefined') { 943 943 var errorInfo = { 944 944 err: application -
bread-finance/trunk/bread-finance.php
r2897614 r2907371 6 6 * Author: Bread Pay 7 7 * Author URI: https://payments.breadfinancial.com/ 8 * Version: 3.3. 28 * Version: 3.3.3 9 9 * Text Domain: bread-finance 10 10 * Domain Path: /i18n/languages/ … … 22 22 23 23 //Require minimums and constants 24 define('WC_BREAD_FINANCE_VERSION', '3.3. 2');24 define('WC_BREAD_FINANCE_VERSION', '3.3.3'); 25 25 define('WC_BREAD_FINANCE_MIN_PHP_VER', '5.6.0'); 26 26 define('WC_BREAD_FINANCE_MIN_WC_VER', '3.4.0'); -
bread-finance/trunk/classes/class-bread-finance-options-checkout.php
r2897614 r2907371 43 43 ); 44 44 45 $options['customTotal'] = $this->bread_finance_utilities->priceToCents(WC()->cart->get_total('float')); 45 //Get cart totals 46 $cartTotal = $this->bread_finance_utilities->priceToCents(WC()->cart->get_total('float')); 46 47 $cartSubtotal = $this->bread_finance_utilities->priceToCents(WC()->cart->get_subtotal('float')); 47 48 /* Include shipping cost in tax calculations to ensure Avalara accounts for shipping tax amount */ 48 49 //Get Discounts 50 $discountResponse = $this->getDiscounts(); 51 $discountTotal = $this->bread_finance_utilities->getDiscountTotal($discountResponse["discounts"] ?: array()); 52 53 /* 54 * Include shipping cost in tax calculations to ensure 55 * Avalara accounts for shipping tax amount 56 */ 49 57 $shippingCost = 0; 50 58 $shippingResponse = $this->getShipping(); … … 52 60 $shippingCost = $shippingResponse['shippingOptions'][0]['cost']; 53 61 } 62 $options['shippingCountry'] = WC()->customer->get_shipping_country(); 63 64 //Get tax 54 65 $taxResponse = $this->getTax($shippingCost); 55 $discountResponse = $this->getDiscounts(); 56 /* If AvaTax is enabled, calculate customTotal using subtotal + shipping cost + tax - discounts */ 57 if ($this->bread_finance_utilities->isAvataxEnabled()) { 58 $discountTotal = $this->bread_finance_utilities->getDiscountTotal($discountResponse["discounts"] ?: array()); 59 $cartSubtotal = $this->bread_finance_utilities->priceToCents(WC()->cart->get_subtotal('float')); 60 } 61 66 $taxTotal = isset($taxResponse['tax']) ? $taxResponse['tax'] : 0; 67 68 //Get items 62 69 $options['items'] = $this->getItems(); 63 70 … … 69 76 } 70 77 78 //Totals 71 79 $options['subTotal'] = $cartSubtotal; 72 $options['customTotal'] = ($cartSubtotal + $shippingCost + $taxResponse['tax']) - $discountTotal; 73 $options['shippingCountry'] = WC()->customer->get_shipping_country(); 74 80 $options['customTotal'] = ($cartSubtotal + $shippingCost + $taxTotal) - $discountTotal; 81 $options['cartTotal'] = $cartTotal; 82 83 //Currency options 75 84 $currency = get_woocommerce_currency(); 76 85 $options['currency'] = $currency; -
bread-finance/trunk/classes/class-bread-finance-utilities.php
r2897614 r2907371 201 201 202 202 public function getTaxHelper($shippingCost) { 203 $tax ;203 $tax = 0; 204 204 $cart = WC()->cart; 205 205
Note: See TracChangeset
for help on using the changeset viewer.