Skip to content

Commit

Permalink
fix: googlePay and applePay billing details not being passed in confi…
Browse files Browse the repository at this point in the history
…rm call for saved methods
  • Loading branch information
ArushKapoorJuspay committed Jun 30, 2024
1 parent ee1502c commit d8ef902
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Utilities/ApplePayHelpers.res
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ let getApplePayFromResponse = (
~stateJson,
~connectors,
~isPaymentSession=false,
~isSavedMethodsFlow=false,
) => {
let billingContact = billingContactDict->ApplePayTypes.billingContactItemToObjMapper

let shippingContact = shippingContactDict->ApplePayTypes.shippingContactItemToObjMapper

let requiredFieldsBody = if isPaymentSession {
let requiredFieldsBody = if isPaymentSession || isSavedMethodsFlow {
DynamicFieldsUtils.getApplePayRequiredFields(
~billingContact,
~shippingContact,
Expand Down Expand Up @@ -179,6 +180,7 @@ let useHandleApplePayResponse = (
~requiredFields=paymentMethodTypes.required_fields,
~stateJson,
~connectors,
~isSavedMethodsFlow,
)

processPayment(
Expand Down
4 changes: 3 additions & 1 deletion src/Utilities/GooglePayHelpers.res
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let getGooglePayBodyFromResponse = (
~requiredFields=[],
~stateJson,
~isPaymentSession=false,
~isSavedMethodsFlow=false,
) => {
let obj = gPayResponse->getDictFromJson->GooglePayType.itemToObjMapper
let gPayBody = PaymentUtils.appendedCustomerAcceptance(
Expand Down Expand Up @@ -35,7 +36,7 @@ let getGooglePayBodyFromResponse = (
->getDictFromJson
->getString("email", "")

let requiredFieldsBody = if isPaymentSession {
let requiredFieldsBody = if isPaymentSession || isSavedMethodsFlow {
DynamicFieldsUtils.getGooglePayRequiredFields(
~billingContact,
~shippingContact,
Expand Down Expand Up @@ -112,6 +113,7 @@ let useHandleGooglePayResponse = (~connectors, ~intent, ~isSavedMethodsFlow=fals
~connectors,
~requiredFields=paymentMethodTypes.required_fields,
~stateJson,
~isSavedMethodsFlow,
)
processPayment(
~body,
Expand Down

0 comments on commit d8ef902

Please sign in to comment.