Skip to content

Commit

Permalink
Merge branch 'main' into feat/ali_pay_hk
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored May 31, 2024
2 parents fa8b2b2 + 0f87f73 commit 897e6d6
Show file tree
Hide file tree
Showing 19 changed files with 626 additions and 250 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
## [0.57.3](https://github.com/juspay/hyperswitch-web/compare/v0.57.2...v0.57.3) (2024-05-31)


### Bug Fixes

* error utils refactor ([#405](https://github.com/juspay/hyperswitch-web/issues/405)) ([8d833e4](https://github.com/juspay/hyperswitch-web/commit/8d833e4385a4e9b3c819fbc3ad062a9a3f352cf8))
* mb_way ui fix ([#407](https://github.com/juspay/hyperswitch-web/issues/407)) ([9c6a87c](https://github.com/juspay/hyperswitch-web/commit/9c6a87c5e99102a8047cb674810b713f60069ea0))

## [0.57.2](https://github.com/juspay/hyperswitch-web/compare/v0.57.1...v0.57.2) (2024-05-30)


### Bug Fixes

* allow customer to pay with different payment method on cancel of… ([#409](https://github.com/juspay/hyperswitch-web/issues/409)) ([d48c5c2](https://github.com/juspay/hyperswitch-web/commit/d48c5c26b2eb96ceeaa75c348d73c3f6ab480cc4))

## [0.57.1](https://github.com/juspay/hyperswitch-web/compare/v0.57.0...v0.57.1) (2024-05-30)


### Bug Fixes

* hide terms based upon prop ([#408](https://github.com/juspay/hyperswitch-web/issues/408)) ([8a5d554](https://github.com/juspay/hyperswitch-web/commit/8a5d5548d70750725a61381abf4fa68879fa4746))

# [0.57.0](https://github.com/juspay/hyperswitch-web/compare/v0.56.1...v0.57.0) (2024-05-30)


### Bug Fixes

* fixed ApplePay Event Handler ([#406](https://github.com/juspay/hyperswitch-web/issues/406)) ([bfc7470](https://github.com/juspay/hyperswitch-web/commit/bfc747010c6a5c891d0d93e7ce9dbbcdd8980e07))


### Features

* added PayPal SDK Via PayPal ([#404](https://github.com/juspay/hyperswitch-web/issues/404)) ([084932d](https://github.com/juspay/hyperswitch-web/commit/084932d644cc4f7da9aebe124e069e97ee14476b))

## [0.56.1](https://github.com/juspay/hyperswitch-web/compare/v0.56.0...v0.56.1) (2024-05-27)


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.56.1",
"version": "0.57.3",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/Components/DropdownField.res
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ let make = (
<div className={`Input ${className} appearance-none relative`}>
<RenderIf condition={isDisplayValueVisible && displayValue->Option.isSome}>
<div
className="absolute top-2.5 right-0 left-2 bottom-0 pointer-events-none rounded-sm"
className="absolute top-1 left-1 right-0 bottom-0 pointer-events-none rounded-sm z-20 whitespace-nowrap"
style={
background: disabled ? disbaledBG : themeObj.colorBackground,
opacity: disabled ? "35%" : "",
padding: themeObj.spacingUnit,
width: "100%",
width: "95%",
}>
{React.string(displayValue->Option.getOr(""))}
</div>
Expand Down
149 changes: 84 additions & 65 deletions src/Components/PaymentField.res
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,10 @@ let make = (

let flexDirectionBasedOnType = type_ === "tel" ? "flex-row" : "flex-col"

<div className={`flex ${flexDirectionBasedOnType} w-full`} style={color: themeObj.colorText}>
<RenderIf condition={type_ === "tel"}>
<DropdownField
appearance=config.appearance
value={valueDropDown->Option.getOr("")}
setValue={setValueDropDown->Option.getOr(_ => ())}
fieldName={dropDownFieldName->Option.getOr("")}
options={dropDownOptions->Option.getOr([])}
width="w-1/3 mr-2"
displayValue={displayValue->Option.getOr("")}
setDisplayValue={setDisplayValue->Option.getOr(_ => ())}
isDisplayValueVisible=true
/>
</RenderIf>
<div className="flex flex-col">
<RenderIf
condition={fieldName->String.length > 0 &&
condition={name === "phone" &&
fieldName->String.length > 0 &&
config.appearance.labels == Above &&
isSpacedInnerLayout}>
<div
Expand All @@ -116,59 +104,90 @@ let make = (
{React.string(fieldName)}
</div>
</RenderIf>
<div className="flex flex-row w-full" style={direction: direction}>
<div className="relative w-full">
<input
style={
background: backgroundClass,
padding: themeObj.spacingUnit,
width: "100%",
}
disabled=readOnly
ref={inputRef->ReactDOM.Ref.domRef}
type_
name
?maxLength
?pattern
className={`${inputClassStyles} ${inputClass} ${className} focus:outline-none transition-shadow ease-out duration-200`}
placeholder={config.appearance.labels == Above || config.appearance.labels == Never
? placeholder
: ""}
value={value.value}
autoComplete="on"
onChange
onBlur=handleBlur
onFocus=handleFocus
<div className={`flex ${flexDirectionBasedOnType} w-full`} style={color: themeObj.colorText}>
<RenderIf condition={type_ === "tel"}>
<DropdownField
appearance=config.appearance
value={valueDropDown->Option.getOr("")}
setValue={setValueDropDown->Option.getOr(_ => ())}
fieldName={dropDownFieldName->Option.getOr("")}
options={dropDownOptions->Option.getOr([])}
width="w-1/3 mr-2"
displayValue={displayValue->Option.getOr("")}
setDisplayValue={setDisplayValue->Option.getOr(_ => ())}
isDisplayValueVisible=true
/>
<RenderIf condition={config.appearance.labels == Floating}>
<div
className={`Label ${floatinglabelClass} ${labelClass} absolute bottom-0 ml-3 ${focusClass}`}
</RenderIf>
<RenderIf
condition={name !== "phone" &&
fieldName->String.length > 0 &&
config.appearance.labels == Above &&
isSpacedInnerLayout}>
<div
className={`Label ${labelClass}`}
style={
fontWeight: themeObj.fontWeightNormal,
fontSize: themeObj.fontSizeLg,
marginBottom: "5px",
opacity: "0.6",
}>
{React.string(fieldName)}
</div>
</RenderIf>
<div className="flex flex-row w-full" style={direction: direction}>
<div className="relative w-full">
<input
style={
marginBottom: {
inputFocused || value.value->String.length > 0 ? "" : themeObj.spacingUnit
},
fontSize: {
inputFocused || value.value->String.length > 0 ? themeObj.fontSizeXs : ""
},
opacity: "0.6",
}>
{React.string(fieldName)}
</div>
</RenderIf>
background: backgroundClass,
padding: themeObj.spacingUnit,
width: "100%",
}
disabled=readOnly
ref={inputRef->ReactDOM.Ref.domRef}
type_
name
?maxLength
?pattern
className={`${inputClassStyles} ${inputClass} ${className} focus:outline-none transition-shadow ease-out duration-200`}
placeholder={config.appearance.labels == Above || config.appearance.labels == Never
? placeholder
: ""}
value={value.value}
autoComplete="on"
onChange
onBlur=handleBlur
onFocus=handleFocus
/>
<RenderIf condition={config.appearance.labels == Floating}>
<div
className={`Label ${floatinglabelClass} ${labelClass} absolute bottom-0 ml-3 ${focusClass}`}
style={
marginBottom: {
inputFocused || value.value->String.length > 0 ? "" : themeObj.spacingUnit
},
fontSize: {
inputFocused || value.value->String.length > 0 ? themeObj.fontSizeXs : ""
},
opacity: "0.6",
}>
{React.string(fieldName)}
</div>
</RenderIf>
</div>
<div className={`relative flex -ml-10 items-center`}> {rightIcon} </div>
</div>
<div className={`relative flex -ml-10 items-center`}> {rightIcon} </div>
<RenderIf condition={value.errorString->String.length > 0}>
<div
className="Error pt-1"
style={
color: themeObj.colorDangerText,
fontSize: themeObj.fontSizeSm,
alignSelf: "start",
textAlign: "left",
}>
{React.string(value.errorString)}
</div>
</RenderIf>
</div>
<RenderIf condition={value.errorString->String.length > 0}>
<div
className="Error pt-1"
style={
color: themeObj.colorDangerText,
fontSize: themeObj.fontSizeSm,
alignSelf: "start",
textAlign: "left",
}>
{React.string(value.errorString)}
</div>
</RenderIf>
</div>
}
2 changes: 1 addition & 1 deletion src/Components/PhoneNumberPaymentInput.res
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ let make = () => {
type_="tel"
name="phone"
inputRef=phoneRef
placeholder="+351 200 000 000"
placeholder="000 000 000"
maxLength=14
dropDownOptions=phoneNumberCodeOptions
valueDropDown
Expand Down
4 changes: 3 additions & 1 deletion src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ let make = (
<SaveDetailsCheckbox isChecked=isSaveCardsChecked setIsChecked=setIsSaveCardsChecked />
</div>
</RenderIf>
<RenderIf condition={paymentMethodListValue.payment_type === SETUP_MANDATE}>
<RenderIf
condition={displaySavedPaymentMethodsCheckbox &&
paymentMethodListValue.payment_type === SETUP_MANDATE}>
<div
className="opacity-50 text-xs mb-2 text-left"
style={
Expand Down
1 change: 0 additions & 1 deletion src/Payments/Boleto.res
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ let make = (~paymentType: CardThemeType.mode) => {
~iframeId,
(),
)
()
} else {
postFailedSubmitResponse(~errortype="validation_error", ~message="Please enter all fields")
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ let make = (
<RenderIf condition={showFields || isBancontact}>
<Surcharge paymentMethod paymentMethodType cardBrand={cardBrand->CardUtils.getCardType} />
</RenderIf>
<RenderIf condition={!isBancontact}>
<RenderIf condition={displaySavedPaymentMethodsCheckbox && !isBancontact}>
{switch (
paymentMethodListValue.mandate_payment,
options.terms.card,
Expand Down
8 changes: 2 additions & 6 deletions src/Payments/KlarnaSDK.res
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ let make = (~sessionObj: SessionsType.token) => {

let handleCloseLoader = () => {
Utils.handlePostMessage([("fullscreen", false->JSON.Encode.bool)])
Utils.postFailedSubmitResponse(
~errortype="confirm_payment_failed",
~message="An unknown error has occurred",
)
}

let submitCallback = (ev: Window.event) => {
let submitCallback = React.useCallback((ev: Window.event) => {
let json = ev.data->JSON.parseExn
let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper

Expand All @@ -65,7 +61,7 @@ let make = (~sessionObj: SessionsType.token) => {
},
)
}
}
}, [status])
useSubmitPaymentData(submitCallback)

React.useEffect(() => {
Expand Down
Loading

0 comments on commit 897e6d6

Please sign in to comment.