Skip to content

Commit

Permalink
revert: reverting back fix: fixed Saveds Card Confirm Body Sending ca…
Browse files Browse the repository at this point in the history
…rd details
  • Loading branch information
ArushKapoorJuspay committed May 7, 2024
1 parent 5adaf7c commit bbfffae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ let make = (
paymentMethodTypes.required_fields
->Array.concat(creditRequiredFields)
->DynamicFieldsUtils.removeRequiredFieldsDuplicates
->DynamicFieldsUtils.filterCardDetailsIfSavedCardsFlow(isSavedCardFlow)
} else if (
PaymentMethodsRecord.dynamicFieldsEnabledPaymentMethods->Array.includes(paymentMethodType)
) {
paymentMethodTypes.required_fields
} else {
[]
}
}, (paymentMethod, paymentMethodTypes.required_fields, paymentMethodType, isSavedCardFlow))
}, (paymentMethod, paymentMethodTypes.required_fields, paymentMethodType))

let requiredFields = React.useMemo(() => {
requiredFieldsWithBillingDetails->DynamicFieldsUtils.removeBillingDetailsIfUseBillingAddress(
Expand Down
4 changes: 4 additions & 0 deletions src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ let getPaymentMethodFields = (
isAllStoredCardsHaveName
) {
None
} else if (
isSavedCardFlow && requiredField.field_type->filterCardDetailsFromSavedPaymentMethod
) {
None
} else {
requiredField.field_type
}
Expand Down
13 changes: 0 additions & 13 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -803,16 +803,3 @@ let removeRequiredFieldsDuplicates = (

requiredFields
}

let filterCardDetailsIfSavedCardsFlow = (
requiredFields: array<PaymentMethodsRecord.required_fields>,
isSavedCardFlow,
) => {
if isSavedCardFlow {
requiredFields->Array.filter(requiredField => {
requiredField.field_type->PaymentMethodsRecord.filterCardDetailsFromSavedPaymentMethod->not
})
} else {
requiredFields
}
}

0 comments on commit bbfffae

Please sign in to comment.