@paykka/card-checkout-ui 0.11.6 → 0.13.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 +19 -19
- package/dist/card-checkout-ui.umd.cjs +19 -19
- package/dist/es/_commonjsHelpers.js +82 -1
- package/dist/es/api/index.js +1 -0
- package/dist/es/api/modules/address/index.js +9 -9
- package/dist/es/api/modules/ali-pay/index.js +10 -49
- package/dist/es/api/modules/apple-pay/index.js +13 -59
- package/dist/es/api/modules/boost/index.js +8 -48
- package/dist/es/api/modules/card/index.js +10 -54
- package/dist/es/api/modules/checkout/index.js +11 -9
- package/dist/es/api/modules/checkout/map.js +25 -18
- package/dist/es/api/modules/encrypted-card/index.js +3 -2
- package/dist/es/api/modules/gcash/index.js +8 -48
- package/dist/es/api/modules/get-browser-params.js +4 -1
- package/dist/es/api/modules/google-pay/index.js +10 -56
- package/dist/es/api/modules/grab-pay/index.js +8 -48
- package/dist/es/api/modules/index.js +1 -0
- package/dist/es/api/modules/line-pay/index.js +8 -48
- package/dist/es/api/modules/map.js +17 -11
- package/dist/es/api/modules/may-bank-qr-pay/index.js +8 -48
- package/dist/es/api/modules/nine-pay/index.js +8 -48
- package/dist/es/api/modules/paymaya/index.js +8 -48
- package/dist/es/api/modules/risk/index.js +2 -1
- package/dist/es/api/modules/sepa/index.js +10 -51
- package/dist/es/api/modules/shopee-pay/index.js +8 -48
- package/dist/es/api/modules/threeDS/index.js +3 -0
- package/dist/es/api/modules/tng-wallet/index.js +8 -48
- package/dist/es/api/modules/wechat-pay/index.js +10 -51
- package/dist/es/api/modules/zalopay/index.js +16 -0
- package/dist/es/api/utils/index.js +59 -0
- package/dist/es/components/AddressField/index.js +37 -37
- package/dist/es/components/AliPay/index.js +158 -111
- package/dist/es/components/ApplePay/index.js +99 -67
- package/dist/es/components/Boost/index.js +91 -70
- package/dist/es/components/Card/index.js +114 -107
- package/dist/es/components/CardSelector/index.js +1 -1
- package/dist/es/components/DropIn/index.js +12 -4
- package/dist/es/components/EncryptedCard/index.js +6 -2
- package/dist/es/components/GooglePay/index.js +94 -60
- package/dist/es/components/GrabPay/index.js +91 -70
- package/dist/es/components/GuideCard/index.js +10 -7
- package/dist/es/components/LinePay/index.js +91 -70
- package/dist/es/components/MayBankQRPay/index.js +302 -275
- package/dist/es/components/NinePay/index.js +91 -70
- package/dist/es/components/SecuredFieldsProvider/index.js +26 -9
- package/dist/es/components/SecuredIframe/index.js +40 -61
- package/dist/es/components/Sepa/index.js +72 -53
- package/dist/es/components/ShopeePay/index.js +91 -70
- package/dist/es/components/SubmitButton/index.js +8 -7
- package/dist/es/components/TNGWallet/index.js +91 -70
- package/dist/es/components/ThreeDS/index.js +32 -7
- package/dist/es/components/WechatPay/index.js +151 -102
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +26 -6
- package/dist/es/components/index.js +1 -0
- package/dist/es/components/internal/Form/FormItem.js +1 -1
- package/dist/es/components/internal/Form/util.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js +1 -1
- package/dist/es/components/internal/Select/Select.js +19 -8
- package/dist/es/components/internal/Select/SelectMenu.js +2 -2
- package/dist/es/components/internal/Select/SelectMenuItem.js +12 -4
- package/dist/es/components/internal/icons/IconError.js +7 -4
- package/dist/es/components/internal/icons/IconZalopay.js +47 -0
- package/dist/es/components/internal/icons/IconZalopayComplete.js +48 -0
- package/dist/es/components/wallets/GCash/GCash.js +80 -56
- package/dist/es/components/wallets/Paymaya/Paymaya.js +91 -70
- package/dist/es/components/wallets/Zalopay/Zalopay.js +381 -0
- package/dist/es/components/wallets/Zalopay/index.js +1 -0
- package/dist/es/components/wallets/Zalopay/type.js +1 -0
- package/dist/es/components/wallets/Zalopay/zalopay2.js +1 -0
- package/dist/es/config.js +5 -5
- package/dist/es/constant.js +8 -2
- package/dist/es/core/{Address.js → address.js} +8 -16
- package/dist/es/core/{PayKKaCheckout.js → checkout.js} +101 -27
- package/dist/es/core/create.js +1 -1
- package/dist/es/core/query.js +3 -2
- package/dist/es/core/{Session.js → session.js} +28 -32
- package/dist/es/core/theme.js +65 -0
- package/dist/es/core.js +0 -4
- package/dist/es/hooks/usePayment.js +14 -0
- package/dist/es/i18n/locales/de-DE.js +3 -1
- package/dist/es/i18n/locales/en-GB.js +3 -1
- package/dist/es/i18n/locales/es-ES.js +3 -1
- package/dist/es/i18n/locales/fr-FR.js +3 -1
- package/dist/es/i18n/locales/ja-JP.js +3 -1
- package/dist/es/i18n/locales/ko-KR.js +3 -1
- package/dist/es/i18n/locales/nl-NL.js +3 -1
- package/dist/es/i18n/locales/pt-PT.js +3 -1
- package/dist/es/i18n/locales/ru-RU.js +3 -1
- package/dist/es/i18n/locales/zh-CN.js +3 -1
- package/dist/es/i18n/locales/zh-HK.js +3 -1
- package/dist/es/i18n/locales/zh-TW.js +3 -1
- package/dist/es/index.js +21 -7
- package/dist/es/style.css +1 -1
- package/dist/es/types/index.js +7 -0
- package/dist/es/utils/colors.js +5 -1
- package/dist/es/utils/format.js +0 -5
- package/dist/es/utils/object.js +31 -1
- package/dist/es/utils/payment.js +82 -0
- package/dist/es/utils/redirect.js +4 -4
- package/dist/es/utils/string.js +10 -0
- package/dist/es/utils/system-info/is-ua-webview.js +14 -12
- package/dist/es/utils/theme.js +7 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/address/index.d.ts +15 -6
- package/dist/types/api/modules/ali-pay/index.d.ts +3 -19
- package/dist/types/api/modules/apple-pay/index.d.ts +4 -14
- package/dist/types/api/modules/boost/index.d.ts +3 -23
- package/dist/types/api/modules/card/index.d.ts +3 -30
- package/dist/types/api/modules/checkout/index.d.ts +3 -3
- package/dist/types/api/modules/checkout/map.d.ts +3 -3
- package/dist/types/api/modules/checkout/type.d.ts +33 -4
- package/dist/types/api/modules/gcash/index.d.ts +3 -23
- package/dist/types/api/modules/get-browser-params.d.ts +1 -0
- package/dist/types/api/modules/google-pay/index.d.ts +3 -13
- package/dist/types/api/modules/grab-pay/index.d.ts +3 -23
- package/dist/types/api/modules/index.d.ts +1 -0
- package/dist/types/api/modules/line-pay/index.d.ts +3 -23
- package/dist/types/api/modules/map.d.ts +2 -2
- package/dist/types/api/modules/may-bank-qr-pay/index.d.ts +3 -23
- package/dist/types/api/modules/nine-pay/index.d.ts +3 -23
- package/dist/types/api/modules/paymaya/index.d.ts +3 -23
- package/dist/types/api/modules/sepa/index.d.ts +3 -24
- package/dist/types/api/modules/shopee-pay/index.d.ts +3 -23
- package/dist/types/api/modules/tng-wallet/index.d.ts +3 -23
- package/dist/types/api/modules/type.d.ts +74 -21
- package/dist/types/api/modules/wechat-pay/index.d.ts +3 -20
- package/dist/types/api/modules/zalopay/index.d.ts +4 -0
- package/dist/types/api/utils/index.d.ts +48 -0
- package/dist/types/components/AddressField/type.d.ts +3 -9
- package/dist/types/components/AliPay/AliPay.d.ts +6 -2
- package/dist/types/components/AliPay/type.d.ts +15 -2
- package/dist/types/components/ApplePay/ApplePay.d.ts +6 -2
- package/dist/types/components/ApplePay/type.d.ts +10 -14
- package/dist/types/components/ApplePay/utils.d.ts +1 -1
- package/dist/types/components/Boost/Boost.d.ts +6 -2
- package/dist/types/components/Boost/type.d.ts +2 -24
- package/dist/types/components/Card/Card.d.ts +6 -2
- package/dist/types/components/Card/type.d.ts +3 -43
- package/dist/types/components/DropIn/DropIn.d.ts +6 -2
- package/dist/types/components/DropIn/type.d.ts +4 -10
- package/dist/types/components/GooglePay/GooglePay.d.ts +6 -2
- package/dist/types/components/GooglePay/createGooglePay.d.ts +2 -1
- package/dist/types/components/GooglePay/type.d.ts +10 -26
- package/dist/types/components/GrabPay/GrabPay.d.ts +6 -2
- package/dist/types/components/GrabPay/type.d.ts +3 -25
- package/dist/types/components/LinePay/LinePay.d.ts +6 -2
- package/dist/types/components/LinePay/type.d.ts +3 -25
- package/dist/types/components/MayBankQRPay/MayBankQRPay.d.ts +6 -2
- package/dist/types/components/MayBankQRPay/type.d.ts +3 -25
- package/dist/types/components/NinePay/NinePay.d.ts +6 -2
- package/dist/types/components/NinePay/type.d.ts +3 -25
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +5 -0
- package/dist/types/components/SecuredIframe/HiddenIframe.d.ts +3 -1
- package/dist/types/components/Sepa/Sepa.d.ts +6 -2
- package/dist/types/components/Sepa/type.d.ts +3 -2
- package/dist/types/components/ShopeePay/ShopeePay.d.ts +6 -2
- package/dist/types/components/ShopeePay/type.d.ts +3 -25
- package/dist/types/components/TNGWallet/TNGWallet.d.ts +6 -2
- package/dist/types/components/TNGWallet/type.d.ts +3 -25
- package/dist/types/components/ThreeDS/components/ThreeDSAuth/type.d.ts +2 -0
- package/dist/types/components/WechatPay/WechatPay.d.ts +6 -2
- package/dist/types/components/WechatPay/type.d.ts +15 -2
- package/dist/types/components/business/QRCodeModal/type.d.ts +2 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/internal/Loading/Loading.d.ts +1 -0
- package/dist/types/components/internal/Select/SelectMenu.d.ts +1 -1
- package/dist/types/components/internal/icons/IconZalopay.d.ts +2 -0
- package/dist/types/components/internal/icons/IconZalopayComplete.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +3 -0
- package/dist/types/components/wallets/GCash/GCash.d.ts +6 -2
- package/dist/types/components/wallets/GCash/type.d.ts +3 -35
- package/dist/types/components/wallets/Paymaya/Paymaya.d.ts +6 -2
- package/dist/types/components/wallets/Paymaya/type.d.ts +3 -25
- package/dist/types/components/wallets/Zalopay/Zalopay.d.ts +10 -0
- package/dist/types/components/wallets/Zalopay/index.d.ts +2 -0
- package/dist/types/components/wallets/Zalopay/type.d.ts +39 -0
- package/dist/types/config.d.ts +2 -4
- package/dist/types/constant.d.ts +3 -1
- package/dist/types/core/{Address.d.ts → address.d.ts} +23 -24
- package/dist/types/core/{PayKKaCheckout.d.ts → checkout.d.ts} +9 -3
- package/dist/types/core/context.d.ts +3 -2
- package/dist/types/core/index.d.ts +3 -2
- package/dist/types/core/query.d.ts +2 -2
- package/dist/types/core/session.d.ts +23 -0
- package/dist/types/core/theme.d.ts +7 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/usePayment.d.ts +8 -0
- package/dist/types/i18n/locales/de-DE.d.ts +2 -0
- package/dist/types/i18n/locales/en-GB.d.ts +2 -0
- package/dist/types/i18n/locales/es-ES.d.ts +2 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +2 -0
- package/dist/types/i18n/locales/ja-JP.d.ts +2 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +2 -0
- package/dist/types/i18n/locales/nl-NL.d.ts +2 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +2 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +2 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +2 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +2 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +2 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types/index.d.ts +70 -32
- package/dist/types/types/message.d.ts +30 -25
- package/dist/types/utils/card-brand/index.d.ts +3 -3
- package/dist/types/utils/colors.d.ts +1 -0
- package/dist/types/utils/index.d.ts +4 -2
- package/dist/types/utils/object.d.ts +7 -0
- package/dist/types/utils/payment.d.ts +37 -0
- package/dist/types/utils/string.d.ts +1 -0
- package/dist/types/utils/style.d.ts +1 -1
- package/dist/types/utils/system-info/is-ua-webview.d.ts +1 -1
- package/dist/types/utils/theme.d.ts +4 -0
- package/package.json +3 -3
- package/dist/es/utils/deep-freeze.js +0 -13
- package/dist/es/utils/obj.js +0 -22
- package/dist/types/core/Session.d.ts +0 -16
- package/dist/types/utils/deep-freeze.d.ts +0 -1
- package/dist/types/utils/obj.d.ts +0 -6
|
@@ -1,61 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
async
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const extraParams = _getExtraParams == null ? void 0 : _getExtraParams("payment", PaymentMethod.GOOGLE_PAY);
|
|
16
|
-
const params = deepMerge({
|
|
17
|
-
bill: {
|
|
18
|
-
first_name: bill == null ? void 0 : bill.firstName,
|
|
19
|
-
middle_name: bill == null ? void 0 : bill.middleName,
|
|
20
|
-
last_name: bill == null ? void 0 : bill.lastName,
|
|
21
|
-
address_line1: bill == null ? void 0 : bill.addressLine1,
|
|
22
|
-
address_line2: bill == null ? void 0 : bill.addressLine2,
|
|
23
|
-
country: bill == null ? void 0 : bill.country,
|
|
24
|
-
state: bill == null ? void 0 : bill.state,
|
|
25
|
-
city: bill == null ? void 0 : bill.city,
|
|
26
|
-
email: bill == null ? void 0 : bill.email,
|
|
27
|
-
postal_code: bill == null ? void 0 : bill.postalCode,
|
|
28
|
-
area_code: bill == null ? void 0 : bill.areaCode,
|
|
29
|
-
phone_number: bill == null ? void 0 : bill.phoneNumber,
|
|
30
|
-
descriptor: bill == null ? void 0 : bill.descriptor
|
|
31
|
-
}
|
|
32
|
-
}, extraParams || {});
|
|
33
|
-
return http.post(
|
|
34
|
-
"/session/payments",
|
|
35
|
-
{
|
|
36
|
-
...params,
|
|
37
|
-
session_id: sessionId,
|
|
38
|
-
client_key: clientKey,
|
|
39
|
-
payment: {
|
|
40
|
-
payment_method: PaymentMethod.GOOGLE_PAY,
|
|
41
|
-
token_data: token
|
|
42
|
-
},
|
|
43
|
-
browser
|
|
44
|
-
},
|
|
45
|
-
options
|
|
46
|
-
).then(payResMap);
|
|
47
|
-
}
|
|
48
|
-
async function getGooglePayInfo({ sessionId, clientKey }, options) {
|
|
49
|
-
return http.post(
|
|
50
|
-
"/session/payments/query",
|
|
51
|
-
{
|
|
52
|
-
session_id: sessionId,
|
|
53
|
-
client_key: clientKey,
|
|
54
|
-
payment_method: PaymentMethod.GOOGLE_PAY
|
|
55
|
-
},
|
|
56
|
-
options
|
|
57
|
-
).then(payResMap);
|
|
58
|
-
}
|
|
5
|
+
const googlePay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
+
};
|
|
9
|
+
const getGooglePayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
+
};
|
|
59
13
|
export {
|
|
60
14
|
getGooglePayInfo,
|
|
61
15
|
googlePay
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
const grabPay = async ({
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
5
|
+
const grabPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getGrabPayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.GRAB_PAY
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getGrabPayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getGrabPayInfo,
|
|
@@ -1,54 +1,14 @@
|
|
|
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
1
|
import { http } from "../../http.js";
|
|
6
2
|
import { payResMap } from "../map.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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);
|
|
3
|
+
import { apiPrefix } from "../../../config.js";
|
|
4
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
|
+
const linePay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getLinePayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.LINE_PAY
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getLinePayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getLinePayInfo,
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
const amountMap = (res) => {
|
|
2
2
|
return {
|
|
3
3
|
amount: res == null ? void 0 : res.amount,
|
|
4
4
|
currency: res == null ? void 0 : res.currency,
|
|
5
5
|
symbol: res == null ? void 0 : res.symbol,
|
|
6
6
|
digits: res == null ? void 0 : res.default_fraction_digits
|
|
7
7
|
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
var _a
|
|
8
|
+
};
|
|
9
|
+
const payResMap = (res) => {
|
|
10
|
+
var _a;
|
|
11
|
+
const payInfo = res.pay_info || {};
|
|
11
12
|
return {
|
|
13
|
+
sessionId: res.session_id,
|
|
14
|
+
merchantId: res.merchant_id,
|
|
12
15
|
errorCode: res.error_code,
|
|
13
16
|
errorMessage: res.error_description,
|
|
14
|
-
merchantId: res.merchant_id,
|
|
15
|
-
sessionId: res.session_id,
|
|
16
17
|
orderId: res.order_id,
|
|
17
18
|
transAmount: amountMap(res.trans_amount),
|
|
18
19
|
status: res.status,
|
|
19
20
|
orderStatus: res.order_status,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
paymentMethod: res.payment_method,
|
|
22
|
+
finishTime: res.utc_finish_time,
|
|
23
|
+
payInfo: {
|
|
24
|
+
threeDSUrl: (_a = res.authentication_result) == null ? void 0 : _a.authentication_url,
|
|
25
|
+
paymentUrl: payInfo.payment_url,
|
|
26
|
+
paymentExpiredAt: res == null ? void 0 : res.payment_expire_time,
|
|
27
|
+
...payInfo
|
|
28
|
+
},
|
|
29
|
+
rawResponse: res
|
|
24
30
|
};
|
|
25
|
-
}
|
|
31
|
+
};
|
|
26
32
|
export {
|
|
27
33
|
amountMap,
|
|
28
34
|
payResMap
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
6
3
|
import { payResMap } from "../map.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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);
|
|
4
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
|
+
const mayBankQRPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getMayBankQRPayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.MAY_BANK_QR_PAY
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getMayBankQRPayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getMayBankQRPayInfo,
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
const ninePay = async ({
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
5
|
+
const ninePay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getNinePayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.NINE_PAY
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getNinePayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getNinePayInfo,
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
2
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
3
|
import { http } from "../../http.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
const paymayaPay = async ({
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
5
|
+
const paymayaPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getPaymayaPayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.PAYMAYA
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getPaymayaPayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getPaymayaPayInfo,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
1
2
|
import { http } from "../../http.js";
|
|
2
3
|
const getRiskAuthorization = async (params, options) => {
|
|
3
|
-
return http.post(
|
|
4
|
+
return http.post(`${apiPrefix}/fraud-detection/component/authorization`, params, options).then((res) => {
|
|
4
5
|
return {
|
|
5
6
|
authCode: res.auth_code,
|
|
6
7
|
channel: res.channel,
|
|
@@ -1,56 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
async
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
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 || {});
|
|
28
|
-
return http.post(
|
|
29
|
-
"/session/payments",
|
|
30
|
-
{
|
|
31
|
-
...params,
|
|
32
|
-
session_id: sessionId,
|
|
33
|
-
client_key: clientKey,
|
|
34
|
-
payment: {
|
|
35
|
-
iban: payment.iban,
|
|
36
|
-
payment_method: PaymentMethod.SEPA_DEBIT,
|
|
37
|
-
holder_name: payment.holderName
|
|
38
|
-
},
|
|
39
|
-
browser
|
|
40
|
-
},
|
|
41
|
-
options
|
|
42
|
-
).then(payResMap);
|
|
43
|
-
}
|
|
44
|
-
async function getSepaPayInfo({ sessionId, clientKey }, options) {
|
|
45
|
-
return http.post(
|
|
46
|
-
"/session/payments/query",
|
|
47
|
-
{
|
|
48
|
-
session_id: sessionId,
|
|
49
|
-
client_key: clientKey
|
|
50
|
-
},
|
|
51
|
-
options
|
|
52
|
-
).then(payResMap);
|
|
53
|
-
}
|
|
5
|
+
const sepaPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
+
};
|
|
9
|
+
const getSepaPayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
+
};
|
|
54
13
|
export {
|
|
55
14
|
getSepaPayInfo,
|
|
56
15
|
sepaPay
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
const shopeePay = async ({
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
5
|
+
const shopeePay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getShopeePayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.SHOPEE_PAY
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getShopeePayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getShopeePayInfo,
|
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../../utils/card-brand/brands.js";
|
|
3
|
-
import "../../../utils/system-info/get-browser-info.js";
|
|
4
|
-
import { deepMerge } from "../../../utils/object.js";
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
5
2
|
import { http } from "../../http.js";
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
6
4
|
import { payResMap } from "../map.js";
|
|
7
|
-
const tngWalletPay = async ({
|
|
8
|
-
|
|
9
|
-
|
|
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);
|
|
5
|
+
const tngWalletPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
41
8
|
};
|
|
42
|
-
const getTNGWalletPayInfo = async (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
session_id: sessionId,
|
|
47
|
-
client_key: clientKey,
|
|
48
|
-
payment_method: PaymentMethod.TNG_WALLET
|
|
49
|
-
},
|
|
50
|
-
options
|
|
51
|
-
).then(payResMap);
|
|
9
|
+
const getTNGWalletPayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
52
12
|
};
|
|
53
13
|
export {
|
|
54
14
|
getTNGWalletPayInfo,
|