From ad19e9de78e55fde136f4d28b56cd5344daa2959 Mon Sep 17 00:00:00 2001 From: Zenit Shkreli <69572953+zenit2001@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:56:07 +0200 Subject: [PATCH] fix: adding the c2p shopperemail upon initial rendering (#1188) --- .../cartridge/client/default/js/adyenCheckout.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js index d571b2101..4bc2c228d 100644 --- a/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js +++ b/src/cartridges/app_adyen_SFRA/cartridge/client/default/js/adyenCheckout.js @@ -45,6 +45,14 @@ if ( ] = window.googleMerchantID; } +$('body').on('checkout:updateCheckoutView', (event, data) => { + if (data.order.orderEmail) { + const { clickToPayConfiguration } = + store.checkoutConfiguration.paymentMethodsConfiguration.card; + clickToPayConfiguration.shopperEmail = data.order.orderEmail; + } +}); + // Submit the payment $('button[value="submit-payment"]').on('click', () => { if (store.paypalTerminatedEarly) {