Skip to content

Commit d8ef902

Browse files
fix: googlePay and applePay billing details not being passed in confirm call for saved methods
1 parent ee1502c commit d8ef902

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Utilities/ApplePayHelpers.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ let getApplePayFromResponse = (
3636
~stateJson,
3737
~connectors,
3838
~isPaymentSession=false,
39+
~isSavedMethodsFlow=false,
3940
) => {
4041
let billingContact = billingContactDict->ApplePayTypes.billingContactItemToObjMapper
4142

4243
let shippingContact = shippingContactDict->ApplePayTypes.shippingContactItemToObjMapper
4344

44-
let requiredFieldsBody = if isPaymentSession {
45+
let requiredFieldsBody = if isPaymentSession || isSavedMethodsFlow {
4546
DynamicFieldsUtils.getApplePayRequiredFields(
4647
~billingContact,
4748
~shippingContact,
@@ -179,6 +180,7 @@ let useHandleApplePayResponse = (
179180
~requiredFields=paymentMethodTypes.required_fields,
180181
~stateJson,
181182
~connectors,
183+
~isSavedMethodsFlow,
182184
)
183185

184186
processPayment(

src/Utilities/GooglePayHelpers.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let getGooglePayBodyFromResponse = (
88
~requiredFields=[],
99
~stateJson,
1010
~isPaymentSession=false,
11+
~isSavedMethodsFlow=false,
1112
) => {
1213
let obj = gPayResponse->getDictFromJson->GooglePayType.itemToObjMapper
1314
let gPayBody = PaymentUtils.appendedCustomerAcceptance(
@@ -35,7 +36,7 @@ let getGooglePayBodyFromResponse = (
3536
->getDictFromJson
3637
->getString("email", "")
3738

38-
let requiredFieldsBody = if isPaymentSession {
39+
let requiredFieldsBody = if isPaymentSession || isSavedMethodsFlow {
3940
DynamicFieldsUtils.getGooglePayRequiredFields(
4041
~billingContact,
4142
~shippingContact,
@@ -112,6 +113,7 @@ let useHandleGooglePayResponse = (~connectors, ~intent, ~isSavedMethodsFlow=fals
112113
~connectors,
113114
~requiredFields=paymentMethodTypes.required_fields,
114115
~stateJson,
116+
~isSavedMethodsFlow,
115117
)
116118
processPayment(
117119
~body,

0 commit comments

Comments
 (0)