Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Components/SaveDetailsCheckbox.res
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ let make = (~isChecked, ~setIsChecked) => {
<label className={`container CheckboxInput ${checkedState}`}>
<input type_={`checkbox`} onChange />
<div className={`checkmark CheckboxInput ${checkedState} mt-1`} />
<div className={`CheckboxLabel ${checkBoxLabelState} ml-2 w-11/12`}>
<div className={`CheckboxLabel ${checkBoxLabelState} ml-2 w-11/12 opacity-50 text-xs`}>
{React.string(saveCardCheckboxLabel)}
</div>
</label>
10 changes: 5 additions & 5 deletions src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ let make = (
open CardUtils
open Utils
open UtilityHooks

let {themeObj, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let (showFields, setShowFields) = Recoil.useRecoilState(RecoilAtoms.showCardFieldsAtom)
let areRequiredFieldsValid = Recoil.useRecoilValueFromAtom(RecoilAtoms.areRequiredFieldsValid)
@@ -72,13 +73,12 @@ let make = (
| _ => false
}
let empty = cvcNumber == ""
let customerMethod =
let customerMethod = React.useMemo(_ =>
savedMethods
->Array.filter(savedMethod => {
savedMethod.paymentToken === paymentTokenVal
})
->Array.filter(savedMethod => savedMethod.paymentToken === paymentTokenVal)
->Array.get(0)
->Option.getOr(PaymentType.defaultCustomerMethods)
, [paymentTokenVal])
let isUnknownPaymentMethod = customerMethod.paymentMethod === ""
let isCardPaymentMethod = customerMethod.paymentMethod === "card"
let isCardPaymentMethodValid = !customerMethod.requiresCvv || (complete && !empty)
@@ -100,7 +100,7 @@ let make = (
let json = ev.data->safeParse
let confirm = json->getDictFromJson->ConfirmType.itemToObjMapper

let isCustomerAcceptanceRequired = customerMethod.recurringEnabled->not
let isCustomerAcceptanceRequired = customerMethod.recurringEnabled->not || isSaveCardsChecked

let savedPaymentMethodBody = switch customerMethod.paymentMethod {
| "card" =>

0 comments on commit a569dac

Please sign in to comment.