@paykka/card-checkout-ui 0.13.2 → 0.13.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/card-checkout-ui.js +20 -20
  2. package/dist/card-checkout-ui.umd.cjs +19 -19
  3. package/dist/es/_commonjsHelpers.js +1 -1
  4. package/dist/es/api/http.js +1 -0
  5. package/dist/es/api/modules/opay-wallet/index.js +16 -0
  6. package/dist/es/api/modules/paga-wallet/index.js +16 -0
  7. package/dist/es/api/modules/pic-pay/index.js +16 -0
  8. package/dist/es/api/modules/pix/index.js +16 -0
  9. package/dist/es/api/modules/risk/index.js +21 -0
  10. package/dist/es/api/modules/vietqr/index.js +4 -0
  11. package/dist/es/components/AccordionItem/AccordionItem.js +1 -0
  12. package/dist/es/components/AccountNameField/index.js +1 -0
  13. package/dist/es/components/AddressField/index.js +1 -0
  14. package/dist/es/components/AliPay/index.js +1 -0
  15. package/dist/es/components/ApplePay/index.js +1 -0
  16. package/dist/es/components/Boost/index.js +1 -0
  17. package/dist/es/components/Card/index.js +1 -0
  18. package/dist/es/components/CardBrands/index.js +1 -0
  19. package/dist/es/components/CardExpireDateField/index.js +1 -0
  20. package/dist/es/components/CardHolderNameField/index.js +1 -0
  21. package/dist/es/components/CardIBANField/index.js +1 -0
  22. package/dist/es/components/CardNo/index.js +1 -0
  23. package/dist/es/components/CardNumberField/index.js +1 -0
  24. package/dist/es/components/CardSecurityCodeField/index.js +1 -0
  25. package/dist/es/components/CardSelector/index.js +1 -0
  26. package/dist/es/components/CombinedCardInfo/index.js +1 -0
  27. package/dist/es/components/DropIn/index.js +43 -2
  28. package/dist/es/components/EmailField/EmailField.js +1 -0
  29. package/dist/es/components/EncryptedCard/index.js +1 -0
  30. package/dist/es/components/GooglePay/index.js +1 -0
  31. package/dist/es/components/GrabPay/index.js +1 -0
  32. package/dist/es/components/GuideCard/index.js +7 -1
  33. package/dist/es/components/LinePay/index.js +1 -0
  34. package/dist/es/components/MayBankQRPay/index.js +1 -0
  35. package/dist/es/components/NinePay/index.js +1 -0
  36. package/dist/es/components/RecurringTip/index.js +1 -0
  37. package/dist/es/components/Sepa/index.js +1 -0
  38. package/dist/es/components/ShopeePay/index.js +1 -0
  39. package/dist/es/components/SubmitButton/index.js +1 -0
  40. package/dist/es/components/TNGWallet/index.js +1 -0
  41. package/dist/es/components/ThreeDS/index.js +2 -1
  42. package/dist/es/components/WechatPay/index.js +1 -0
  43. package/dist/es/components/business/QRCodeModal/QRCodeModal.js +7 -6
  44. package/dist/es/components/business/QRCodeModal/index.js +1 -0
  45. package/dist/es/components/business/index.js +1 -0
  46. package/dist/es/components/index.js +6 -0
  47. package/dist/es/components/internal/Accordion/index.js +1 -0
  48. package/dist/es/components/internal/Button/Button.js +1 -0
  49. package/dist/es/components/internal/Button/index.js +1 -0
  50. package/dist/es/components/internal/CheckBox/CheckBox.js +1 -0
  51. package/dist/es/components/internal/CheckBox/index.js +1 -0
  52. package/dist/es/components/internal/Form/type.js +1 -0
  53. package/dist/es/components/internal/Info/Info.js +1 -0
  54. package/dist/es/components/internal/Info/index.js +1 -0
  55. package/dist/es/components/internal/Input/type.js +1 -0
  56. package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +1 -0
  57. package/dist/es/components/internal/LoadingCheck/index.js +1 -0
  58. package/dist/es/components/internal/Modal/Modal.js +1 -0
  59. package/dist/es/components/internal/QRCode/QRCode.js +1 -0
  60. package/dist/es/components/internal/QRCode/index.js +1 -0
  61. package/dist/es/components/internal/Select/Select.js +1 -0
  62. package/dist/es/components/internal/Select/SelectMenu.js +1 -0
  63. package/dist/es/components/internal/Select/SelectMenuItem.js +1 -0
  64. package/dist/es/components/internal/icons/IconOpayWallet.js +71 -0
  65. package/dist/es/components/internal/icons/IconPagaWallet.js +141 -0
  66. package/dist/es/components/internal/icons/IconPaymaya.js +42 -86
  67. package/dist/es/components/internal/icons/IconPicPay.js +49 -0
  68. package/dist/es/components/internal/icons/IconPix.js +75 -0
  69. package/dist/es/components/internal/icons/IconVietqr.js +45 -0
  70. package/dist/es/components/internal/icons/IconVietqrComplete.js +49 -0
  71. package/dist/es/components/wallets/GCash/GCash.js +1 -0
  72. package/dist/es/components/wallets/OpayWallet/OpayWallet.js +347 -0
  73. package/dist/es/components/wallets/OpayWallet/index.js +1 -0
  74. package/dist/es/components/wallets/OpayWallet/opay-wallet.js +1 -0
  75. package/dist/es/components/wallets/OpayWallet/type.js +1 -0
  76. package/dist/es/components/wallets/PagaWallet/PagaWallet.js +347 -0
  77. package/dist/es/components/wallets/PagaWallet/index.js +1 -0
  78. package/dist/es/components/wallets/PagaWallet/paga-wallet.js +1 -0
  79. package/dist/es/components/wallets/PagaWallet/type.js +1 -0
  80. package/dist/es/components/wallets/Paymaya/Paymaya.js +1 -0
  81. package/dist/es/components/wallets/PicPay/PicPay.js +347 -0
  82. package/dist/es/components/wallets/PicPay/index.js +1 -0
  83. package/dist/es/components/wallets/PicPay/pic-pay.js +1 -0
  84. package/dist/es/components/wallets/PicPay/type.js +1 -0
  85. package/dist/es/components/wallets/Pix/Pix.js +347 -0
  86. package/dist/es/components/wallets/Pix/index.js +1 -0
  87. package/dist/es/components/wallets/Pix/pix2.js +1 -0
  88. package/dist/es/components/wallets/Pix/type.js +1 -0
  89. package/dist/es/components/wallets/Vietqr/Vietqr.js +381 -0
  90. package/dist/es/components/wallets/Vietqr/index.js +1 -0
  91. package/dist/es/components/wallets/Vietqr/type.js +1 -0
  92. package/dist/es/components/wallets/Vietqr/vietqr2.js +1 -0
  93. package/dist/es/components/wallets/Zalopay/Zalopay.js +2 -0
  94. package/dist/es/components/wallets/index.js +8 -0
  95. package/dist/es/constant.js +38 -2
  96. package/dist/es/core/checkout.js +4 -3
  97. package/dist/es/core/environment.js +1 -13
  98. package/dist/es/core/index.js +1 -0
  99. package/dist/es/core/theme.js +1 -0
  100. package/dist/es/hooks/index.js +1 -0
  101. package/dist/es/hooks/useI18n.js +1 -0
  102. package/dist/es/hooks/usePayState.js +2 -2
  103. package/dist/es/i18n/locales/de-DE.js +8 -2
  104. package/dist/es/i18n/locales/en-GB.js +8 -2
  105. package/dist/es/i18n/locales/es-ES.js +8 -2
  106. package/dist/es/i18n/locales/fr-FR.js +8 -2
  107. package/dist/es/i18n/locales/ja-JP.js +8 -2
  108. package/dist/es/i18n/locales/ko-KR.js +8 -2
  109. package/dist/es/i18n/locales/nl-NL.js +8 -2
  110. package/dist/es/i18n/locales/pt-PT.js +8 -2
  111. package/dist/es/i18n/locales/ru-RU.js +8 -2
  112. package/dist/es/i18n/locales/zh-CN.js +10 -4
  113. package/dist/es/i18n/locales/zh-HK.js +10 -4
  114. package/dist/es/i18n/locales/zh-TW.js +10 -4
  115. package/dist/es/index.js +12 -1
  116. package/dist/es/out/fraud-detection.js +25 -60
  117. package/dist/es/out/stripe-radar.js +92 -0
  118. package/dist/es/out/worldpay-ddc.js +14 -4
  119. package/dist/es/out/worldpay-jsc-origin.js +61 -0
  120. package/dist/es/out/worldpay-jsc.js +68 -0
  121. package/dist/es/style.css +1 -1
  122. package/dist/es/types/event.js +4 -0
  123. package/dist/es/types/fraud-detection.js +1 -0
  124. package/dist/style.css +1 -1
  125. package/dist/types/api/modules/index.d.ts +5 -0
  126. package/dist/types/api/modules/opay-wallet/index.d.ts +4 -0
  127. package/dist/types/api/modules/paga-wallet/index.d.ts +4 -0
  128. package/dist/types/api/modules/pic-pay/index.d.ts +4 -0
  129. package/dist/types/api/modules/pix/index.d.ts +4 -0
  130. package/dist/types/api/modules/risk/index.d.ts +5 -0
  131. package/dist/types/api/modules/vietqr/index.d.ts +4 -0
  132. package/dist/types/components/DropIn/type.d.ts +3 -2
  133. package/dist/types/components/business/QRCodeModal/type.d.ts +2 -0
  134. package/dist/types/components/index.d.ts +1 -3
  135. package/dist/types/components/internal/icons/IconOpayWallet.d.ts +2 -0
  136. package/dist/types/components/internal/icons/IconPagaWallet.d.ts +2 -0
  137. package/dist/types/components/internal/icons/IconPicPay.d.ts +2 -0
  138. package/dist/types/components/internal/icons/IconPix.d.ts +2 -0
  139. package/dist/types/components/internal/icons/IconVietqr.d.ts +2 -0
  140. package/dist/types/components/internal/icons/IconVietqrComplete.d.ts +2 -0
  141. package/dist/types/components/internal/icons/index.d.ts +6 -0
  142. package/dist/types/components/wallets/OpayWallet/OpayWallet.d.ts +10 -0
  143. package/dist/types/components/wallets/OpayWallet/index.d.ts +2 -0
  144. package/dist/types/components/wallets/OpayWallet/type.d.ts +40 -0
  145. package/dist/types/components/wallets/PagaWallet/PagaWallet.d.ts +10 -0
  146. package/dist/types/components/wallets/PagaWallet/index.d.ts +2 -0
  147. package/dist/types/components/wallets/PagaWallet/type.d.ts +40 -0
  148. package/dist/types/components/wallets/PicPay/PicPay.d.ts +10 -0
  149. package/dist/types/components/wallets/PicPay/index.d.ts +2 -0
  150. package/dist/types/components/wallets/PicPay/type.d.ts +40 -0
  151. package/dist/types/components/wallets/Pix/Pix.d.ts +10 -0
  152. package/dist/types/components/wallets/Pix/index.d.ts +2 -0
  153. package/dist/types/components/wallets/Pix/type.d.ts +40 -0
  154. package/dist/types/components/wallets/Vietqr/Vietqr.d.ts +10 -0
  155. package/dist/types/components/wallets/Vietqr/index.d.ts +2 -0
  156. package/dist/types/components/wallets/Vietqr/type.d.ts +39 -0
  157. package/dist/types/components/wallets/index.d.ts +8 -0
  158. package/dist/types/components/wallets/type.d.ts +9 -0
  159. package/dist/types/constant.d.ts +15 -1
  160. package/dist/types/core/environment.d.ts +1 -2
  161. package/dist/types/hooks/usePayState.d.ts +0 -1
  162. package/dist/types/i18n/locales/de-DE.d.ts +6 -0
  163. package/dist/types/i18n/locales/en-GB.d.ts +6 -0
  164. package/dist/types/i18n/locales/es-ES.d.ts +6 -0
  165. package/dist/types/i18n/locales/fr-FR.d.ts +6 -0
  166. package/dist/types/i18n/locales/ja-JP.d.ts +6 -0
  167. package/dist/types/i18n/locales/ko-KR.d.ts +6 -0
  168. package/dist/types/i18n/locales/nl-NL.d.ts +6 -0
  169. package/dist/types/i18n/locales/pt-PT.d.ts +6 -0
  170. package/dist/types/i18n/locales/ru-RU.d.ts +6 -0
  171. package/dist/types/i18n/locales/zh-CN.d.ts +6 -0
  172. package/dist/types/i18n/locales/zh-HK.d.ts +6 -0
  173. package/dist/types/i18n/locales/zh-TW.d.ts +6 -0
  174. package/dist/types/out/fraud-detection.d.ts +2 -5
  175. package/dist/types/out/stripe-radar.d.ts +21 -0
  176. package/dist/types/out/types.d.ts +2 -4
  177. package/dist/types/out/worldpay-ddc.d.ts +9 -2
  178. package/dist/types/out/worldpay-jsc-origin.d.ts +0 -0
  179. package/dist/types/out/worldpay-jsc.d.ts +38 -0
  180. package/dist/types/types/event.d.ts +28 -1
  181. package/dist/types/types/fraud-detection.d.ts +5 -5
  182. package/dist/types/types/message.d.ts +1 -0
  183. package/package.json +1 -1
