Skip to content

Commit

Permalink
Merge branch 'main' into feat/unsupported_card_networks
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja authored May 23, 2024
2 parents c59aa41 + dd78d56 commit 5a277b8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [0.54.1](https://github.com/juspay/hyperswitch-web/compare/v0.54.0...v0.54.1) (2024-05-22)


### Bug Fixes

* saved method checkbox condition updated ([#395](https://github.com/juspay/hyperswitch-web/issues/395)) ([8642913](https://github.com/juspay/hyperswitch-web/commit/8642913f5ba4be1c441499f15da2aab64870b209))

# [0.54.0](https://github.com/juspay/hyperswitch-web/compare/v0.53.3...v0.54.0) (2024-05-22)


### Features

* isolate paymentElementCreate message ([#387](https://github.com/juspay/hyperswitch-web/issues/387)) ([0fdfacd](https://github.com/juspay/hyperswitch-web/commit/0fdfacd5826cebc16bb0a807d0539c42055e30f5))

## [0.53.3](https://github.com/juspay/hyperswitch-web/compare/v0.53.2...v0.53.3) (2024-05-22)


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.53.3",
"version": "0.54.1",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
12 changes: 0 additions & 12 deletions src/Components/PayNowButton.res
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,9 @@ let make = () => {
let confirmPayload = sdkHandleConfirmPayment->PaymentBody.confirmPayloadForSDKButton
let buttonText = sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton)

let handleMessage = (event: Types.event) => {
let json = event.data->Identity.anyTypeToJson->getStringFromJson("")->safeParse
let dict = json->getDictFromJson
switch dict->Dict.get("submitSuccessful") {
| Some(_) =>
setIsPayNowButtonDisable(_ => false)
setShowLoader(_ => false)
| None => ()
}
}

let handleOnClick = _ => {
setIsPayNowButtonDisable(_ => true)
setShowLoader(_ => true)
EventListenerManager.addSmartEventListener("message", handleMessage, "onSubmitSuccessful")
handlePostMessage([("handleSdkConfirm", confirmPayload)])
}

Expand Down
12 changes: 10 additions & 2 deletions src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,16 @@ let make = (
let conditionsForShowingSaveCardCheckbox = React.useMemo(() => {
!isGuestCustomer &&
paymentMethodListValue.payment_type === NEW_MANDATE &&
displaySavedPaymentMethodsCheckbox
}, (isGuestCustomer, paymentMethodListValue.payment_type, displaySavedPaymentMethodsCheckbox))
displaySavedPaymentMethodsCheckbox &&
savedMethods->Array.some(ele => {
ele.paymentMethod === "card" && ele.requiresCvv
})
}, (
isGuestCustomer,
paymentMethodListValue.payment_type,
displaySavedPaymentMethodsCheckbox,
savedMethods,
))

<div className="flex flex-col overflow-auto h-auto no-scrollbar animate-slowShow">
{if savedCardlength === 0 && (loadSavedCards === PaymentType.LoadingSavedCards || !showFields) {
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/PaymentBody.res
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ let paymentTypeBody = paymentType =>

let confirmPayloadForSDKButton = (sdkHandleConfirmPayment: PaymentType.sdkHandleConfirmPayment) =>
[
("redirect", "always"->JSON.Encode.string),
(
"confirmParams",
[
("return_url", sdkHandleConfirmPayment.confirmParams.return_url->JSON.Encode.string),
("redirect", "always"->JSON.Encode.string), // *As in the case of SDK Button we are not returning the promise back so it will always redirect
]->Utils.getJsonFromArrayOfJson,
),
]->Utils.getJsonFromArrayOfJson
Expand Down
2 changes: 1 addition & 1 deletion src/orca-loader/Elements.res
Original file line number Diff line number Diff line change
Expand Up @@ -1047,10 +1047,10 @@ let make = (
fetchCustomerPaymentMethods(mountedIframeRef, false, componentType)
}
fetchSessionTokens(mountedIframeRef)
mountedIframeRef->Window.iframePostMessage(message)
resolve()
})
->ignore
mountedIframeRef->Window.iframePostMessage(message)
}

let paymentElement = LoaderPaymentElement.make(
Expand Down

0 comments on commit 5a277b8

Please sign in to comment.