diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/__snapshots__/paypalExpress.test.js.snap b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/__snapshots__/paypalExpress.test.js.snap index 4f1f42c1e..f501c71cf 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/__snapshots__/paypalExpress.test.js.snap +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/__snapshots__/paypalExpress.test.js.snap @@ -2,6 +2,10 @@ exports[`paypal express getPaypalButtonConfig should return config when review page is enabled 1`] = ` { + "amount": { + "currency": "USD", + "value": 1000, + }, "configuration": {}, "isExpress": true, "onAdditionalDetails": [Function], @@ -18,6 +22,10 @@ exports[`paypal express getPaypalButtonConfig should return config when review p exports[`paypal express getPaypalButtonConfig should return config when review page is not enabled 1`] = ` { + "amount": { + "currency": "USD", + "value": 1000, + }, "configuration": {}, "isExpress": true, "onAdditionalDetails": [Function], diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/paypalExpress.test.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/paypalExpress.test.js index 2a42b5e4c..93339a8f0 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/paypalExpress.test.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/__tests__/paypalExpress.test.js @@ -503,6 +503,7 @@ describe('paypal express', () => { }) describe('getPaypalButtonConfig',() => { window.returnUrl = 'test_returnUrl'; + window.basketAmount = '{"currency":"USD","value":1000}'; beforeEach(() => { jest.clearAllMocks(); }); diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js index f1550c0b1..84bbcb0f9 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/checkoutConfiguration.js @@ -199,8 +199,9 @@ function getGiftCardConfig() { async: false, success: (data) => { giftcardBalance = data.balance; - document.querySelector('button[value="submit-payment"]').disabled = - false; + document.querySelector( + 'button[value="submit-payment"]', + ).disabled = false; if (data.resultCode === constants.SUCCESS) { const { giftCardsInfoMessageContainer, @@ -226,8 +227,9 @@ function getGiftCardConfig() { initialPartialObject.totalDiscountedAmount; }); - document.querySelector('button[value="submit-payment"]').disabled = - true; + document.querySelector( + 'button[value="submit-payment"]', + ).disabled = true; giftCardsInfoMessageContainer.innerHTML = ''; giftCardsInfoMessageContainer.classList.remove( 'gift-cards-info-message-container', diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js index 2f4401f6c..ed41bb58e 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyen_checkout/renderGiftcardComponent.js @@ -96,8 +96,9 @@ function removeGiftCards() { giftCardsInfoMessageContainer.classList.remove( 'gift-cards-info-message-container', ); - document.querySelector('button[value="submit-payment"]').disabled = - false; + document.querySelector( + 'button[value="submit-payment"]', + ).disabled = false; if (res.resultCode === constants.RECEIVED) { document diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/paypalExpress.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/paypalExpress.js index fe25b39da..20f5bff8e 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/paypalExpress.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/paypalExpress.js @@ -153,6 +153,7 @@ function getPaypalButtonConfig(paypalConfig) { showPayButton: true, configuration: paypalConfig, returnUrl: window.returnUrl, + amount: JSON.parse(window.basketAmount), isExpress: true, ...(paypalReviewPageEnabled ? { userAction: 'continue' } : {}), onSubmit: async (state, component) => {