@@ -13,8 +13,13 @@ const frFR = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "Numéro de carte",
20
25
  "card.cardNumber.incomplete": "Votre numéro de carte est incomplet",
@@ -83,7 +88,8 @@ const frFR = {
83
88
  // qrCode
84
89
  "qrCode.expired": "Le code QR a expiré.",
85
90
  "qrCode.scanByGcash": "Scanner le code QR avec GCash",
86
- "qrCode.scanByZalopay": "Scanner le code QR avec Zalopay"
91
+ "qrCode.scanByZalopay": "Scanner le code QR avec Zalopay",
92
+ "qrCode.scanByVietqr": "Scanner le code QR avec VietQR"
87
93
  };
88
94
  export {
89
95
  frFR as default
@@ -13,8 +13,13 @@ const jaJP = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "カード番号",
20
25
  "card.cardNumber.incomplete": "カード番号が不完全です",
@@ -83,7 +88,8 @@ const jaJP = {
83
88
  // qrCode
84
89
  "qrCode.expired": "QRコードが期限切れです。",
85
90
  "qrCode.scanByGcash": "Gcashでスキャン",
86
- "qrCode.scanByZalopay": "Zalopayでスキャン"
91
+ "qrCode.scanByZalopay": "Zalopayでスキャン",
92
+ "qrCode.scanByVietqr": "VietQRでスキャン"
87
93
  };
88
94
  export {
89
95
  jaJP as default
@@ -13,8 +13,13 @@ const koKR = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "카드 번호",
20
25
  "card.cardNumber.incomplete": "카드 번호가 불완전합니다",
@@ -83,7 +88,8 @@ const koKR = {
83
88
  // qrCode
84
89
  "qrCode.expired": "QR 코드가 만료되었습니다.",
85
90
  "qrCode.scanByGcash": "GCash 스캔",
86
- "qrCode.scanByZalopay": "Zalopay 스캔"
91
+ "qrCode.scanByZalopay": "Zalopay 스캔",
92
+ "qrCode.scanByVietqr": "VietQR 스캔"
87
93
  };
88
94
  export {
89
95
  koKR as default
@@ -13,8 +13,13 @@ const nlNL = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "Kaartnummer",
20
25
  "card.cardNumber.incomplete": "Uw kaartnummer is onvolledig",
@@ -83,7 +88,8 @@ const nlNL = {
83
88
  // qrCode
84
89
  "qrCode.expired": "De QR-code is verlopen.",
85
90
  "qrCode.scanByGcash": "Scan QR-code met GCash",
86
- "qrCode.scanByZalopay": "Scan QR-code met Zalopay"
91
+ "qrCode.scanByZalopay": "Scan QR-code met Zalopay",
92
+ "qrCode.scanByVietqr": "Scan QR-code met VietQR"
87
93
  };
88
94
  export {
89
95
  nlNL as default
@@ -13,8 +13,13 @@ const ptPT = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "Número do cartão",
20
25
  "card.cardNumber.incomplete": "O número do seu cartão está incompleto",
@@ -83,7 +88,8 @@ const ptPT = {
83
88
  // qrCode
84
89
  "qrCode.expired": "O código QR expirou.",
85
90
  "qrCode.scanByGcash": "Escaneie o código QR com GCash",
86
- "qrCode.scanByZalopay": "Escaneie o código QR com Zalopay"
91
+ "qrCode.scanByZalopay": "Escaneie o código QR com Zalopay",
92
+ "qrCode.scanByVietqr": "Escaneie o código QR com VietQR"
87
93
  };
88
94
  export {
89
95
  ptPT as default
@@ -13,8 +13,13 @@ const ruRU = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "Номер карты",
20
25
  "card.cardNumber.incomplete": "Ваш номер карты неполный",
@@ -83,7 +88,8 @@ const ruRU = {
83
88
  // qrCode
84
89
  "qrCode.expired": "Срок действия QR-кода истек.",
85
90
  "qrCode.scanByGcash": "Сканируйте QR-кодом с GCash",
86
- "qrCode.scanByZalopay": "Сканируйте QR-кодом с Zalopay"
91
+ "qrCode.scanByZalopay": "Сканируйте QR-кодом с Zalopay",
92
+ "qrCode.scanByVietqr": "Сканируйте QR-кодом с VietQR"
87
93
  };
88
94
  export {
89
95
  ruRU as default
@@ -1,7 +1,7 @@
1
1
  const zhCN = {
2
2
  // guide card
3
3
  "guideCard.redirectDescription": "提交后,您将被跳转到支付方式品牌方的页面,安全地完成后续步骤。",
4
- "guideCard.scanQRCode": "提交订单后,用{method}扫描二维码。",
4
+ "guideCard.scanQRCode": "提交订单后,用 {method} 扫描二维码。",
5
5
  // Drop In
6
6
  "dropIn.card.label": "银行卡",
7
7
  "dropIn.otherPaymentMethod": "其他支付方式",
@@ -13,8 +13,13 @@ const zhCN = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "卡号",
20
25
  "card.cardNumber.incomplete": "您的卡号不完整",
@@ -82,8 +87,9 @@ const zhCN = {
82
87
  "threeDS.returnToCheckout": "即将返回",
83
88
  // qrCode
84
89
  "qrCode.expired": "二维码过期",
85
- "qrCode.scanByGcash": "用Gcash扫码",
86
- "qrCode.scanByZalopay": "用Zalopay扫码"
90
+ "qrCode.scanByGcash": "用 Gcash 扫码",
91
+ "qrCode.scanByZalopay": "用 Zalopay 扫码",
92
+ "qrCode.scanByVietqr": "用 VietQR 扫码"
87
93
  };
88
94
  export {
89
95
  zhCN as default
@@ -1,7 +1,7 @@
1
1
  const zhHK = {
2
2
  // guide card
3
3
  "guideCard.redirectDescription": "提交後,您將被跳轉到支付方式品牌方的頁面,安全地完成後續步驟。",
4
- "guideCard.scanQRCode": "提交訂單後,用{method}掃描二維碼。",
4
+ "guideCard.scanQRCode": "提交訂單後,用 {method} 掃描二維碼。",
5
5
  // Drop In
6
6
  "dropIn.card.label": "銀行卡",
7
7
  "dropIn.otherPaymentMethod": "其他支付方式",
@@ -13,8 +13,13 @@ const zhHK = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "卡號",
20
25
  "card.cardNumber.incomplete": "您的卡號不完整",
@@ -82,8 +87,9 @@ const zhHK = {
82
87
  "threeDS.returnToCheckout": "即將返回",
83
88
  // qrCode
84
89
  "qrCode.expired": "二維碼過期",
85
- "qrCode.scanByGcash": "用Gcash掃碼",
86
- "qrCode.scanByZalopay": "用Zalopay掃碼"
90
+ "qrCode.scanByGcash": "用 Gcash 掃碼",
91
+ "qrCode.scanByZalopay": "用 Zalopay 掃碼",
92
+ "qrCode.scanByVietqr": "用 VietQR 掃碼"
87
93
  };
88
94
  export {
89
95
  zhHK as default
@@ -1,7 +1,7 @@
1
1
  const zhTW = {
2
2
  // guide card
3
3
  "guideCard.redirectDescription": "提交後,您將被跳轉到支付方式品牌方的頁面,安全地完成後續步驟。",
4
- "guideCard.scanQRCode": "提交訂單後,用{method}掃描二維碼。",
4
+ "guideCard.scanQRCode": "提交訂單後,用 {method} 掃描二維碼。",
5
5
  // Drop In
6
6
  "dropIn.card.label": "銀行卡",
7
7
  "dropIn.otherPaymentMethod": "其他支付方式",
@@ -13,8 +13,13 @@ const zhTW = {
13
13
  "dropIn.linePay.label": "LinePay",
14
14
  "dropIn.ninePay.label": "9Pay",
15
15
  "dropIn.gcash.label": "GCash",
16
- "dropIn.paymaya.label": "Paymaya",
16
+ "dropIn.paymaya.label": "Maya",
17
17
  "dropIn.zalopay.label": "Zalopay",
18
+ "dropIn.vietqr.label": "VietQR",
19
+ "dropIn.pix.label": "Pix",
20
+ "dropIn.picPay.label": "PicPay",
21
+ "dropIn.opayWallet.label": "OPay Wallet",
22
+ "dropIn.pagaWallet.label": "Paga Wallet",
18
23
  // card number
19
24
  "card.cardNumber.label": "卡號",
20
25
  "card.cardNumber.incomplete": "您的卡號不完整",
@@ -82,8 +87,9 @@ const zhTW = {
82
87
  "threeDS.returnToCheckout": "即將返回",
83
88
  // qrCode
84
89
  "qrCode.expired": "二維碼過期",
85
- "qrCode.scanByGcash": "用Gcash掃碼",
86
- "qrCode.scanByZalopay": "用Zalopay掃碼"
90
+ "qrCode.scanByGcash": "用 Gcash 掃碼",
91
+ "qrCode.scanByZalopay": "用 Zalopay 掃碼",
92
+ "qrCode.scanByVietqr": "用 VietQR 掃碼"
87
93
  };
88
94
  export {
89
95
  zhTW as default
package/dist/es/index.js CHANGED
@@ -28,6 +28,11 @@ import { ShopeePay } from "./components/ShopeePay/index.js";
28
28
  import { GCash } from "./components/wallets/GCash/GCash.js";
29
29
  import { Paymaya } from "./components/wallets/Paymaya/Paymaya.js";
30
30
  import { Zalopay } from "./components/wallets/Zalopay/Zalopay.js";
31
+ import { Vietqr } from "./components/wallets/Vietqr/Vietqr.js";
32
+ import { Pix } from "./components/wallets/Pix/Pix.js";
33
+ import { PicPay } from "./components/wallets/PicPay/PicPay.js";
34
+ import { PagaWallet } from "./components/wallets/PagaWallet/PagaWallet.js";
35
+ import { OpayWallet } from "./components/wallets/OpayWallet/OpayWallet.js";
31
36
  import "./core/context.js";
32
37
  import { create } from "./core/create.js";
33
38
  import { Session } from "./core/session.js";
@@ -43,9 +48,10 @@ import { redirectToPayment } from "./utils/redirect.js";
43
48
  import "./core.js";
44
49
  import { I18n } from "./i18n/I18n.js";
45
50
  import { LocaleKey } from "./i18n/locales/index.js";
46
- import { FraudDetectionEventType } from "./types/event.js";
47
51
  import { setApiUrl, setCDNUrl, setCustomLocale, setCustomReqHeaders, setFraudDetectionEnv } from "./config.js";
52
+ import { FraudDetectionEventType } from "./types/event.js";
48
53
  import "./api/http.js";
54
+ import "./out/worldpay-jsc-origin.js";
49
55
  import { ECollMode } from "./types/fraud-detection.js";
50
56
  import { MessageAction } from "./types/message.js";
51
57
  export {
@@ -80,18 +86,23 @@ export {
80
86
  MayBankQRPay,
81
87
  MessageAction,
82
88
  NinePay,
89
+ OpayWallet,
90
+ PagaWallet,
83
91
  PayKKaCheckout,
84
92
  PayKKaEncryptedCard,
85
93
  PayKKaError,
86
94
  Paymaya,
87
95
  PaymentComponentMap,
88
96
  PaymentMethod,
97
+ PicPay,
98
+ Pix,
89
99
  SecuredIframe,
90
100
  Sepa,
91
101
  Session,
92
102
  ShopeePay,
93
103
  SubmitButton,
94
104
  TNGWallet,
105
+ Vietqr,
95
106
  WechatPay,
96
107
  Zalopay,
97
108
  create,
@@ -4,15 +4,13 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
+ import { setApiUrl } from "../config.js";
8
+ import { apiEnv } from "../core/environment.js";
7
9
  import { ECollMode } from "../types/fraud-detection.js";
8
10
  import { FraudDetectionEventType } from "../types/event.js";
11
+ import { StripeRadar } from "./stripe-radar.js";
9
12
  import { WorldpayDDC } from "./worldpay-ddc.js";
10
- var define_import_meta_env_default = { VITE_API_URL: "https://checkout.aq.paykka.com", VITE_CDN_ORIGIN: "https://checkout.aq.paykka.com", VITE_CDN_DIR: "/cp", BASE_URL: "/", MODE: "production", DEV: false, PROD: true, SSR: false };
11
- const stripeKeyMap = {
12
- eu: "pk_live_51QSXl2G2tOepMLcRVNu0S2T6MxyB1AIgCP5g7qMQvAviQS37v0wkPhJRKqfcbTql6ZkCkGktux4ixfXuZtFy6ZpP00awbGlLEq",
13
- hk: "pk_live_51QSXh9Azq7GQL5iqwZNLz3KJ896MIUnai4H7H0z9DtlklJkgoH1VAlHKy382vWPqDm80nTy8MKUdJIKs0fFbTlKx006WcKWEDu",
14
- us: define_import_meta_env_default.VITE_STRIPE_KEY
15
- };
13
+ import { WorldpayJSC } from "./worldpay-jsc.js";
16
14
  const DEFAULT_ENV = "eu";
17
15
  let instance = null;
18
16
  function getFraudDetectionInstance(env, mode, options) {
@@ -22,46 +20,34 @@ function getFraudDetectionInstance(env, mode, options) {
22
20
  return instance;
23
21
  }
24
22
  class FraudDetection {
25
- constructor(env = DEFAULT_ENV, mode = [ECollMode.SR, ECollMode.WP], options) {
23
+ constructor(env = DEFAULT_ENV, mode = [ECollMode.SR, ECollMode.WP, ECollMode.WJ], options) {
26
24
  __publicField(this, "options");
27
- __publicField(this, "collResultMap", {
28
- [ECollMode.SR]: "",
29
- [ECollMode.WP]: ""
30
- });
31
25
  __publicField(this, "collMap", {
32
26
  [ECollMode.SR]: () => this.stripeRadarColl(),
33
- [ECollMode.WP]: () => this.worldpayDDCColl()
27
+ [ECollMode.WP]: () => this.worldpayDDCColl(),
28
+ [ECollMode.WJ]: () => this.worldpayJSCColl()
34
29
  });
35
30
  __publicField(this, "p");
36
31
  __publicField(this, "realMode", []);
37
- __publicField(this, "keyMap", {
38
- [ECollMode.SR]: ""
39
- });
32
+ __publicField(this, "env");
40
33
  this.realMode = mode;
41
34
  this.options = options;
42
- if (mode.includes(ECollMode.SR)) {
43
- if (typeof env === "string") {
44
- this.keyMap[ECollMode.SR] = stripeKeyMap[env];
45
- } else {
46
- this.keyMap[ECollMode.SR] = env[ECollMode.SR];
47
- }
35
+ this.env = env;
36
+ if (typeof __IS_IIFE__ !== "undefined" && __IS_IIFE__ && typeof env === "string") {
37
+ setApiUrl(apiEnv[env]);
48
38
  }
49
39
  }
50
- // TODO: 待废弃
51
- get fraudDetectionID() {
52
- return this.formatFraudDetectionId({
53
- s: this.collResultMap[ECollMode.SR]
54
- });
55
- }
56
40
  async getFraudDetectionId(options) {
57
41
  return this.formatFraudDetectionId({
58
42
  // stripe radar session id
59
- s: this.collResultMap[ECollMode.SR],
43
+ s: this.stripeRadarColl().getFraudDetectionId(),
60
44
  // worldpay ddc fraud detection id
61
- w: await this.worldpayDDCColl().getFraudDetectionId((options == null ? void 0 : options.bin) || "")
45
+ w: await this.worldpayDDCColl().getFraudDetectionId((options == null ? void 0 : options.bin) || ""),
46
+ // worldpay jsc fraud detection id
47
+ wr: this.worldpayJSCColl().fraudDetectionId
62
48
  });
63
49
  }
64
- /** 创建获取 radar session id 的 promise,缓存单例 */
50
+ /** 创建获取 fraud detection id 的 promise,缓存单例 */
65
51
  async createFraudDetection() {
66
52
  if (!this.p) {
67
53
  this.p = Promise.all(
@@ -87,37 +73,16 @@ class FraudDetection {
87
73
  return "";
88
74
  }
89
75
  }
90
- stripeRadarColl() {
91
- return new Promise((resolve, reject) => {
92
- const { onEvent } = this.options || {};
93
- onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_START);
94
- const script = document.createElement("script");
95
- script.type = "text/javascript";
96
- script.src = "https://js.stripe.com/v3/";
97
- script.async = true;
98
- script.crossOrigin = "";
99
- script.onload = async () => {
100
- const stripe = window.Stripe(this.keyMap[ECollMode.SR]);
101
- const { radarSession, error } = await stripe.createRadarSession();
102
- if (error) {
103
- console.error(error);
104
- onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_ERROR);
105
- reject(error);
106
- } else {
107
- this.collResultMap[ECollMode.SR] = radarSession == null ? void 0 : radarSession.id;
108
- onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_SUCCESS);
109
- resolve(radarSession);
110
- }
111
- };
112
- script.onerror = () => {
113
- onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_LOAD_ERROR);
114
- reject();
115
- };
116
- document.getElementsByTagName("head")[0].appendChild(script);
117
- });
118
- }
119
76
  worldpayDDCColl() {
120
- return new WorldpayDDC(this.options);
77
+ const config = typeof this.env === "string" ? void 0 : this.env[ECollMode.WP];
78
+ return new WorldpayDDC(config, this.options);
79
+ }
80
+ worldpayJSCColl() {
81
+ const config = typeof this.env === "string" ? void 0 : this.env[ECollMode.WJ];
82
+ return new WorldpayJSC(config, this.options);
83
+ }
84
+ stripeRadarColl() {
85
+ return new StripeRadar(this.options);
121
86
  }
122
87
  }
123
88
  export {
@@ -0,0 +1,92 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => {
4
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ return value;
6
+ };
7
+ import "../api/http.js";
8
+ import "../utils/card-brand/brands.js";
9
+ import "../utils/system-info/get-browser-info.js";
10
+ import { ChannelCode } from "../constant.js";
11
+ import { FraudDetectionEventType } from "../types/event.js";
12
+ import { loadScript } from "../utils/load.js";
13
+ import "../core.js";
14
+ import { getChannelConfig } from "../api/modules/risk/index.js";
15
+ const STRIPE_RADAR_SCRIPT_URL = "https://js.stripe.com/v3/";
16
+ const _StripeRadar = class _StripeRadar {
17
+ constructor(options) {
18
+ __publicField(this, "options");
19
+ __publicField(this, "radarSessionId");
20
+ if (_StripeRadar.instance) {
21
+ return _StripeRadar.instance;
22
+ }
23
+ this.options = options;
24
+ this.init();
25
+ _StripeRadar.instance = this;
26
+ }
27
+ async init() {
28
+ const { onEvent } = this.options || {};
29
+ onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_START);
30
+ await this.setRadarSessionId();
31
+ }
32
+ getFraudDetectionId() {
33
+ return this.radarSessionId;
34
+ }
35
+ async setRadarSessionId() {
36
+ const { onEvent } = this.options || {};
37
+ try {
38
+ const [key] = await Promise.all([this.getStripeKey(), this.loadStripeScript()]);
39
+ if (!key) {
40
+ return "";
41
+ }
42
+ const stripe = window.Stripe(key);
43
+ const { radarSession, error } = await stripe.createRadarSession();
44
+ if (error) {
45
+ onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_ERROR);
46
+ } else {
47
+ onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_SUCCESS);
48
+ this.radarSessionId = radarSession == null ? void 0 : radarSession.id;
49
+ }
50
+ } catch (error) {
51
+ onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_LOAD_ERROR);
52
+ }
53
+ }
54
+ async getStripeKey() {
55
+ const { onEvent } = this.options || {};
56
+ try {
57
+ const res = await getChannelConfig(ChannelCode.STRIPE);
58
+ const key = res.stripe.key;
59
+ if (!key) {
60
+ onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_API_ERROR, {
61
+ message: "Empty key"
62
+ });
63
+ }
64
+ return key;
65
+ } catch (error) {
66
+ onEvent == null ? void 0 : onEvent(FraudDetectionEventType.STRIPE_RADAR_API_ERROR);
67
+ return "";
68
+ }
69
+ }
70
+ loadStripeScript() {
71
+ return new Promise((resolve, reject) => {
72
+ loadScript({
73
+ src: STRIPE_RADAR_SCRIPT_URL,
74
+ extraOptions: {
75
+ async: true,
76
+ crossOrigin: ""
77
+ },
78
+ onload: () => {
79
+ resolve();
80
+ },
81
+ onerror: () => {
82
+ reject();
83
+ }
84
+ });
85
+ });
86
+ }
87
+ };
88
+ __publicField(_StripeRadar, "instance", null);
89
+ let StripeRadar = _StripeRadar;
90
+ export {
91
+ StripeRadar
92
+ };
@@ -11,10 +11,11 @@ import { FraudDetectionEventType } from "../types/event.js";
11
11
  import "../utils/card-brand/brands.js";
12
12
  import "../utils/system-info/get-browser-info.js";
13
13
  import { postMessageToIframe } from "../utils/iframe.js";
14
- const DDC_ORIGIN = "https://centinelapistag.cardinalcommerce.com";
14
+ const DDC_ORIGIN = "https://centinelapi.cardinalcommerce.com";
15
15
  const DDC_TIMEOUT = 1e4;
16
+ const DDC_API_URL = `${DDC_ORIGIN}/V2/Cruise/Collect`;
16
17
  const _WorldpayDDC = class _WorldpayDDC {
17
- constructor(options) {
18
+ constructor(config, options) {
18
19
  __publicField(this, "iframe", null);
19
20
  __publicField(this, "jwt", null);
20
21
  __publicField(this, "listener", null);
@@ -22,10 +23,18 @@ const _WorldpayDDC = class _WorldpayDDC {
22
23
  __publicField(this, "fraudDetectionId", null);
23
24
  __publicField(this, "p");
24
25
  __publicField(this, "options");
26
+ __publicField(this, "config", {
27
+ ddcOrigin: DDC_ORIGIN,
28
+ ddcCollectUrl: DDC_API_URL
29
+ });
25
30
  if (_WorldpayDDC.instance) {
26
31
  return _WorldpayDDC.instance;
27
32
  }
28
33
  this.options = options;
34
+ this.config = {
35
+ ddcOrigin: (config == null ? void 0 : config.ddcOrigin) || this.config.ddcOrigin,
36
+ ddcCollectUrl: (config == null ? void 0 : config.ddcCollectUrl) || this.config.ddcCollectUrl
37
+ };
29
38
  _WorldpayDDC.instance = this;
30
39
  }
31
40
  /**
@@ -77,7 +86,8 @@ const _WorldpayDDC = class _WorldpayDDC {
77
86
  const message = {
78
87
  action: MessageAction.DDC_JWT_BIN,
79
88
  jwt: this.jwt || "",
80
- bin
89
+ bin,
90
+ url: this.config.ddcCollectUrl
81
91
  };
82
92
  postMessageToIframe(message, this.iframe.contentWindow, cdnOrigin);
83
93
  }
@@ -92,7 +102,7 @@ const _WorldpayDDC = class _WorldpayDDC {
92
102
  }
93
103
  this.listener = (event) => {
94
104
  var _a;
95
- if (event.origin === DDC_ORIGIN) {
105
+ if (event.origin === this.config.ddcOrigin) {
96
106
  const data = JSON.parse(event.data);
97
107
  console.warn("worldpay ddc data", data);
98
108
  if (data) {
@@ -0,0 +1,61 @@
1
+ window.worldpayJSCOrigin = window.worldpayJSCOrigin || {};
2
+ console.log("window.worldpayJSCOrigin", window.worldpayJSCOrigin);
3
+ window.worldpayJSCOrigin.version = 4, window.worldpayJSCOrigin.create_url = function(t, e, r, n, c) {
4
+ function i() {
5
+ return Math.floor(2742745743359 * Math.random());
6
+ }
7
+ function a() {
8
+ return o(i());
9
+ }
10
+ function o(t2) {
11
+ return (t2 + 78364164096).toString(36);
12
+ }
13
+ var m = i(), u = i(), l = 885187064159;
14
+ u = ((u = u - u % 256 + window.worldpayJSCOrigin.version) + m) % 2742745743359, l = (l + m) % 2742745743359;
15
+ var s = "https://" + t + "/" + (m = a() + o(m)) + e, h = [(u = o(l) + o(u)) + "=" + r, a() + a() + "=" + n];
16
+ return void 0 !== c && c.length > 0 && h.push(a() + a() + "=" + c), s + "?" + h.join("&");
17
+ }, window.worldpayJSCOrigin.beacon = function(t, e, r, n) {
18
+ var c = "turn:aa.online-metrix.net?transport=", i = "1:" + e + ":" + r, a = {
19
+ iceServers: [
20
+ { urls: c + "tcp", username: i, credential: r },
21
+ { urls: c + "udp", username: i, credential: r }
22
+ ]
23
+ };
24
+ try {
25
+ var o = new RTCPeerConnection(a);
26
+ o.createDataChannel(Math.random().toString());
27
+ var m = function() {
28
+ }, u = function(t2) {
29
+ o.setLocalDescription(t2, m, m);
30
+ };
31
+ "undefined" == typeof Promise || o.createOffer.length > 0 ? o.createOffer(u, m) : o.createOffer().then(u, m), setInterval(function() {
32
+ o.close();
33
+ }, 1e4);
34
+ } catch (t2) {
35
+ }
36
+ }, window.worldpayJSCOrigin.load_tags = function(t, e, r, n) {
37
+ window.worldpayJSCOrigin.beacon(t, e, r, n);
38
+ var c = document.getElementsByTagName("head").item(0), i = document.createElement("script");
39
+ i.id = "tmx_tags_js", i.setAttribute("type", "text/javascript");
40
+ var a = window.worldpayJSCOrigin.create_url(t, ".js", e, r, n);
41
+ i.setAttribute("src", a), window.worldpayJSCOrigin.set_csp_nonce(i), c.appendChild(i);
42
+ }, window.worldpayJSCOrigin.csp_nonce = null, window.worldpayJSCOrigin.register_csp_nonce = function(t) {
43
+ if (void 0 !== t.currentScript && null !== t.currentScript) {
44
+ var e = t.currentScript.getAttribute("nonce");
45
+ null != e && "" !== e ? window.worldpayJSCOrigin.csp_nonce = e : void 0 !== t.currentScript.nonce && null !== t.currentScript.nonce && "" !== t.currentScript.nonce && (window.worldpayJSCOrigin.csp_nonce = t.currentScript.nonce);
46
+ }
47
+ }, window.worldpayJSCOrigin.set_csp_nonce = function(t) {
48
+ null !== window.worldpayJSCOrigin.csp_nonce && (t.setAttribute("nonce", window.worldpayJSCOrigin.csp_nonce), t.getAttribute("nonce") !== window.worldpayJSCOrigin.csp_nonce && (t.nonce = window.worldpayJSCOrigin.csp_nonce));
49
+ }, window.worldpayJSCOrigin.cleanup = function() {
50
+ let hp_frame = null;
51
+ let tmx_frame = null;
52
+ let tmx_script = null;
53
+ for (; null !== (hp_frame = document.getElementById("tdz_ifrm")); )
54
+ hp_frame.parentElement.removeChild(hp_frame);
55
+ for (; null !== (tmx_frame = document.getElementById("tmx_tags_iframe")); )
56
+ tmx_frame.parentElement.removeChild(tmx_frame);
57
+ for (; null !== (tmx_script = document.getElementById("tmx_tags_js")); )
58
+ tmx_script.parentElement.removeChild(tmx_script);
59
+ }, window.worldpayJSCOrigin.load = function(t, e, r, n) {
60
+ void 0 !== t && void 0 !== e && void 0 !== r && 8 === e.length && (window.worldpayJSCOrigin.cleanup(), window.worldpayJSCOrigin.register_csp_nonce(document), window.worldpayJSCOrigin.load_tags(t, e, r, n));
61
+ };