Skip to content

Commit

Permalink
[ECP-9181] Remove intents for virtual product orders (#148)
Browse files Browse the repository at this point in the history
Co-authored-by: Can Demiralp <[email protected]>
  • Loading branch information
candemiralp and Can Demiralp authored Nov 27, 2024
1 parent 2c5413f commit 96b34fb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions view/frontend/web/js/googlepay/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ define([
currency = paymentMethodExtraDetails.configuration.amount.currency;
}

return {
let configuration = {
showPayButton: true,
countryCode: config.countryCode,
environment: config.checkoutenv.toUpperCase(),
Expand All @@ -278,17 +278,13 @@ define([
phoneNumberRequired: true
},
isExpress: true,
callbackIntents: !isVirtual ? ['SHIPPING_ADDRESS', 'SHIPPING_OPTION'] : ['OFFER'],
transactionInfo: {
totalPriceStatus: 'ESTIMATED',
totalPrice: this.isProductView
? formatAmount(totalsModel().getTotal())
: formatAmount(getCartSubtotal()),
currencyCode: currency
},
paymentDataCallbacks: {
onPaymentDataChanged: this.onPaymentDataChanged.bind(this)
},
allowedPaymentMethods: ['CARD'],
phoneNumberRequired: true,
configuration: {
Expand All @@ -302,6 +298,15 @@ define([
onError: () => cancelCart(this.isProductView),
...googlePayStyles
};

if (!isVirtual) {
configuration.callbackIntents = ['SHIPPING_ADDRESS', 'SHIPPING_OPTION'];
configuration.paymentDataCallbacks = {
onPaymentDataChanged: this.onPaymentDataChanged.bind(this)
};
}

return configuration;
},

onPaymentDataChanged: function (data) {
Expand Down

0 comments on commit 96b34fb

Please sign in to comment.