Skip to content

Commit

Permalink
Merge branch 'main' of github.com:juspay/hyperswitch-web into feat/cl…
Browse files Browse the repository at this point in the history
…ick-to-pay
  • Loading branch information
sakksham7 committed Dec 23, 2024
2 parents 619a943 + 6463d26 commit 7efa55a
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [0.106.14](https://github.com/juspay/hyperswitch-web/compare/v0.106.13...v0.106.14) (2024-12-23)


### Bug Fixes

* display saved method screen condition and dynamic fields values updation issue in saved card screen ([#848](https://github.com/juspay/hyperswitch-web/issues/848)) ([aa0d088](https://github.com/juspay/hyperswitch-web/commit/aa0d088c7c56425ff815564cf79e740996649751))

## [0.106.13](https://github.com/juspay/hyperswitch-web/compare/v0.106.12...v0.106.13) (2024-12-19)

## [0.106.12](https://github.com/juspay/hyperswitch-web/compare/v0.106.11...v0.106.12) (2024-12-18)
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.106.13-ctp",
"version": "0.106.14-ctp",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/DynamicFields.res
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ let make = (

let spacedStylesForBiilingDetails = isSpacedInnerLayout ? "p-2" : "my-2"

<RenderIf condition={fieldsArr->Array.length > 0}>
<RenderIf condition={!isSavedCardFlow && fieldsArr->Array.length > 0}>
{<>
{dynamicFieldsToRenderOutsideBilling
->Array.mapWithIndex((item, index) => {
Expand Down
9 changes: 9 additions & 0 deletions src/Components/SavedCardItem.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let make = (
~savedCardlength,
~cvcProps,
~paymentType,
~setRequiredFieldsBody,
) => {
let {themeObj, config, localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let {hideExpiredPaymentMethods, displayDefaultSavedPaymentIcon} = Recoil.useRecoilValueFromAtom(
Expand Down Expand Up @@ -207,6 +208,14 @@ let make = (
</div>
</RenderIf>
<RenderIf condition={isActive}>
<DynamicFields
paymentType
paymentMethod=paymentItem.paymentMethod
paymentMethodType
setRequiredFieldsBody
isSavedCardFlow=true
savedMethod=paymentItem
/>
<Surcharge
paymentMethod=paymentItem.paymentMethod
paymentMethodType
Expand Down
3 changes: 2 additions & 1 deletion src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let make = (
let (showFields, setShowFields) = Recoil.useRecoilState(RecoilAtoms.showCardFieldsAtom)
let areRequiredFieldsValid = Recoil.useRecoilValueFromAtom(RecoilAtoms.areRequiredFieldsValid)
let isManualRetryEnabled = Recoil.useRecoilValueFromAtom(RecoilAtoms.isManualRetryEnabled)
let (requiredFieldsBody, _) = React.useState(_ => Dict.make())
let (requiredFieldsBody, setRequiredFieldsBody) = React.useState(_ => Dict.make())
let loggerState = Recoil.useRecoilValueFromAtom(RecoilAtoms.loggerAtom)
let setUserError = message => {
postFailedSubmitResponse(~errortype="validation_error", ~message)
Expand Down Expand Up @@ -95,6 +95,7 @@ let make = (
savedCardlength
cvcProps
paymentType
setRequiredFieldsBody
/>
)
->React.array}
Expand Down
4 changes: 2 additions & 2 deletions src/PaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod
? NoResult(isGuestCustomer)
: LoadedSavedCards(finalSavedPaymentMethods, isGuestCustomer)
)
setShowFields(prev =>
(finalSavedPaymentMethods->Array.length == 0 || prev) &&
setShowFields(_ =>
finalSavedPaymentMethods->Array.length == 0 &&
isShowPaymentMethodsDependingOnClickToPay->not
)
}
Expand Down

0 comments on commit 7efa55a

Please sign in to comment.