@paykka/card-checkout-ui 0.7.0 → 0.9.2
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.
- package/dist/card-checkout-ui.js +27 -20
- package/dist/card-checkout-ui.umd.cjs +27 -20
- package/dist/es/_commonjsHelpers.js +1 -0
- package/dist/es/api/http.js +19 -21
- package/dist/es/api/index.js +1 -0
- package/dist/es/api/modules/ali-pay/index.js +19 -11
- package/dist/es/api/modules/apple-pay/index.js +10 -26
- package/dist/es/api/modules/boost/index.js +56 -0
- package/dist/es/api/modules/card/index.js +17 -11
- package/dist/es/api/modules/checkout/index.js +6 -6
- package/dist/es/api/modules/checkout/map.js +29 -1
- package/dist/es/api/modules/gcash/index.js +56 -0
- package/dist/es/api/modules/get-browser-params.js +2 -2
- package/dist/es/api/modules/google-pay/index.js +10 -26
- package/dist/es/api/modules/grab-pay/index.js +56 -0
- package/dist/es/api/modules/index.js +1 -0
- package/dist/es/api/modules/line-pay/index.js +56 -0
- package/dist/es/api/modules/may-bank-qr-pay/index.js +56 -0
- package/dist/es/api/modules/nine-pay/index.js +56 -0
- package/dist/es/api/modules/paymaya/index.js +56 -0
- package/dist/es/api/modules/sepa/index.js +19 -11
- package/dist/es/api/modules/shopee-pay/index.js +56 -0
- package/dist/es/api/modules/tng-wallet/index.js +56 -0
- package/dist/es/api/modules/wechat-pay/index.js +18 -31
- package/dist/es/components/AccordionItem/AccordionItem.js +36 -0
- package/dist/es/components/AliPay/index.js +58 -60
- package/dist/es/components/ApplePay/index.js +29 -43
- package/dist/es/components/Boost/index.js +322 -0
- package/dist/es/components/Card/index.js +89 -75
- package/dist/es/components/CardBrands/index.js +2 -2
- package/dist/es/components/CardNumberField/index.js +113 -106
- package/dist/es/components/DropIn/index.js +365 -0
- package/dist/es/components/GooglePay/index.js +15 -7
- package/dist/es/components/GrabPay/index.js +322 -0
- package/dist/es/components/GuideCard/index.js +43 -0
- package/dist/es/components/LinePay/index.js +322 -0
- package/dist/es/components/MayBankQRPay/index.js +322 -0
- package/dist/es/components/NinePay/index.js +322 -0
- package/dist/es/components/SecuredIframe/index.js +3 -2
- package/dist/es/components/Sepa/index.js +8 -9
- package/dist/es/components/ShopeePay/index.js +322 -0
- package/dist/es/components/SubmitButton/index.js +6 -20
- package/dist/es/components/TNGWallet/index.js +322 -0
- package/dist/es/components/WechatPay/index.js +51 -61
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +41 -0
- package/dist/es/components/business/QRCodeModal/index.js +6 -0
- package/dist/es/components/business/QRCodeModal/qr-code-modal.js +1 -0
- package/dist/es/components/business/QRCodeModal/type.js +1 -0
- package/dist/es/components/business/index.js +6 -0
- package/dist/es/components/index.js +10 -0
- package/dist/es/components/internal/Accordion/Accordion.js +14 -0
- package/dist/es/components/internal/Accordion/accordion2.js +1 -0
- package/dist/es/components/internal/Accordion/accordionTransition.js +26 -0
- package/dist/es/components/internal/Accordion/index.js +7 -0
- package/dist/es/components/internal/Accordion/type.js +10 -0
- package/dist/es/components/internal/Modal/Modal.js +17 -3
- package/dist/es/components/internal/Modal/index.js +1 -0
- package/dist/es/components/internal/Modal/type.js +1 -0
- package/dist/es/components/internal/QRCode/QRCode.js +31 -0
- package/dist/es/components/internal/QRCode/index.js +4 -0
- package/dist/es/components/internal/QRCode/type.js +1 -0
- package/dist/es/components/internal/icons/IconBoost.js +63 -0
- package/dist/es/components/internal/icons/IconCard.js +3 -0
- package/dist/es/components/internal/icons/IconCard2.js +60 -0
- package/dist/es/components/internal/icons/IconGCash.js +196 -0
- package/dist/es/components/internal/icons/IconGcashComplete.js +184 -0
- package/dist/es/components/internal/icons/IconGrabPay.js +59 -0
- package/dist/es/components/internal/icons/IconLinePay.js +99 -0
- package/dist/es/components/internal/icons/IconMayBankQRPay.js +69 -0
- package/dist/es/components/internal/icons/IconNinePay.js +255 -0
- package/dist/es/components/internal/icons/IconPaymaya.js +114 -0
- package/dist/es/components/internal/icons/IconRedirect.js +58 -0
- package/dist/es/components/internal/icons/IconScan.js +102 -0
- package/dist/es/components/internal/icons/IconShopeePay.js +108 -0
- package/dist/es/components/internal/icons/IconTNGWallet.js +119 -0
- package/dist/es/components/internal/icons/IconUnionPay.js +65 -0
- package/dist/es/components/wallets/GCash/GCash.js +356 -0
- package/dist/es/components/wallets/GCash/g-cash.js +1 -0
- package/dist/es/components/wallets/GCash/index.js +1 -0
- package/dist/es/components/wallets/GCash/type.js +1 -0
- package/dist/es/components/wallets/Paymaya/Paymaya.js +323 -0
- package/dist/es/components/wallets/Paymaya/index.js +1 -0
- package/dist/es/components/wallets/Paymaya/paymaya2.js +1 -0
- package/dist/es/components/wallets/Paymaya/type.js +1 -0
- package/dist/es/config.js +12 -12
- package/dist/es/constant.js +94 -4
- package/dist/es/core/PayKKaCheckout.js +38 -3
- package/dist/es/core/Session.js +24 -23
- package/dist/es/core/error.js +7 -0
- package/dist/es/core/query.js +3 -2
- package/dist/es/core.js +2082 -70
- package/dist/es/hooks/usePayState.js +3 -4
- package/dist/es/i18n/I18n.js +8 -2
- package/dist/es/i18n/locales/de-DE.js +19 -1
- package/dist/es/i18n/locales/en-GB.js +19 -1
- package/dist/es/i18n/locales/es-ES.js +19 -1
- package/dist/es/i18n/locales/fr-FR.js +19 -1
- package/dist/es/i18n/locales/ja-JP.js +19 -1
- package/dist/es/i18n/locales/ko-KR.js +19 -1
- package/dist/es/i18n/locales/pt-PT.js +19 -1
- package/dist/es/i18n/locales/ru-RU.js +19 -1
- package/dist/es/i18n/locales/zh-CN.js +19 -1
- package/dist/es/i18n/locales/zh-HK.js +19 -1
- package/dist/es/i18n/locales/zh-TW.js +19 -1
- package/dist/es/i18n/util.js +20 -0
- package/dist/es/index.js +24 -0
- package/dist/es/style.css +1 -1096
- package/dist/es/types/index.js +1 -0
- package/dist/es/utils/array.js +9 -0
- package/dist/es/utils/card-brand/brands.js +11 -1
- package/dist/es/utils/card-brand/index.js +4 -3
- package/dist/es/utils/card-brand/luhn.js +25 -0
- package/dist/es/utils/date.js +25 -0
- package/dist/es/utils/detect.js +6 -0
- package/dist/es/utils/format.js +28 -12
- package/dist/es/utils/index.js +9 -1
- package/dist/es/utils/location.js +37 -0
- package/dist/es/utils/object.js +14 -0
- package/dist/es/utils/redirect.js +32 -0
- package/dist/es/utils/system-info/get-browser-info.js +4 -4
- package/dist/es/utils/system-info/get-system-info.js +11 -7
- package/dist/es/utils/system-info/index.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/api/http.d.ts +4 -10
- package/dist/types/api/modules/ali-pay/index.d.ts +2 -1
- package/dist/types/api/modules/apple-pay/index.d.ts +2 -1
- package/dist/types/api/modules/boost/index.d.ts +24 -0
- package/dist/types/api/modules/card/index.d.ts +1 -1
- package/dist/types/api/modules/checkout/index.d.ts +2 -2
- package/dist/types/api/modules/checkout/map.d.ts +2 -1
- package/dist/types/api/modules/checkout/type.d.ts +20 -2
- package/dist/types/api/modules/gcash/index.d.ts +24 -0
- package/dist/types/api/modules/get-browser-params.d.ts +2 -2
- package/dist/types/api/modules/google-pay/index.d.ts +2 -1
- package/dist/types/api/modules/grab-pay/index.d.ts +24 -0
- package/dist/types/api/modules/index.d.ts +9 -0
- package/dist/types/api/modules/line-pay/index.d.ts +24 -0
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +24 -0
- package/dist/types/api/modules/nine-pay/index.d.ts +24 -0
- package/dist/types/api/modules/paymaya/index.d.ts +24 -0
- package/dist/types/api/modules/sepa/index.d.ts +2 -1
- package/dist/types/api/modules/shopee-pay/index.d.ts +24 -0
- package/dist/types/api/modules/tng-wallet/index.d.ts +24 -0
- package/dist/types/api/modules/wechat-pay/index.d.ts +2 -1
- package/dist/types/components/AliPay/AliPay.d.ts +2 -1
- package/dist/types/components/AliPay/type.d.ts +1 -2
- package/dist/types/components/ApplePay/ApplePay.d.ts +2 -1
- package/dist/types/components/ApplePay/type.d.ts +9 -6
- package/dist/types/components/Boost/Boost.d.ts +7 -0
- package/dist/types/components/Boost/index.d.ts +2 -0
- package/dist/types/components/Boost/type.d.ts +61 -0
- package/dist/types/components/Card/Card.d.ts +2 -1
- package/dist/types/components/Card/type.d.ts +2 -2
- package/dist/types/components/DropIn/DropIn.d.ts +6 -0
- package/dist/types/components/DropIn/components/PaymentTabs/PaymentTabs.d.ts +3 -0
- package/dist/types/components/DropIn/components/PaymentTabs/index.d.ts +2 -0
- package/dist/types/components/DropIn/components/PaymentTabs/type.d.ts +11 -0
- package/dist/types/components/DropIn/config.d.ts +7 -0
- package/dist/types/components/DropIn/index.d.ts +2 -0
- package/dist/types/components/DropIn/type.d.ts +57 -0
- package/dist/types/components/GooglePay/GooglePay.d.ts +2 -1
- package/dist/types/components/GooglePay/type.d.ts +20 -9
- package/dist/types/components/GrabPay/GrabPay.d.ts +7 -0
- package/dist/types/components/GrabPay/index.d.ts +2 -0
- package/dist/types/components/GrabPay/type.d.ts +61 -0
- package/dist/types/components/GuideCard/GuideCard.d.ts +3 -0
- package/dist/types/components/GuideCard/index.d.ts +2 -0
- package/dist/types/components/GuideCard/type.d.ts +4 -0
- package/dist/types/components/LinePay/LinePay.d.ts +7 -0
- package/dist/types/components/LinePay/index.d.ts +2 -0
- package/dist/types/components/LinePay/type.d.ts +61 -0
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -0
- package/dist/types/components/MayBankQRPay/index.d.ts +2 -0
- package/dist/types/components/MayBankQRPay/type.d.ts +61 -0
- package/dist/types/components/NinePay/NinePay.d.ts +6 -0
- package/dist/types/components/NinePay/index.d.ts +2 -0
- package/dist/types/components/NinePay/type.d.ts +61 -0
- package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +1 -1
- package/dist/types/components/Sepa/Sepa.d.ts +2 -1
- package/dist/types/components/Sepa/type.d.ts +1 -2
- package/dist/types/components/ShopeePay/ShopeePay.d.ts +7 -0
- package/dist/types/components/ShopeePay/index.d.ts +2 -0
- package/dist/types/components/ShopeePay/type.d.ts +61 -0
- package/dist/types/components/SubmitButton/SubmitButton.d.ts +1 -1
- package/dist/types/components/TNGWallet/TNGWallet.d.ts +7 -0
- package/dist/types/components/TNGWallet/index.d.ts +2 -0
- package/dist/types/components/TNGWallet/type.d.ts +61 -0
- package/dist/types/components/WechatPay/WechatPay.d.ts +2 -1
- package/dist/types/components/WechatPay/type.d.ts +1 -2
- package/dist/types/components/business/QRCodeModal/QRCodeModal.d.ts +3 -0
- package/dist/types/components/business/QRCodeModal/index.d.ts +2 -0
- package/dist/types/components/business/QRCodeModal/type.d.ts +18 -0
- package/dist/types/components/business/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +10 -0
- package/dist/types/components/internal/Accordion/Accordion.d.ts +3 -0
- package/dist/types/components/internal/Accordion/accordionTransition.d.ts +8 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/AccordionItem.d.ts +3 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/index.d.ts +2 -0
- package/dist/types/components/internal/Accordion/components/AccordionItem/type.d.ts +18 -0
- package/dist/types/components/internal/Accordion/index.d.ts +3 -0
- package/dist/types/components/internal/Accordion/type.d.ts +18 -0
- package/dist/types/components/internal/Modal/index.d.ts +2 -0
- package/dist/types/components/internal/Modal/type.d.ts +3 -1
- package/dist/types/components/internal/QRCode/QRCode.d.ts +2 -0
- package/dist/types/components/internal/QRCode/index.d.ts +2 -0
- package/dist/types/components/internal/QRCode/type.d.ts +9 -0
- package/dist/types/components/internal/icons/IconBoost.d.ts +2 -0
- package/dist/types/components/internal/icons/IconCard.d.ts +2 -0
- package/dist/types/components/internal/icons/IconCard2.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGCash.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGcashComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/IconGrabPay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconLinePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconMayBankQRPay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconNinePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconPaymaya.d.ts +2 -0
- package/dist/types/components/internal/icons/IconRedirect.d.ts +2 -0
- package/dist/types/components/internal/icons/IconScan.d.ts +2 -0
- package/dist/types/components/internal/icons/IconShopeePay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconTNGWallet.d.ts +2 -0
- package/dist/types/components/internal/icons/IconUnionPay.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +14 -0
- package/dist/types/components/wallets/GCash/GCash.d.ts +6 -0
- package/dist/types/components/wallets/GCash/index.d.ts +2 -0
- package/dist/types/components/wallets/GCash/type.d.ts +66 -0
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -0
- package/dist/types/components/wallets/Paymaya/index.d.ts +2 -0
- package/dist/types/components/wallets/Paymaya/type.d.ts +61 -0
- package/dist/types/config.d.ts +9 -9
- package/dist/types/constant.d.ts +38 -2
- package/dist/types/core/PayKKaCheckout.d.ts +11 -0
- package/dist/types/core/Session.d.ts +2 -0
- package/dist/types/core/error.d.ts +3 -1
- package/dist/types/core/query.d.ts +2 -2
- package/dist/types/hooks/usePayState.d.ts +0 -3
- package/dist/types/i18n/I18n.d.ts +1 -1
- package/dist/types/i18n/locales/de-DE.d.ts +15 -0
- package/dist/types/i18n/locales/en-GB.d.ts +15 -0
- package/dist/types/i18n/locales/es-ES.d.ts +15 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +15 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +15 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +15 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +15 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +15 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +15 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +15 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +15 -0
- package/dist/types/i18n/util.d.ts +10 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts +34 -7
- package/dist/types/types/message.d.ts +1 -0
- package/dist/types/utils/array.d.ts +1 -0
- package/dist/types/utils/card-brand/brands.d.ts +4 -3
- package/dist/types/utils/card-brand/index.d.ts +9 -6
- package/dist/types/utils/card-brand/luhn.d.ts +9 -0
- package/dist/types/utils/date.d.ts +9 -0
- package/dist/types/utils/detect.d.ts +1 -0
- package/dist/types/utils/format.d.ts +7 -1
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/location.d.ts +7 -0
- package/dist/types/utils/object.d.ts +1 -0
- package/dist/types/utils/redirect.d.ts +5 -0
- package/dist/types/utils/system-info/get-browser-info.d.ts +1 -1
- package/dist/types/utils/system-info/get-system-info.d.ts +3 -2
- package/dist/types/utils/system-info/index.d.ts +3 -3
- package/package.json +65 -63
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
5
|
+
import { http } from "../../http.js";
|
|
6
|
+
import { payResMap } from "../map.js";
|
|
7
|
+
const mayBankQRPay = async ({
|
|
8
|
+
sessionId,
|
|
9
|
+
clientKey,
|
|
10
|
+
payment,
|
|
11
|
+
bill,
|
|
12
|
+
browser
|
|
13
|
+
}, core, options) => {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", payment.paymentMethod);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
26
|
+
}
|
|
27
|
+
}, extraParams || {});
|
|
28
|
+
return http.post(
|
|
29
|
+
"/session/payments",
|
|
30
|
+
{
|
|
31
|
+
...params,
|
|
32
|
+
session_id: sessionId,
|
|
33
|
+
client_key: clientKey,
|
|
34
|
+
payment: {
|
|
35
|
+
payment_method: payment.paymentMethod
|
|
36
|
+
},
|
|
37
|
+
browser
|
|
38
|
+
},
|
|
39
|
+
options
|
|
40
|
+
).then(payResMap);
|
|
41
|
+
};
|
|
42
|
+
const getMayBankQRPayInfo = async ({ sessionId, clientKey }, options) => {
|
|
43
|
+
return http.post(
|
|
44
|
+
"/session/payments/query",
|
|
45
|
+
{
|
|
46
|
+
session_id: sessionId,
|
|
47
|
+
client_key: clientKey,
|
|
48
|
+
payment_method: PaymentMethod.MAY_BANK_QR_PAY
|
|
49
|
+
},
|
|
50
|
+
options
|
|
51
|
+
).then(payResMap);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
getMayBankQRPayInfo,
|
|
55
|
+
mayBankQRPay
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
5
|
+
import { http } from "../../http.js";
|
|
6
|
+
import { payResMap } from "../map.js";
|
|
7
|
+
const ninePay = async ({
|
|
8
|
+
sessionId,
|
|
9
|
+
clientKey,
|
|
10
|
+
payment,
|
|
11
|
+
bill,
|
|
12
|
+
browser
|
|
13
|
+
}, core, options) => {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", payment.paymentMethod);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
26
|
+
}
|
|
27
|
+
}, extraParams || {});
|
|
28
|
+
return http.post(
|
|
29
|
+
"/session/payments",
|
|
30
|
+
{
|
|
31
|
+
...params,
|
|
32
|
+
session_id: sessionId,
|
|
33
|
+
client_key: clientKey,
|
|
34
|
+
payment: {
|
|
35
|
+
payment_method: payment.paymentMethod
|
|
36
|
+
},
|
|
37
|
+
browser
|
|
38
|
+
},
|
|
39
|
+
options
|
|
40
|
+
).then(payResMap);
|
|
41
|
+
};
|
|
42
|
+
const getNinePayInfo = async ({ sessionId, clientKey }, options) => {
|
|
43
|
+
return http.post(
|
|
44
|
+
"/session/payments/query",
|
|
45
|
+
{
|
|
46
|
+
session_id: sessionId,
|
|
47
|
+
client_key: clientKey,
|
|
48
|
+
payment_method: PaymentMethod.NINE_PAY
|
|
49
|
+
},
|
|
50
|
+
options
|
|
51
|
+
).then(payResMap);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
getNinePayInfo,
|
|
55
|
+
ninePay
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
5
|
+
import { http } from "../../http.js";
|
|
6
|
+
import { payResMap } from "../map.js";
|
|
7
|
+
const paymayaPay = async ({
|
|
8
|
+
sessionId,
|
|
9
|
+
clientKey,
|
|
10
|
+
payment,
|
|
11
|
+
bill,
|
|
12
|
+
browser
|
|
13
|
+
}, core, options) => {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", payment.paymentMethod);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
26
|
+
}
|
|
27
|
+
}, extraParams || {});
|
|
28
|
+
return http.post(
|
|
29
|
+
"/session/payments",
|
|
30
|
+
{
|
|
31
|
+
...params,
|
|
32
|
+
session_id: sessionId,
|
|
33
|
+
client_key: clientKey,
|
|
34
|
+
payment: {
|
|
35
|
+
payment_method: payment.paymentMethod
|
|
36
|
+
},
|
|
37
|
+
browser
|
|
38
|
+
},
|
|
39
|
+
options
|
|
40
|
+
).then(payResMap);
|
|
41
|
+
};
|
|
42
|
+
const getPaymayaPayInfo = async ({ sessionId, clientKey }, options) => {
|
|
43
|
+
return http.post(
|
|
44
|
+
"/session/payments/query",
|
|
45
|
+
{
|
|
46
|
+
session_id: sessionId,
|
|
47
|
+
client_key: clientKey,
|
|
48
|
+
payment_method: PaymentMethod.PAYMAYA
|
|
49
|
+
},
|
|
50
|
+
options
|
|
51
|
+
).then(payResMap);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
getPaymayaPayInfo,
|
|
55
|
+
paymayaPay
|
|
56
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
2
5
|
import { http } from "../../http.js";
|
|
3
6
|
import { payResMap } from "../map.js";
|
|
4
7
|
async function sepaPay({
|
|
@@ -7,10 +10,25 @@ async function sepaPay({
|
|
|
7
10
|
payment,
|
|
8
11
|
bill,
|
|
9
12
|
browser
|
|
10
|
-
}, options) {
|
|
13
|
+
}, core, options) {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", PaymentMethod.SEPA_DEBIT);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
26
|
+
}
|
|
27
|
+
}, extraParams || {});
|
|
11
28
|
return http.post(
|
|
12
29
|
"/session/payments",
|
|
13
30
|
{
|
|
31
|
+
...params,
|
|
14
32
|
session_id: sessionId,
|
|
15
33
|
client_key: clientKey,
|
|
16
34
|
payment: {
|
|
@@ -18,16 +36,6 @@ async function sepaPay({
|
|
|
18
36
|
payment_method: PaymentMethod.SEPA_DEBIT,
|
|
19
37
|
holder_name: payment.holderName
|
|
20
38
|
},
|
|
21
|
-
bill: {
|
|
22
|
-
email: bill.email,
|
|
23
|
-
country: bill.country,
|
|
24
|
-
state: bill.province,
|
|
25
|
-
city: bill.city,
|
|
26
|
-
postal_code: bill.postCode,
|
|
27
|
-
address_line1: bill.address1,
|
|
28
|
-
address_line2: bill.address2,
|
|
29
|
-
county: bill.area
|
|
30
|
-
},
|
|
31
39
|
browser
|
|
32
40
|
},
|
|
33
41
|
options
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
5
|
+
import { http } from "../../http.js";
|
|
6
|
+
import { payResMap } from "../map.js";
|
|
7
|
+
const shopeePay = async ({
|
|
8
|
+
sessionId,
|
|
9
|
+
clientKey,
|
|
10
|
+
payment,
|
|
11
|
+
bill,
|
|
12
|
+
browser
|
|
13
|
+
}, core, options) => {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", payment.paymentMethod);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
26
|
+
}
|
|
27
|
+
}, extraParams || {});
|
|
28
|
+
return http.post(
|
|
29
|
+
"/session/payments",
|
|
30
|
+
{
|
|
31
|
+
...params,
|
|
32
|
+
session_id: sessionId,
|
|
33
|
+
client_key: clientKey,
|
|
34
|
+
payment: {
|
|
35
|
+
payment_method: payment.paymentMethod
|
|
36
|
+
},
|
|
37
|
+
browser
|
|
38
|
+
},
|
|
39
|
+
options
|
|
40
|
+
).then(payResMap);
|
|
41
|
+
};
|
|
42
|
+
const getShopeePayInfo = async ({ sessionId, clientKey }, options) => {
|
|
43
|
+
return http.post(
|
|
44
|
+
"/session/payments/query",
|
|
45
|
+
{
|
|
46
|
+
session_id: sessionId,
|
|
47
|
+
client_key: clientKey,
|
|
48
|
+
payment_method: PaymentMethod.SHOPEE_PAY
|
|
49
|
+
},
|
|
50
|
+
options
|
|
51
|
+
).then(payResMap);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
getShopeePayInfo,
|
|
55
|
+
shopeePay
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
5
|
+
import { http } from "../../http.js";
|
|
6
|
+
import { payResMap } from "../map.js";
|
|
7
|
+
const tngWalletPay = async ({
|
|
8
|
+
sessionId,
|
|
9
|
+
clientKey,
|
|
10
|
+
payment,
|
|
11
|
+
bill,
|
|
12
|
+
browser
|
|
13
|
+
}, core, options) => {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", payment.paymentMethod);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
26
|
+
}
|
|
27
|
+
}, extraParams || {});
|
|
28
|
+
return http.post(
|
|
29
|
+
"/session/payments",
|
|
30
|
+
{
|
|
31
|
+
...params,
|
|
32
|
+
session_id: sessionId,
|
|
33
|
+
client_key: clientKey,
|
|
34
|
+
payment: {
|
|
35
|
+
payment_method: payment.paymentMethod
|
|
36
|
+
},
|
|
37
|
+
browser
|
|
38
|
+
},
|
|
39
|
+
options
|
|
40
|
+
).then(payResMap);
|
|
41
|
+
};
|
|
42
|
+
const getTNGWalletPayInfo = async ({ sessionId, clientKey }, options) => {
|
|
43
|
+
return http.post(
|
|
44
|
+
"/session/payments/query",
|
|
45
|
+
{
|
|
46
|
+
session_id: sessionId,
|
|
47
|
+
client_key: clientKey,
|
|
48
|
+
payment_method: PaymentMethod.TNG_WALLET
|
|
49
|
+
},
|
|
50
|
+
options
|
|
51
|
+
).then(payResMap);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
getTNGWalletPayInfo,
|
|
55
|
+
tngWalletPay
|
|
56
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PaymentMethod } from "../../../constant.js";
|
|
2
|
+
import "../../../utils/card-brand/brands.js";
|
|
3
|
+
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
+
import { deepMerge } from "../../../utils/object.js";
|
|
2
5
|
import { http } from "../../http.js";
|
|
3
6
|
import { getBrowserParams } from "../get-browser-params.js";
|
|
4
7
|
import { payResMap } from "../map.js";
|
|
@@ -7,46 +10,30 @@ async function wechatPay({
|
|
|
7
10
|
clientKey,
|
|
8
11
|
bill,
|
|
9
12
|
channelUserId
|
|
10
|
-
}, options) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
postal_code: bill.postCode,
|
|
24
|
-
address_line1: bill.address1,
|
|
25
|
-
address_line2: bill.address2,
|
|
26
|
-
county: bill.area
|
|
27
|
-
},
|
|
28
|
-
browser: await getBrowserParams(),
|
|
29
|
-
channel_user_id: channelUserId
|
|
13
|
+
}, core, options) {
|
|
14
|
+
const { _getExtraParams } = core.config;
|
|
15
|
+
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", PaymentMethod.WECHAT_PAY);
|
|
16
|
+
const params = deepMerge({
|
|
17
|
+
bill: {
|
|
18
|
+
email: bill.email,
|
|
19
|
+
country: bill.country,
|
|
20
|
+
state: bill.province,
|
|
21
|
+
city: bill.city,
|
|
22
|
+
postal_code: bill.postCode,
|
|
23
|
+
address_line1: bill.address1,
|
|
24
|
+
address_line2: bill.address2,
|
|
25
|
+
county: bill.area
|
|
30
26
|
}
|
|
31
|
-
);
|
|
27
|
+
}, extraParams || {});
|
|
32
28
|
return http.post(
|
|
33
29
|
"/session/payments",
|
|
34
30
|
{
|
|
31
|
+
...params,
|
|
35
32
|
session_id: sessionId,
|
|
36
33
|
client_key: clientKey,
|
|
37
34
|
payment: {
|
|
38
35
|
payment_method: PaymentMethod.WECHAT_PAY
|
|
39
36
|
},
|
|
40
|
-
bill: {
|
|
41
|
-
email: bill.email,
|
|
42
|
-
country: bill.country,
|
|
43
|
-
state: bill.province,
|
|
44
|
-
city: bill.city,
|
|
45
|
-
postal_code: bill.postCode,
|
|
46
|
-
address_line1: bill.address1,
|
|
47
|
-
address_line2: bill.address2,
|
|
48
|
-
county: bill.area
|
|
49
|
-
},
|
|
50
37
|
browser: await getBrowserParams(),
|
|
51
38
|
channel_user_id: channelUserId
|
|
52
39
|
},
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { x, h, y, u } from "../../core.js";
|
|
2
|
+
import { COMMON_CLASS_NAME } from "../../constant.js";
|
|
3
|
+
import { useBEM } from "../../hooks/useBEM.js";
|
|
4
|
+
import "../../core/context.js";
|
|
5
|
+
import "../../utils/card-brand/brands.js";
|
|
6
|
+
import "../../utils/system-info/get-browser-info.js";
|
|
7
|
+
import { normalizedClass } from "../../utils/format.js";
|
|
8
|
+
import { AccordionContext } from "../internal/Accordion/type.js";
|
|
9
|
+
import { accordionTransition } from "../internal/Accordion/accordionTransition.js";
|
|
10
|
+
const { bem } = useBEM("accordion-item");
|
|
11
|
+
const AccordionItem = (props) => {
|
|
12
|
+
const { title, value, disabled = false, children, header } = props;
|
|
13
|
+
const { activeName, onSelect, enableTransition } = x(AccordionContext);
|
|
14
|
+
const [contentRef, setContentRef] = h(null);
|
|
15
|
+
const active = activeName === value;
|
|
16
|
+
const handleClickItem = () => {
|
|
17
|
+
if (disabled)
|
|
18
|
+
return;
|
|
19
|
+
onSelect(value);
|
|
20
|
+
};
|
|
21
|
+
y(() => {
|
|
22
|
+
if (!contentRef)
|
|
23
|
+
return;
|
|
24
|
+
accordionTransition(contentRef, active, enableTransition);
|
|
25
|
+
}, [active, contentRef]);
|
|
26
|
+
return /* @__PURE__ */ u("div", { className: normalizedClass(COMMON_CLASS_NAME, bem({ disabled })), children: [
|
|
27
|
+
/* @__PURE__ */ u("div", { className: bem("header"), onClick: handleClickItem, children: [
|
|
28
|
+
header,
|
|
29
|
+
/* @__PURE__ */ u("span", { className: bem("title", [active ? "active" : ""]), children: title })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ u("div", { className: bem("content", [active ? "active" : ""]), ref: setContentRef, children })
|
|
32
|
+
] });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
AccordionItem
|
|
36
|
+
};
|