Skip to content

Commit

Permalink
Merge branch 'main' into promise-core-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja authored Mar 21, 2024
2 parents 104f587 + 0194abe commit d26800c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 26 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [0.33.11](https://github.com/juspay/hyperswitch-web/compare/v0.33.10...v0.33.11) (2024-03-21)


### Bug Fixes

* hotfix changes for postal code ([#245](https://github.com/juspay/hyperswitch-web/issues/245)) ([4ba7350](https://github.com/juspay/hyperswitch-web/commit/4ba7350d4bbfbfcb570bd8c56a51a14df06f4dae))

## [0.33.10](https://github.com/juspay/hyperswitch-web/compare/v0.33.9...v0.33.10) (2024-03-20)


### Bug Fixes

* saved Payment Method stuck in loading state and Card Holder Name for every saved card ([#241](https://github.com/juspay/hyperswitch-web/issues/241)) ([6b1bc56](https://github.com/juspay/hyperswitch-web/commit/6b1bc565f659d163297453c6b6f5cc602bee6ff5))

## [0.33.9](https://github.com/juspay/hyperswitch-web/compare/v0.33.8...v0.33.9) (2024-03-19)

## [0.33.8](https://github.com/juspay/hyperswitch-web/compare/v0.33.7...v0.33.8) (2024-03-18)
Expand Down
2 changes: 1 addition & 1 deletion 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.33.9",
"version": "0.33.11",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/Components/AddressPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ let make = (~paymentType, ~className="") => {
onChange=onPostalChange
paymentType
className
type_="tel"
name="postal"
inputRef=postalRef
placeholder=localeString.postalCodeLabel
Expand Down
8 changes: 3 additions & 5 deletions src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let make = (
~paymentMethodType,
~setRequiredFieldsBody,
~isSavedCardFlow=false,
~savedCards=[]: array<PaymentType.customerMethods>,
~savedMethod=PaymentType.defaultCustomerMethods,
~cardProps=None,
~expiryProps=None,
~cvcProps=None,
Expand Down Expand Up @@ -46,8 +46,8 @@ let make = (
}, [requiredFieldsWithBillingDetails])

let isAllStoredCardsHaveName = React.useMemo1(() => {
PaymentType.getIsAllStoredCardsHaveName(savedCards)
}, [savedCards])
PaymentType.getIsStoredPaymentMethodHasName(savedMethod)
}, [savedMethod])

//<...>//
let fieldsArr = React.useMemo3(() => {
Expand Down Expand Up @@ -509,7 +509,6 @@ let make = (
}}
onChange=onPostalChange
paymentType
type_="tel"
name="postal"
inputRef=postalRef
placeholder=localeString.postalCodeLabel
Expand Down Expand Up @@ -622,7 +621,6 @@ let make = (
}}
onChange=onPostalChange
paymentType
type_="tel"
name="postal"
inputRef=postalRef
placeholder=localeString.postalCodeLabel
Expand Down
3 changes: 1 addition & 2 deletions src/Components/SavedCardItem.res
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let make = (
~cvcProps,
~paymentType,
~list,
~savedMethods,
~setRequiredFieldsBody,
) => {
let {themeObj, config} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
Expand Down Expand Up @@ -162,7 +161,7 @@ let make = (
paymentMethodType
setRequiredFieldsBody
isSavedCardFlow=true
savedCards=savedMethods
savedMethod=paymentItem
/>
<Surcharge
list
Expand Down
1 change: 0 additions & 1 deletion src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ let make = (
cvcProps
paymentType
list
savedMethods
setRequiredFieldsBody
/>
})
Expand Down
5 changes: 0 additions & 5 deletions src/PaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@ let make = (
</ErrorBoundary>
}

React.useEffect(() => {
setShowFields(_ => !displaySavedPaymentMethods)
None
}, [displaySavedPaymentMethods])

let paymentLabel = if displaySavedPaymentMethods {
showFields
? optionAtomValue.paymentMethodsHeaderText
Expand Down
12 changes: 2 additions & 10 deletions src/Types/PaymentType.res
Original file line number Diff line number Diff line change
Expand Up @@ -974,14 +974,6 @@ let itemToObjMapper = (dict, logger) => {

type loadType = Loading | Loaded(JSON.t) | SemiLoaded | LoadError(JSON.t)

let getIsAllStoredCardsHaveName = (savedCards: array<customerMethods>) => {
savedCards
->Array.filter(savedCard => {
switch savedCard.card.cardHolderName {
| None
| Some("") => false
| _ => true
}
})
->Array.length === savedCards->Array.length
let getIsStoredPaymentMethodHasName = (savedMethod: customerMethods) => {
savedMethod.card.cardHolderName->Option.getOr("")->String.length > 0
}

0 comments on commit d26800c

Please sign in to comment.