Skip to content

Commit

Permalink
Merge branch 'main' into fix/bank_name_ideal
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-c-k authored Mar 13, 2024
2 parents e24bd71 + 806f904 commit cb3dd19
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 83 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [0.33.0](https://github.com/juspay/hyperswitch-web/compare/v0.32.0...v0.33.0) (2024-03-13)


### Features

* added prop for PaymentHeader Text ([#226](https://github.com/juspay/hyperswitch-web/issues/226)) ([8ff8933](https://github.com/juspay/hyperswitch-web/commit/8ff89334c662bb37bdff112b693a0f72d7194017))

# [0.32.0](https://github.com/juspay/hyperswitch-web/compare/v0.31.6...v0.32.0) (2024-03-13)


Expand Down
179 changes: 121 additions & 58 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.32.0",
"version": "0.33.0",
"main": "index.js",
"private": true,
"dependencies": {
Expand Down
18 changes: 0 additions & 18 deletions src/LocaleString.res
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ type localeStrings = {
saveWalletDetails: string,
morePaymentMethods: string,
useExistingPaymentMethods: string,
selectPaymentMethodLabel: string,
savedPaymentMethodsLabel: string,
nicknameLabel: string,
nicknamePlaceholder: string,
}
Expand Down Expand Up @@ -149,8 +147,6 @@ let defaultLocale = {
saveWalletDetails: "Wallets details will be saved upon selection",
morePaymentMethods: "More payment methods",
useExistingPaymentMethods: "Use saved payment methods",
selectPaymentMethodLabel: "Select Payment Method",
savedPaymentMethodsLabel: "Saved Payment Methods",
nicknameLabel: "Card Nickname",
nicknamePlaceholder: "Card Nickname (Optional)",
}
Expand Down Expand Up @@ -235,8 +231,6 @@ let localeStrings = [
saveWalletDetails: "Wallets details will be saved upon selection",
morePaymentMethods: "More payment methods",
useExistingPaymentMethods: "Use saved payment methods",
selectPaymentMethodLabel: "Select Payment Method",
savedPaymentMethodsLabel: "Saved Payment Methods",
nicknameLabel: "Card Nickname",
nicknamePlaceholder: "Card Nickname (Optional)",
},
Expand Down Expand Up @@ -318,8 +312,6 @@ let localeStrings = [
saveWalletDetails: "פרטי הארנק יישמרו בעת בחירה",
morePaymentMethods: `אמצעי תשלום נוספים`,
useExistingPaymentMethods: `השתמש באמצעי תשלום שמורים`,
selectPaymentMethodLabel: `בחר שיטת תשלום`,
savedPaymentMethodsLabel: `אמצעי תשלום שמורים`,
nicknameLabel: `כינוי לכרטיס`,
nicknamePlaceholder: `כינוי לכרטיס (אופציונלי)`,
},
Expand Down Expand Up @@ -401,8 +393,6 @@ let localeStrings = [
saveWalletDetails: "Les détails du portefeuille seront enregistrés lors de la sélection",
morePaymentMethods: `Plus de méthodes de paiement`,
useExistingPaymentMethods: `Utiliser les modes de paiement enregistrés`,
selectPaymentMethodLabel: `Sélectionnez le mode de paiement`,
savedPaymentMethodsLabel: `Modes de paiement enregistrés`,
nicknameLabel: `Pseudonyme de la carte`,
nicknamePlaceholder: `Surnom de la carte (facultatif)`,
},
Expand Down Expand Up @@ -484,8 +474,6 @@ let localeStrings = [
saveWalletDetails: "Wallets details will be saved upon selection",
morePaymentMethods: "More payment methods",
useExistingPaymentMethods: "Use saved payment methods",
selectPaymentMethodLabel: "Select Payment Method",
savedPaymentMethodsLabel: "Saved Payment Methods",
nicknameLabel: "Card Nickname",
nicknamePlaceholder: "Card Nickname (Optional)",
},
Expand Down Expand Up @@ -567,8 +555,6 @@ let localeStrings = [
saveWalletDetails: "سيتم حفظ تفاصيل المحفظة عند الاختيار",
morePaymentMethods: `المزيد من طرق الدفع`,
useExistingPaymentMethods: `استخدم طرق الدفع المحفوظة`,
selectPaymentMethodLabel: `اختار طريقة الدفع`,
savedPaymentMethodsLabel: `طرق الدفع المحفوظة`,
nicknameLabel: `الاسم علي الكارت`,
nicknamePlaceholder: `اسم البطاقة (اختياري)`,
},
Expand Down Expand Up @@ -650,8 +636,6 @@ let localeStrings = [
saveWalletDetails: "選択時にウォレットの詳細が保存されます",
morePaymentMethods: `その他の支払い方法`,
useExistingPaymentMethods: `保存した支払い方法を使用する`,
selectPaymentMethodLabel: `支払い方法を選択してください`,
savedPaymentMethodsLabel: `保存された支払い方法`,
nicknameLabel: `カードのニックネーム`,
nicknamePlaceholder: `カードニックネーム(任意)`,
},
Expand Down Expand Up @@ -733,8 +717,6 @@ let localeStrings = [
saveWalletDetails: "Wallet-Details werden beim Auswählen gespeichert",
morePaymentMethods: `Mehr Zahlungsmethoden`,
useExistingPaymentMethods: `Gespeicherte Zahlungsarten nutzen`,
selectPaymentMethodLabel: `Wählen Sie die Zahlungsmethode`,
savedPaymentMethodsLabel: `Gespeicherte Zahlungsarten`,
nicknameLabel: `Spitzname der Karte`,
nicknamePlaceholder: `Kartenname (optional)`,
},
Expand Down
14 changes: 10 additions & 4 deletions src/PaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ let make = (
~countryProps,
~paymentType: CardThemeType.mode,
) => {
let {localeString} = Recoil.useRecoilValueFromAtom(RecoilAtoms.configAtom)
let sessionsObj = Recoil.useRecoilValueFromAtom(sessions)
let {
showCardFormByDefault,
Expand All @@ -23,6 +22,7 @@ let make = (
customerPaymentMethods,
displaySavedPaymentMethods,
} = Recoil.useRecoilValueFromAtom(optionAtom)
let optionAtomValue = Recoil.useRecoilValueFromAtom(optionAtom)
let isApplePayReady = Recoil.useRecoilValueFromAtom(isApplePayReady)
let isGooglePayReady = Recoil.useRecoilValueFromAtom(isGooglePayReady)
let methodslist = Recoil.useRecoilValueFromAtom(list)
Expand Down Expand Up @@ -396,13 +396,19 @@ let make = (
}, [displaySavedPaymentMethods])

let paymentLabel = if displaySavedPaymentMethods {
showFields ? localeString.selectPaymentMethodLabel : localeString.savedPaymentMethodsLabel
showFields
? optionAtomValue.paymentMethodsHeaderText
: optionAtomValue.savedPaymentMethodsHeaderText
} else {
localeString.selectPaymentMethodLabel
optionAtomValue.paymentMethodsHeaderText
}

<>
<div className="text-2xl font-semibold text-[#151619] mb-6"> {React.string(paymentLabel)} </div>
<RenderIf condition={paymentLabel->Option.isSome}>
<div className="text-2xl font-semibold text-[#151619] mb-6">
{paymentLabel->Option.getOr("")->React.string}
</div>
</RenderIf>
<RenderIf condition={!showFields && displaySavedPaymentMethods}>
<SavedMethods
paymentToken setPaymentToken savedMethods loadSavedCards cvcProps paymentType list
Expand Down
4 changes: 2 additions & 2 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ let make = (
~isCvcValidValue,
)

let isCustomerAcceptanceRequired = React.useMemo1(() => {
let isCustomerAcceptanceRequired = React.useMemo2(() => {
if displaySavedPaymentMethodsCheckbox {
isSaveCardsChecked || list.payment_type === SETUP_MANDATE
} else {
!(isGuestCustomer || list.payment_type === NORMAL)
}
}, [isSaveCardsChecked])
}, (isSaveCardsChecked, list.payment_type))

let submitCallback = React.useCallback6((ev: Window.event) => {
let json = ev.data->Js.Json.parseExn
Expand Down
Loading

0 comments on commit cb3dd19

Please sign in to comment.