Skip to content

Commit 19db1d3

Browse files
fix: googlePay and applePay billing details not being passed in confirm call for saved methods (#464)
1 parent 02d6bb1 commit 19db1d3

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
@@ -38,12 +38,13 @@ let getApplePayFromResponse = (
3838
~stateJson,
3939
~connectors,
4040
~isPaymentSession=false,
41+
~isSavedMethodsFlow=false,
4142
) => {
4243
let billingContact = billingContactDict->ApplePayTypes.billingContactItemToObjMapper
4344

4445
let shippingContact = shippingContactDict->ApplePayTypes.shippingContactItemToObjMapper
4546

46-
let requiredFieldsBody = if isPaymentSession {
47+
let requiredFieldsBody = if isPaymentSession || isSavedMethodsFlow {
4748
DynamicFieldsUtils.getApplePayRequiredFields(
4849
~billingContact,
4950
~shippingContact,
@@ -183,6 +184,7 @@ let useHandleApplePayResponse = (
183184
~requiredFields=paymentMethodTypes.required_fields,
184185
~stateJson,
185186
~connectors,
187+
~isSavedMethodsFlow,
186188
)
187189

188190
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,
@@ -115,6 +116,7 @@ let useHandleGooglePayResponse = (~connectors, ~intent, ~isSavedMethodsFlow=fals
115116
~connectors,
116117
~requiredFields=paymentMethodTypes.required_fields,
117118
~stateJson,
119+
~isSavedMethodsFlow,
118120
)
119121
processPayment(
120122
~body,

0 commit comments

Comments
 (0)