diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 6a34d2ac..8254745e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -141,7 +141,7 @@ jobs: # after the test run completes # store screenshots # NOTE: screenshots will be generated only if E2E test failed - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() || true with: name: cypress-screenshots diff --git a/CHANGELOG.md b/CHANGELOG.md index 8437f43f..bad647fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## [3.7.7] +- Fix: Apple Pay - Incorrect transaction amounts with custom currency configurations. + ## [3.7.6] - Fix: Charge subscriptions using the renewal order total instead of the original reserved amount. - Support export reconciliation data with WooCommerce High-Performance Order Storage (HPOS). diff --git a/altapay.php b/altapay.php index ae64c446..fdd2d207 100755 --- a/altapay.php +++ b/altapay.php @@ -7,10 +7,10 @@ * Author URI: https://altapay.com * Text Domain: altapay * Domain Path: /languages - * Version: 3.7.6 + * Version: 3.7.7 * Name: SDM_Altapay * WC requires at least: 3.9.0 - * WC tested up to: 9.5.1 + * WC tested up to: 9.7.1 * * @package Altapay */ @@ -41,7 +41,7 @@ } if ( ! defined( 'ALTAPAY_PLUGIN_VERSION' ) ) { - define( 'ALTAPAY_PLUGIN_VERSION', '3.7.6' ); + define( 'ALTAPAY_PLUGIN_VERSION', '3.7.7' ); } // Include the autoloader, so we can dynamically include the rest of the classes. diff --git a/assets/js/blocks/index.js b/assets/js/blocks/index.js index 0372eae8..73a8f8b4 100644 --- a/assets/js/blocks/index.js +++ b/assets/js/blocks/index.js @@ -24,7 +24,7 @@ const label = decodeEntities( settings.title ) || defaultLabel; const Content = ( props ) => { const store = select( storeKey ); const cartData = store.getCartTotals(); - settings.subtotal = cartData.total_price / 100; + settings.subtotal = cartData.total_price / Math.pow(10, cartData.currency_minor_unit); const { eventRegistration, activePaymentMethod, emitResponse } = props; const { onCheckoutSuccess } = eventRegistration; useEffect( () => { diff --git a/readme.txt b/readme.txt index 75200eaf..6d0a5b3c 100644 --- a/readme.txt +++ b/readme.txt @@ -3,11 +3,11 @@ Contributors: altapay_integrations Tags: AltaPay, Gateway, Payments, WooCommerce, Payment Card Industry Requires PHP: 7.4 Requires at least: 5.0 -Tested up to: 6.7.1 -Stable tag: 3.7.6 +Tested up to: 6.7.2 +Stable tag: 3.7.7 License: MIT WC requires at least: 3.9.0 -WC tested up to: 9.5.1 +WC tested up to: 9.7.1 License URI: http://www.gnu.org/licenses/gpl-2.0.html A plugin that integrates your WooCommerce web shop to the AltaPay payments gateway. @@ -39,6 +39,9 @@ AltaPay's Payment Gateway for WooCommerce provides merchants with access to a fu == Changelog == += 3.7.7 = +* Fix: Apple Pay - Incorrect transaction amounts with custom currency configurations. + = 3.7.6 = * Fix: Charge subscriptions using the renewal order total instead of the original reserved amount. * Support export reconciliation data with WooCommerce High-Performance Order Storage (HPOS). diff --git a/views/blocksJs.tpl b/views/blocksJs.tpl index a242747a..40f4e74b 100644 --- a/views/blocksJs.tpl +++ b/views/blocksJs.tpl @@ -1 +1 @@ -(()=>{"use strict";const e=window.React,t=window.wp.i18n,n=window.wc.wcBlocksRegistry,o=window.wp.htmlEntities,a=window.wc.wcSettings,c=window.wc.wcBlocksData,s=window.wp.data,i=(0,a.getSetting)("altapay_{terminal_id}_data",{}),{useEffect:l}=window.wp.element,r=(0,t.__)("AltaPay","woo-gutenberg-products-block"),p=(0,o.decodeEntities)(i.title)||r,w=e=>{const t=(0,s.select)(c.CART_STORE_KEY).getCartTotals();i.subtotal=t.total_price/100;const{eventRegistration:n,activePaymentMethod:a,emitResponse:r}=e,{onCheckoutSuccess:p}=n;return l((()=>{const e=p((e=>{var t=e.processingResponse.paymentDetails.order_id;return"yes"===i.is_apple_pay?(onApplePayButtonClicked(i,!1,null,t),{type:r.responseTypes.SUCCESS}):{type:r.responseTypes.SUCCESS}}));return()=>{e()}}),[r.responseTypes.SUCCESS,p]),jQuery(".wc-block-components-checkout-place-order-button").click((function(){jQuery("#radio-control-wc-payment-method-options-"+i.applepay_payment_method).is(":checked")&&onApplePayButtonClicked(i,!0,!1)})),(0,o.decodeEntities)(i.description||"")},d={name:"altapay_{terminal_id}",label:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{class:"altapay-payment-method"},(0,t.__)(p,"woocommerce-payments"),(0,e.createElement)("span",null,i.icon&&Array.isArray(i.icon)?i.icon.map(((t,n)=>(0,e.createElement)("img",{key:n,src:t,alt:`Icon ${n}`}))):i.icon&&(0,e.createElement)("img",{src:i.icon,alt:""})))),content:(0,e.createElement)(w,null),edit:(0,e.createElement)(w,null),canMakePayment:()=>!0,ariaLabel:p,supports:{features:i.supports}};(0,n.registerPaymentMethod)(d)})(); \ No newline at end of file +(()=>{"use strict";const e=window.React,t=window.wp.i18n,n=window.wc.wcBlocksRegistry,o=window.wp.htmlEntities,a=window.wc.wcSettings,c=window.wc.wcBlocksData,s=window.wp.data,i=(0,a.getSetting)("altapay_{terminal_id}_data",{}),{useEffect:l}=window.wp.element,r=(0,t.__)("AltaPay","woo-gutenberg-products-block"),p=(0,o.decodeEntities)(i.title)||r,w=e=>{const t=(0,s.select)(c.CART_STORE_KEY).getCartTotals();i.subtotal=t.total_price/Math.pow(10,t.currency_minor_unit);const{eventRegistration:n,activePaymentMethod:a,emitResponse:r}=e,{onCheckoutSuccess:p}=n;return l((()=>{const e=p((e=>{var t=e.processingResponse.paymentDetails.order_id;return"yes"===i.is_apple_pay?(onApplePayButtonClicked(i,!1,null,t),{type:r.responseTypes.SUCCESS}):{type:r.responseTypes.SUCCESS}}));return()=>{e()}}),[r.responseTypes.SUCCESS,p]),jQuery(".wc-block-components-checkout-place-order-button").click((function(){jQuery("#radio-control-wc-payment-method-options-"+i.applepay_payment_method).is(":checked")&&onApplePayButtonClicked(i,!0,!1)})),(0,o.decodeEntities)(i.description||"")},d={name:"altapay_{terminal_id}",label:(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{class:"altapay-payment-method"},(0,t.__)(p,"woocommerce-payments"),(0,e.createElement)("span",null,i.icon&&Array.isArray(i.icon)?i.icon.map(((t,n)=>(0,e.createElement)("img",{key:n,src:t,alt:`Icon ${n}`}))):i.icon&&(0,e.createElement)("img",{src:i.icon,alt:""})))),content:(0,e.createElement)(w,null),edit:(0,e.createElement)(w,null),canMakePayment:()=>!0,ariaLabel:p,supports:{features:i.supports}};(0,n.registerPaymentMethod)(d)})(); \ No newline at end of file diff --git a/wiki.md b/wiki.md index bef4db6a..4751f884 100644 --- a/wiki.md +++ b/wiki.md @@ -274,14 +274,14 @@ In order to reconcile payments please follow the steps below: ## Supported versions Minimum system requirements are: -- WordPress min. 5.0 – max. 6.7.1 -- WooCommerce min. 3.9.0 – max. 9.5.1 +- WordPress min. 5.0 – max. 6.7.2 +- WooCommerce min. 3.9.0 – max. 9.7.1 - PHP 7.4 and above - PHP-bcmath library installed. - PHP-curl MUST be enabled. The latest tested version is: -- WordPress 6.7.1, WooCommerce 9.5.1 and PHP 8.1 +- WordPress 6.7.2, WooCommerce 9.7.1 and PHP 8.2 ## Troubleshooting