diff --git a/CHANGELOG.md b/CHANGELOG.md
index 663736ce..c12e5360 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,21 @@
+# [0.105.0](https://github.com/juspay/hyperswitch-web/compare/v0.104.6...v0.105.0) (2024-12-04)
+
+
+### Features
+
+* add traditional chinese locale ([#822](https://github.com/juspay/hyperswitch-web/issues/822)) ([2707923](https://github.com/juspay/hyperswitch-web/commit/27079236edef9bdd776753b67a70c474a794dd72))
+
+## [0.104.6](https://github.com/juspay/hyperswitch-web/compare/v0.104.5...v0.104.6) (2024-12-04)
+
+## [0.104.5](https://github.com/juspay/hyperswitch-web/compare/v0.104.4...v0.104.5) (2024-12-03)
+
+## [0.104.4](https://github.com/juspay/hyperswitch-web/compare/v0.104.3...v0.104.4) (2024-12-03)
+
+
+### Bug Fixes
+
+* show card form by default rendering issue ([#817](https://github.com/juspay/hyperswitch-web/issues/817)) ([00e8562](https://github.com/juspay/hyperswitch-web/commit/00e8562b97c20ed02dc86eaf139ffafb822be075))
+
## [0.104.3](https://github.com/juspay/hyperswitch-web/compare/v0.104.2...v0.104.3) (2024-12-02)
## [0.104.2](https://github.com/juspay/hyperswitch-web/compare/v0.104.1...v0.104.2) (2024-12-02)
diff --git a/package-lock.json b/package-lock.json
index cb3adc20..547f466c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "orca-payment-page",
- "version": "0.104.3",
+ "version": "0.105.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "orca-payment-page",
- "version": "0.104.3",
+ "version": "0.105.0",
"hasInstallScript": true,
"dependencies": {
"@glennsl/rescript-fetch": "^0.2.0",
diff --git a/package.json b/package.json
index 5fddcd17..91eff38d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "orca-payment-page",
- "version": "0.104.3",
+ "version": "0.105.0",
"main": "index.js",
"private": true,
"dependencies": {
diff --git a/src/LocaleStrings/ChineseLocale.res b/src/LocaleStrings/ChineseLocale.res
index 4115df3f..31d1471e 100644
--- a/src/LocaleStrings/ChineseLocale.res
+++ b/src/LocaleStrings/ChineseLocale.res
@@ -1,7 +1,7 @@
let localeStrings: LocaleStringTypes.localeStrings = {
locale: `zh`,
localeDirection: `ltr`,
- cardNumberLabel: `卡号`,
+ cardNumberLabel: `卡號`,
inValidCardErrorText: `卡号无效。`,
inCompleteCVCErrorText: `您的卡片安全码不完整。`,
inCompleteExpiryErrorText: `您的卡片到期日期不完整。`,
diff --git a/src/LocaleStrings/LocaleStringHelper.res b/src/LocaleStrings/LocaleStringHelper.res
index 7b63c205..002f81db 100644
--- a/src/LocaleStrings/LocaleStringHelper.res
+++ b/src/LocaleStrings/LocaleStringHelper.res
@@ -17,6 +17,7 @@ let mapLocalStringToTypeLocale = val => {
| "sv" => SV
| "ru" => RU
| "zh" => ZH
+ | "zh-Hant" => ZH_HANT
| "en"
| _ =>
EN
diff --git a/src/LocaleStrings/LocaleStringTypes.res b/src/LocaleStrings/LocaleStringTypes.res
index 3f605a15..ce484063 100644
--- a/src/LocaleStrings/LocaleStringTypes.res
+++ b/src/LocaleStrings/LocaleStringTypes.res
@@ -1,5 +1,5 @@
type locale =
- EN | HE | FR | EN_GB | AR | JA | DE | FR_BE | ES | CA | PT | IT | PL | NL | SV | RU | ZH
+ EN | HE | FR | EN_GB | AR | JA | DE | FR_BE | ES | CA | PT | IT | PL | NL | SV | RU | ZH | ZH_HANT
type localeStrings = {
locale: string,
diff --git a/src/LocaleStrings/TraditionalChineseLocale.res b/src/LocaleStrings/TraditionalChineseLocale.res
new file mode 100644
index 00000000..ce153915
--- /dev/null
+++ b/src/LocaleStrings/TraditionalChineseLocale.res
@@ -0,0 +1,154 @@
+let localeStrings: LocaleStringTypes.localeStrings = {
+ locale: `zh-HANT`,
+ localeDirection: `ltr`,
+ cardNumberLabel: "卡號",
+ inValidCardErrorText: "卡號無效。",
+ inCompleteCVCErrorText: "您的卡片安全碼不完整。",
+ inCompleteExpiryErrorText: "您的卡片到期日期不完整。",
+ enterValidCardNumberErrorText: "請輸入有效的卡號。",
+ pastExpiryErrorText: "您的卡片到期年份已過期。",
+ poweredBy: "技術支持:Hyperswitch",
+ validThruText: "有效期限",
+ sortCodeText: "排序碼",
+ cvcTextLabel: "安全碼",
+ line1Label: "地址第一行",
+ line1Placeholder: "街道地址",
+ line1EmptyText: "地址第一行不能為空",
+ line2Label: "地址第二行",
+ line2Placeholder: "公寓、單元號等(可選)",
+ line2EmptyText: "地址第二行不能為空",
+ cityLabel: "城市",
+ cityEmptyText: "城市不能為空",
+ postalCodeLabel: "郵遞區號",
+ postalCodeEmptyText: "郵遞區號不能為空",
+ postalCodeInvalidText: "無效的郵遞區號",
+ stateLabel: "州/省",
+ stateEmptyText: "州/省不能為空",
+ accountNumberText: "帳戶號碼",
+ emailLabel: "電子郵件",
+ ibanEmptyText: "IBAN不能為空",
+ emailEmptyText: "電子郵件不能為空",
+ emailInvalidText: "無效的電子郵件地址",
+ fullNameLabel: "全名",
+ fullNamePlaceholder: "名字和姓氏",
+ countryLabel: "國家",
+ currencyLabel: "貨幣",
+ bankLabel: "選擇銀行",
+ redirectText: "提交訂單後,您將被重定向以安全完成購買。",
+ bankDetailsText: "提交這些詳細信息後,您將獲得銀行帳戶信息以進行付款。請確保記下這些信息。",
+ orPayUsing: "或使用以下方式付款",
+ addNewCard: "添加信用卡/借記卡",
+ useExisitingSavedCards: "使用已保存的信用卡/借記卡",
+ saveCardDetails: "保存卡片詳細信息",
+ addBankAccount: "添加銀行帳戶",
+ achBankDebitTerms: _ =>
+ `您的ACH借記授權現在將被設置,我們會在未來扣款前確認金額並通知您。`,
+ sepaDebitTerms: str =>
+ `通過提供您的付款信息並確認此授權書,您授權(A)${str}、債權人和/或我們的支付服務提供商向您的銀行發出指令以扣取您的帳戶資金,(B)您的銀行根據${str}的指令扣取您的帳戶資金。作為您的權利的一部分,根據您與銀行的協議條款,您有權向銀行申請退款。退款必須在帳戶扣款日起的8週內申請。您的權利在您可以從銀行獲得的聲明中進行了解釋。`,
+ becsDebitTerms: `通過提供您的銀行帳戶詳細信息並確認此付款,您同意此直接借記請求和直接借記請求服務協議,並授權Hyperswitch Payments Australia Pty Ltd ACN 160 180 343,直接借記用戶ID號507156(“Hyperswitch”)通過批量電子清算系統(BECS)代表Hyperswitch Payment Widget(“商戶”)從您的帳戶中扣款,金額由商戶另行通知您。您保證您是上述帳戶的持有人或授權簽署人。`,
+ cardTerms: str =>
+ `通過提供您的卡片信息,您允許${str}根據其條款從您的卡片中扣款以進行未來的付款。`,
+ payNowButton: "立即付款",
+ cardNumberEmptyText: "卡號不能為空",
+ cardExpiryDateEmptyText: "卡片到期日期不能為空",
+ cvcNumberEmptyText: "安全碼不能為空",
+ enterFieldsText: "請填寫所有欄位",
+ enterValidDetailsText: "請輸入有效的詳細信息",
+ selectPaymentMethodText: "請選擇一種付款方式並重試",
+ card: "卡片",
+ surchargeMsgAmount: (currency, str) => <>
+ {React.string(`此交易將收取附加費${Utils.nbsp}`)}
+ {React.string(`${currency} ${str}`)}
+ {React.string(`${Utils.nbsp}的金額`)}
+ >,
+ surchargeMsgAmountForCard: (currency, str) => <>
+ {React.string(`此交易將收取最高附加費${Utils.nbsp}`)}
+ {React.string(`${currency} ${str}`)}
+ {React.string(`${Utils.nbsp}的金額`)}
+ >,
+ surchargeMsgAmountForOneClickWallets: "適用額外費用",
+ billingNameLabel: "帳單姓名",
+ billingNamePlaceholder: "名字和姓氏",
+ cardHolderName: "持卡人姓名",
+ on: "於",
+ \"and": "及",
+ nameEmptyText: str => `請提供您的${str}`,
+ completeNameEmptyText: str => `請提供您的完整${str}`,
+ billingDetailsText: "帳單詳細信息",
+ socialSecurityNumberLabel: "社會安全號碼",
+ saveWalletDetails: "選擇後,錢包詳細信息將被保存",
+ morePaymentMethods: "更多付款方式",
+ useExistingPaymentMethods: "使用已保存的付款方式",
+ cardNickname: "卡片暱稱",
+ nicknamePlaceholder: "卡片暱稱(可選)",
+ cardExpiredText: "此卡已過期",
+ cardHeader: "卡片信息",
+ cardBrandConfiguredErrorText: str => `${str} 暫時不支援。`,
+ currencyNetwork: "貨幣網絡",
+ expiryPlaceholder: "月 / 年",
+ dateOfBirth: "出生日期",
+ vpaIdLabel: "虛擬支付地址(VPA)",
+ vpaIdEmptyText: "虛擬支付地址不能為空",
+ vpaIdInvalidText: "無效的虛擬支付地址",
+ dateofBirthRequiredText: "必須提供出生日期",
+ dateOfBirthInvalidText: "年齡應大於或等於 18 歲",
+ dateOfBirthPlaceholderText: "輸入出生日期",
+ formFundsInfoText: "資金將存入此帳戶",
+ formFundsCreditInfoText: pmLabel => `您的資金將存入選定的 ${pmLabel}。`,
+ formEditText: "編輯",
+ formSaveText: "保存",
+ formSubmitText: "提交",
+ formSubmittingText: "提交中",
+ formSubheaderBillingDetailsText: "輸入您的帳單地址",
+ formSubheaderCardText: "您的卡片詳細信息",
+ formSubheaderAccountText: pmLabel => `您的 ${pmLabel}`,
+ formHeaderReviewText: "審核",
+ formHeaderReviewTabLayoutText: pmLabel => `審核您的 ${pmLabel} 詳細信息`,
+ formHeaderBankText: bankTransferType => `輸入 ${bankTransferType} 銀行詳細信息`,
+ formHeaderWalletText: walletTransferType => `輸入${walletTransferType}錢包詳細信息`,
+ formHeaderEnterCardText: "輸入卡信息",
+ formHeaderSelectBankText: "選擇一種銀行方法",
+ formHeaderSelectWalletText: "選擇一個錢包",
+ formHeaderSelectAccountText: "選擇一個帳戶進行付款",
+ formFieldACHRoutingNumberLabel: "路由號碼",
+ formFieldSepaIbanLabel: "國際銀行帳戶號碼 (IBAN)",
+ formFieldSepaBicLabel: "銀行識別碼 (可選)",
+ formFieldPixIdLabel: "Pix ID",
+ formFieldBankAccountNumberLabel: "銀行帳戶號碼",
+ formFieldPhoneNumberLabel: "電話號碼",
+ formFieldCountryCodeLabel: "國家代碼 (可選)",
+ formFieldBankNameLabel: "銀行名稱 (可選)",
+ formFieldBankCityLabel: "銀行城市 (可選)",
+ formFieldCardHoldernamePlaceholder: "您的姓名",
+ formFieldBankNamePlaceholder: "銀行名稱",
+ formFieldBankCityPlaceholder: "銀行城市",
+ formFieldEmailPlaceholder: "您的電子郵件",
+ formFieldPhoneNumberPlaceholder: "您的電話",
+ formFieldInvalidRoutingNumber: "路由號碼無效。",
+ infoCardRefId: `參考編號`,
+ infoCardErrCode: `錯誤代碼`,
+ infoCardErrMsg: `錯誤訊息`,
+ infoCardErrReason: `原因`,
+ linkRedirectionText: seconds => `在 ${seconds->Int.toString} 秒後重新導向 ...`,
+ linkExpiryInfo: expiry => `鏈接將於 ${expiry} 到期`,
+ payoutFromText: merchant => `來自 ${merchant} 的付款`,
+ payoutStatusFailedMessage: `處理您的付款失敗。請聯絡您的服務提供商了解更多詳情。`,
+ payoutStatusPendingMessage: `您的付款應在 2-3 個工作日內處理。`,
+ payoutStatusSuccessMessage: `您的付款成功。資金已存入您選擇的付款方式。`,
+ payoutStatusFailedText: `付款失敗`,
+ payoutStatusPendingText: `付款處理中`,
+ payoutStatusSuccessText: `付款成功`,
+ pixCNPJInvalidText: `無效的 Pix CNPJ`,
+ pixCNPJEmptyText: `Pix CNPJ 不能為空`,
+ pixCNPJLabel: `Pix CNPJ`,
+ pixCNPJPlaceholder: `輸入 Pix CNPJ`,
+ pixCPFInvalidText: `無效的 Pix CPF`,
+ pixCPFEmptyText: `Pix CPF 不能為空`,
+ pixCPFLabel: `Pix CPF`,
+ pixCPFPlaceholder: `輸入 Pix CPF`,
+ pixKeyEmptyText: `Pix 金鑰不能為空`,
+ pixKeyPlaceholder: `輸入 Pix 金鑰`,
+ pixKeyLabel: `Pix 金鑰`,
+ invalidCardHolderNameError: `持卡人姓名不能包含數字`,
+ invalidNickNameError: `暱稱不能包含超過兩個數字`,
+}
diff --git a/src/Payment.res b/src/Payment.res
index e10c1b30..19028b56 100644
--- a/src/Payment.res
+++ b/src/Payment.res
@@ -11,14 +11,13 @@ let setUserError = message => {
@react.component
let make = (~paymentMode, ~integrateError, ~logger) => {
let {localeString} = Recoil.useRecoilValueFromAtom(configAtom)
- let keys = Recoil.useRecoilValueFromAtom(keys)
+ let {iframeId} = Recoil.useRecoilValueFromAtom(keys)
let cardScheme = Recoil.useRecoilValueFromAtom(cardBrand)
let showFields = Recoil.useRecoilValueFromAtom(showCardFieldsAtom)
let selectedOption = Recoil.useRecoilValueFromAtom(selectedOptionAtom)
let isManualRetryEnabled = Recoil.useRecoilValueFromAtom(isManualRetryEnabled)
let paymentToken = Recoil.useRecoilValueFromAtom(paymentTokenAtom)
let paymentMethodListValue = Recoil.useRecoilValueFromAtom(PaymentUtils.paymentMethodListValue)
- let {iframeId} = keys
let (cardNumber, setCardNumber) = React.useState(_ => "")
let (cardExpiry, setCardExpiry) = React.useState(_ => "")
diff --git a/src/PaymentElement.res b/src/PaymentElement.res
index d5fd4364..e97420f6 100644
--- a/src/PaymentElement.res
+++ b/src/PaymentElement.res
@@ -168,9 +168,12 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod
| Loaded(paymentlist) =>
let plist = paymentlist->getDictFromJson->PaymentMethodsRecord.itemToObjMapper
- setPaymentOptions(_ => {
- paymentOptionsList
- })
+ setPaymentOptions(_ =>
+ [
+ ...showCardFormByDefault && checkPriorityList(paymentMethodOrder) ? ["card"] : [],
+ ...paymentOptionsList,
+ ]->removeDuplicate
+ )
setWalletOptions(_ => walletList)
setPaymentMethodListValue(_ => plist)
showCardFormByDefault
@@ -199,7 +202,7 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod
| _ => ()
}
None
- }, (paymentMethodList, walletList, paymentOptionsList, actualList))
+ }, (paymentMethodList, walletList, paymentOptionsList, actualList, showCardFormByDefault))
React.useEffect(() => {
switch sessionsObj {
| Loaded(ssn) => setSessions(_ => ssn)
@@ -275,7 +278,13 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod
}
)
None
- }, (layoutClass.defaultCollapsed, paymentOptions, paymentMethodList, selectedOption))
+ }, (
+ layoutClass.defaultCollapsed,
+ paymentOptions,
+ paymentMethodList,
+ selectedOption,
+ showCardFormByDefault,
+ ))
let checkRenderOrComp = () => {
walletOptions->Array.includes("paypal") || isShowOrPayUsing
}
diff --git a/src/Payments/PazeButton.res b/src/Payments/PazeButton.res
index 586e0993..4ffdfa63 100644
--- a/src/Payments/PazeButton.res
+++ b/src/Payments/PazeButton.res
@@ -50,6 +50,11 @@ let make = (~token: SessionsType.token) => {
let dict = json->Utils.getDictFromJson->getDictFromDict("data")
if dict->getBool("isPaze", false) {
setShowLoader(_ => false)
+ messageParentWindow([
+ ("fullscreen", true->JSON.Encode.bool),
+ ("param", "paymentloader"->JSON.Encode.string),
+ ("iframeId", iframeId->JSON.Encode.string),
+ ])
if dict->getOptionString("completeResponse")->Option.isSome {
let completeResponse = dict->getString("completeResponse", "")
intent(
diff --git a/src/Payments/SamsungPayComponent.res b/src/Payments/SamsungPayComponent.res
index 0110f52b..9ea37579 100644
--- a/src/Payments/SamsungPayComponent.res
+++ b/src/Payments/SamsungPayComponent.res
@@ -24,7 +24,7 @@ let make = (~sessionObj: option, ~walletOptions) => {
let getSamsungPaymentsClient = _ =>
SamsungPayType.samsung({
- environment: publishableKey->String.startsWith("pk_prd_") ? "PRODUCTION" : "STAGE",
+ environment: "PRODUCTION",
})
let onSamsungPaymentButtonClick = _ => {
diff --git a/src/Utilities/PaymentUtils.res b/src/Utilities/PaymentUtils.res
index ed289517..cb1c91bf 100644
--- a/src/Utilities/PaymentUtils.res
+++ b/src/Utilities/PaymentUtils.res
@@ -453,6 +453,7 @@ let useGetPaymentMethodList = (~paymentOptions, ~paymentType, ~sessions) => {
areAllGooglePayRequiredFieldsPrefilled,
isApplePayReady,
isGooglePayReady,
+ showCardFormByDefault,
))
}
diff --git a/src/hyper-loader/Elements.res b/src/hyper-loader/Elements.res
index 8650fc59..979ca821 100644
--- a/src/hyper-loader/Elements.res
+++ b/src/hyper-loader/Elements.res
@@ -1166,9 +1166,7 @@ let make = (
try {
let samsungPayClient = SamsungPayType.samsung({
- environment: publishableKey->String.startsWith("pk_prd_")
- ? "PRODUCTION"
- : "STAGE",
+ environment: "PRODUCTION",
})
samsungPayClient.isReadyToPay(payRequest)
->then(res => {