@paykka/card-checkout-ui 0.11.6 → 0.13.1
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 +17 -17
- package/dist/card-checkout-ui.umd.cjs +17 -17
- 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/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 +143 -90
- package/dist/es/components/ApplePay/index.js +99 -67
- package/dist/es/components/Boost/index.js +66 -39
- package/dist/es/components/Card/index.js +90 -79
- 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 +1 -1
- package/dist/es/components/GooglePay/index.js +93 -60
- package/dist/es/components/GrabPay/index.js +66 -39
- package/dist/es/components/GuideCard/index.js +10 -7
- package/dist/es/components/LinePay/index.js +66 -39
- package/dist/es/components/MayBankQRPay/index.js +306 -273
- package/dist/es/components/NinePay/index.js +66 -39
- package/dist/es/components/SecuredFieldsProvider/index.js +3 -2
- package/dist/es/components/SecuredIframe/index.js +4 -2
- package/dist/es/components/Sepa/index.js +62 -39
- package/dist/es/components/ShopeePay/index.js +66 -39
- package/dist/es/components/SubmitButton/index.js +8 -7
- package/dist/es/components/TNGWallet/index.js +66 -39
- package/dist/es/components/WechatPay/index.js +146 -92
- package/dist/es/components/business/QRCodeModal/QRCodeModal.js +26 -6
- package/dist/es/components/index.js +1 -0
- 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/SelectMenuItem.js +12 -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 +68 -39
- package/dist/es/components/wallets/Paymaya/Paymaya.js +66 -39
- package/dist/es/components/wallets/Zalopay/Zalopay.js +386 -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} +78 -27
- package/dist/es/core/query.js +3 -2
- package/dist/es/core/{Session.js → session.js} +37 -20
- 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 +16 -4
- 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/payment.js +82 -0
- package/dist/es/utils/redirect.js +4 -4
- 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/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/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/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/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} +5 -3
- package/dist/types/core/context.d.ts +3 -2
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/core/query.d.ts +2 -2
- package/dist/types/core/session.d.ts +33 -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 +1 -0
- 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 +1 -0
- package/dist/types/utils/payment.d.ts +37 -0
- package/package.json +3 -3
- package/dist/types/core/Session.d.ts +0 -16
|
@@ -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,
|
|
@@ -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";
|
|
6
|
-
import {
|
|
3
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
7
4
|
import { payResMap } from "../map.js";
|
|
8
|
-
async
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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: PaymentMethod.WECHAT_PAY
|
|
36
|
-
},
|
|
37
|
-
browser: await getBrowserParams(),
|
|
38
|
-
channel_user_id: channelUserId
|
|
39
|
-
},
|
|
40
|
-
options
|
|
41
|
-
).then(payResMap);
|
|
42
|
-
}
|
|
43
|
-
async function getWechatPayInfo({ sessionId, clientKey }, options) {
|
|
44
|
-
return http.post(
|
|
45
|
-
"/session/payments/query",
|
|
46
|
-
{
|
|
47
|
-
session_id: sessionId,
|
|
48
|
-
client_key: clientKey,
|
|
49
|
-
payment_method: PaymentMethod.WECHAT_PAY
|
|
50
|
-
},
|
|
51
|
-
options
|
|
52
|
-
).then(payResMap);
|
|
53
|
-
}
|
|
5
|
+
const wechatPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
+
};
|
|
9
|
+
const getWechatPayInfo = 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
|
getWechatPayInfo,
|
|
56
15
|
wechatPay
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { apiPrefix } from "../../../config.js";
|
|
2
|
+
import { http } from "../../http.js";
|
|
3
|
+
import { payResMap } from "../map.js";
|
|
4
|
+
import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
|
|
5
|
+
const zalopayPay = async (params, extraParams, options) => {
|
|
6
|
+
const paymentParams = buildPaymentParams(params, extraParams);
|
|
7
|
+
return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
|
|
8
|
+
};
|
|
9
|
+
const getZalopayPayInfo = async (params, extraParams, options) => {
|
|
10
|
+
const queryParams = buildQueryParams(params, extraParams);
|
|
11
|
+
return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
getZalopayPayInfo,
|
|
15
|
+
zalopayPay
|
|
16
|
+
};
|