Skip to content

Commit

Permalink
Merge branch 'main' into one-click
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Oct 4, 2024
2 parents 79bc50a + 7d6c337 commit 562dda6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [0.91.2](https://github.com/juspay/hyperswitch-web/compare/v0.91.1...v0.91.2) (2024-10-03)


### Bug Fixes

* customer-acceptance for saved pm ([#709](https://github.com/juspay/hyperswitch-web/issues/709)) ([a569dac](https://github.com/juspay/hyperswitch-web/commit/a569dacede738ba4f7464966a323e14d19170028))

## [0.91.1](https://github.com/juspay/hyperswitch-web/compare/v0.91.0...v0.91.1) (2024-09-26)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "orca-payment-page",
"version": "0.91.1",
"version": "0.91.2",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/SaveDetailsCheckbox.res
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
10 changes: 5 additions & 5 deletions src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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" =>
Expand Down

0 comments on commit 562dda6

Please sign in to comment.