Skip to content

Commit a0924c4

Browse files
author
Carlos Lopez
committed
feat(payment): INT-1138 Fix shipping address bug in google pay
1 parent 1f50f52 commit a0924c4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/checkout-buttons/strategies/googlepay/googlepay-button-strategy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ export default class GooglePayButtonStrategy extends CheckoutButtonStrategy {
8383

8484
return this._googlePayPaymentProcessor.displayWallet()
8585
.then(paymentData => this._googlePayPaymentProcessor.handleSuccess(paymentData)
86-
.then(() => this._googlePayPaymentProcessor.updateShippingAddress(paymentData.shippingAddress)))
86+
.then(() => {
87+
if (paymentData.shippingAddress) {
88+
this._googlePayPaymentProcessor.updateShippingAddress(paymentData.shippingAddress);
89+
}
90+
}))
8791
.then(() => this._onPaymentSelectComplete())
8892
.catch(error => this._onError(error));
8993
}

src/customer/strategies/googlepay/googlepay-customer-strategy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ export default class GooglePayCustomerStrategy extends CustomerStrategy {
123123

124124
return this._googlePayPaymentProcessor.displayWallet()
125125
.then(paymentData => this._googlePayPaymentProcessor.handleSuccess(paymentData)
126-
.then(() => this._googlePayPaymentProcessor.updateShippingAddress(paymentData.shippingAddress)))
126+
.then(() => {
127+
if (paymentData.shippingAddress) {
128+
this._googlePayPaymentProcessor.updateShippingAddress(paymentData.shippingAddress);
129+
}
130+
}))
127131
.then(() => this._onPaymentSelectComplete())
128132
.catch(error => this._onError(error));
129133
}

0 commit comments

Comments
 (0)