From 799e06a7dd6f36cee4d31a018e88d45adb2e18cd Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 13 Oct 2023 10:04:17 +0100 Subject: [PATCH] Add cart simulation adjustments --- modules/ppcp-googlepay/resources/js/GooglepayButton.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/ppcp-googlepay/resources/js/GooglepayButton.js b/modules/ppcp-googlepay/resources/js/GooglepayButton.js index d004b8a41..f4efc17f0 100644 --- a/modules/ppcp-googlepay/resources/js/GooglepayButton.js +++ b/modules/ppcp-googlepay/resources/js/GooglepayButton.js @@ -229,6 +229,11 @@ class GooglepayButton { const updateData = new UpdatePaymentData(this.buttonConfig.ajax.update_payment_data) const updatedData = await updateData.update(paymentData); + const transactionInfo = await this.contextHandler.transactionInfo(); + + updatedData.country_code = transactionInfo.countryCode; + updatedData.currency_code = transactionInfo.currencyCode; + updatedData.total_str = transactionInfo.totalPrice; // Handle unserviceable address. if(!updatedData.shipping_options || !updatedData.shipping_options.shippingOptions.length) {