Skip to content

Commit

Permalink
fix: card brand configuration error added
Browse files Browse the repository at this point in the history
  • Loading branch information
sakksham7 committed May 9, 2024
1 parent 98235d4 commit 72cf02d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ let make = (
).payment_method_types
->Array.map(ele => ele.card_networks)
->Array.reduce([], (acc, ele) =>
acc->Array.concat(ele->Array.map(val => val.card_network->CardUtils.getCardStringFromType))
acc->Array.concat(
ele->Array.map(
val => val.card_network->CardUtils.getCardStringFromType->String.toLowerCase,
),
)
)
->Utils.getUniqueArray
, [paymentMethodListValue])

let isCardBrandValid = combinedCardNetworks->Array.includes(cardBrand)
let isCardBrandValid = combinedCardNetworks->Array.includes(cardBrand->String.toLowerCase)

let (requiredFieldsBody, setRequiredFieldsBody) = React.useState(_ => Dict.make())

Expand Down

0 comments on commit 72cf02d

Please sign in to comment.