Skip to content

Commit

Permalink
fix: crypto currency payment method (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakksham7 authored Nov 25, 2024
1 parent bb7ffbe commit c3aed42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Payments/PaymentMethodsWrapper.res
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ let make = (~paymentType: CardThemeType.mode, ~paymentMethodName: string) => {
let areRequiredFieldsValid = Recoil.useRecoilValueFromAtom(areRequiredFieldsValid)
let areRequiredFieldsEmpty = Recoil.useRecoilValueFromAtom(areRequiredFieldsEmpty)

let complete = areRequiredFieldsValid

React.useEffect(() => {
setFieldComplete(_ => complete)
setFieldComplete(_ => areRequiredFieldsValid)
None
}, [complete])
}, [areRequiredFieldsValid])

let empty = areRequiredFieldsEmpty

UtilityHooks.useHandlePostMessages(
~complete,
~complete=areRequiredFieldsValid,
~empty,
~paymentType=paymentMethodDetails.paymentMethodName,
)
Expand All @@ -59,7 +57,7 @@ let make = (~paymentType: CardThemeType.mode, ~paymentMethodName: string) => {
let json = ev.data->safeParse
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper
if confirm.doSubmit {
if complete {
if areRequiredFieldsValid {
let countryCode =
Country.getCountry(paymentMethodName)
->Array.filter(item => item.countryName == country)
Expand Down Expand Up @@ -105,7 +103,10 @@ let make = (~paymentType: CardThemeType.mode, ~paymentMethodName: string) => {
paymentMethodName,
isManualRetryEnabled,
phoneNumber.value,
(selectedBank, currency, requiredFieldsBody),
selectedBank,
currency,
requiredFieldsBody,
areRequiredFieldsValid,
))
useSubmitPaymentData(submitCallback)
<div
Expand Down
1 change: 1 addition & 0 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ let useRequiredFieldsEmptyAndValid = (
cardExpiry,
cvcNumber,
bankAccountNumber,
cryptoCurrencyNetworks,
))
}

Expand Down

0 comments on commit c3aed42

Please sign in to comment.