@paykka/card-checkout-ui 0.6.0 → 0.7.0
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 +12 -12
- package/dist/card-checkout-ui.umd.cjs +12 -12
- package/dist/es/api/index.js +0 -2
- package/dist/es/api/modules/checkout/index.js +1 -15
- package/dist/es/api/modules/checkout/map.js +20 -3
- package/dist/es/api/modules/index.js +0 -2
- package/dist/es/components/AccountNameField/index.js +0 -3
- package/dist/es/components/AddressField/index.js +2 -7
- package/dist/es/components/AliPay/index.js +8 -7
- package/dist/es/components/ApplePay/index.js +7 -8
- package/dist/es/components/Card/index.js +301 -125
- package/dist/es/components/CardBrands/index.js +0 -2
- package/dist/es/components/CardExpireDateField/index.js +1 -4
- package/dist/es/components/CardHolderNameField/index.js +3 -5
- package/dist/es/components/CardIBANField/index.js +0 -3
- package/dist/es/components/CardNo/index.js +0 -2
- package/dist/es/components/CardNumberField/index.js +1 -4
- package/dist/es/components/CardSecurityCodeField/index.js +1 -4
- package/dist/es/components/CardSelector/index.js +0 -3
- package/dist/es/components/CombinedCardInfo/index.js +99 -0
- package/dist/es/components/EmailField/EmailField.js +0 -3
- package/dist/es/components/EncryptedCard/index.js +35 -75
- package/dist/es/components/GooglePay/index.js +62 -28
- package/dist/es/components/RecurringTip/index.js +0 -2
- package/dist/es/components/SecuredFieldsProvider/index.js +230 -1
- package/dist/es/components/SecuredIframe/index.js +3 -1
- package/dist/es/components/Sepa/index.js +21 -27
- package/dist/es/components/SubmitButton/index.js +0 -2
- package/dist/es/components/ThreeDS/index.js +94 -0
- package/dist/es/components/WechatPay/index.js +26 -25
- package/dist/es/components/index.js +1 -3
- package/dist/es/components/internal/Button/Button.js +0 -2
- package/dist/es/components/internal/Button/index.js +0 -2
- package/dist/es/components/internal/CheckBox/CheckBox.js +0 -2
- package/dist/es/components/internal/CheckBox/index.js +0 -2
- package/dist/es/components/internal/Form/type.js +0 -2
- package/dist/es/components/internal/Info/Info.js +0 -2
- package/dist/es/components/internal/Info/index.js +0 -2
- package/dist/es/components/internal/Input/Input.js +2 -2
- package/dist/es/components/internal/Input/type.js +0 -2
- package/dist/es/components/internal/LoadingCheck/LoadingCheck.js +0 -2
- package/dist/es/components/internal/LoadingCheck/index.js +0 -2
- package/dist/es/components/internal/Modal/Modal.js +40 -0
- package/dist/es/components/internal/Modal/modal2.js +1 -0
- package/dist/es/components/internal/Select/Select.js +0 -2
- package/dist/es/components/internal/Select/SelectMenu.js +0 -2
- package/dist/es/components/internal/Select/SelectMenuItem.js +0 -2
- package/dist/es/components/internal/icons/Icon3DSFail.js +3 -0
- package/dist/es/components/internal/icons/Icon3DSInfo.js +62 -0
- package/dist/es/components/internal/icons/Icon3DSSuccess.js +3 -0
- package/dist/es/config.js +0 -2
- package/dist/es/constant.js +3 -2
- package/dist/es/core/PayKKaCheckout.js +96 -42
- package/dist/es/core/Session.js +7 -6
- package/dist/es/core/environment.js +26 -0
- package/dist/es/core/error.js +21 -0
- package/dist/es/core/index.js +0 -2
- package/dist/es/core/query.js +0 -2
- package/dist/es/core.js +34 -34
- package/dist/es/hooks/index.js +0 -2
- package/dist/es/hooks/useBreakpoints.js +57 -0
- package/dist/es/hooks/useI18n.js +1 -2
- package/dist/es/hooks/usePayState.js +18 -24
- package/dist/es/i18n/index.js +0 -2
- package/dist/es/i18n/locales/de-DE.js +11 -1
- package/dist/es/i18n/locales/en-GB.js +11 -1
- package/dist/es/i18n/locales/es-ES.js +11 -1
- package/dist/es/i18n/locales/fr-FR.js +11 -1
- package/dist/es/i18n/locales/index.js +8 -6
- package/dist/es/i18n/locales/ja-JP.js +11 -1
- package/dist/es/i18n/locales/ko-KR.js +11 -1
- package/dist/es/i18n/locales/pt-PT.js +11 -1
- package/dist/es/i18n/locales/ru-RU.js +11 -1
- package/dist/es/i18n/locales/zh-CN.js +11 -1
- package/dist/es/i18n/locales/zh-HK.js +11 -1
- package/dist/es/i18n/locales/zh-TW.js +11 -1
- package/dist/es/i18n/util.js +11 -8
- package/dist/es/index.js +4 -2
- package/dist/es/style.css +186 -4
- package/dist/es/types/message.js +28 -0
- package/dist/es/utils/card-brand/brands.js +12 -10
- package/dist/es/utils/card-brand/index.js +3 -2
- package/dist/es/utils/iframe.js +23 -0
- package/dist/es/utils/index.js +0 -1
- package/dist/es/utils/style.js +47 -0
- package/dist/style.css +1 -1
- package/dist/types/api/modules/checkout/type.d.ts +14 -1
- package/dist/types/api/modules/get-browser-params.d.ts +1 -1
- package/dist/types/components/AddressField/type.d.ts +1 -0
- package/dist/types/components/AliPay/type.d.ts +4 -2
- package/dist/types/components/ApplePay/type.d.ts +4 -3
- package/dist/types/components/Card/type.d.ts +56 -10
- package/dist/types/components/CardHolderNameField/type.d.ts +1 -1
- package/dist/types/components/CombinedCardInfo/CombinedCardInfo.d.ts +5 -0
- package/dist/types/components/CombinedCardInfo/index.d.ts +2 -0
- package/dist/types/components/{CombinedEncryptedField → CombinedCardInfo}/type.d.ts +3 -2
- package/dist/types/components/GooglePay/type.d.ts +4 -3
- package/dist/types/components/SecuredFieldsProvider/index.d.ts +1 -0
- package/dist/types/components/SecuredFieldsProvider/type.d.ts +1 -153
- package/dist/types/components/SecuredFieldsProvider/utils/index.d.ts +1 -1
- package/dist/types/components/SecuredIframe/useSecuredInput.d.ts +2 -1
- package/dist/types/components/Sepa/type.d.ts +4 -2
- package/dist/types/components/ThreeDS/components/ThreeDSAuth/ThreeDSAuth.d.ts +3 -0
- package/dist/types/components/ThreeDS/components/ThreeDSAuth/index.d.ts +2 -0
- package/dist/types/components/ThreeDS/components/ThreeDSAuth/type.d.ts +17 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/ThreeDSIframe.d.ts +2 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/index.d.ts +1 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/output.d.ts +1 -0
- package/dist/types/components/ThreeDS/components/ThreeDSIframe/type.d.ts +5 -0
- package/dist/types/components/ThreeDS/components/ThreeDSStatus/ThreeDSStatus.d.ts +3 -0
- package/dist/types/components/ThreeDS/components/ThreeDSStatus/output.d.ts +1 -0
- package/dist/types/components/ThreeDS/components/ThreeDSStatus/type.d.ts +6 -0
- package/dist/types/components/ThreeDS/index.d.ts +1 -0
- package/dist/types/components/WechatPay/type.d.ts +4 -2
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/internal/Input/type.d.ts +1 -0
- package/dist/types/components/internal/Loading/Loading.d.ts +1 -0
- package/dist/types/components/internal/Loading/index.d.ts +1 -0
- package/dist/types/components/internal/Modal/Modal.d.ts +5 -0
- package/dist/types/components/internal/Modal/index.d.ts +0 -0
- package/dist/types/components/internal/Modal/type.d.ts +20 -0
- package/dist/types/components/internal/icons/Icon3DSFail.d.ts +2 -0
- package/dist/types/components/internal/icons/Icon3DSInfo.d.ts +2 -0
- package/dist/types/components/internal/icons/Icon3DSSuccess.d.ts +2 -0
- package/dist/types/components/internal/icons/index.d.ts +3 -0
- package/dist/types/constant.d.ts +6 -2
- package/dist/types/core/PayKKaCheckout.d.ts +22 -6
- package/dist/types/core/Session.d.ts +1 -1
- package/dist/types/core/context.d.ts +1 -0
- package/dist/types/core/environment.d.ts +4 -0
- package/dist/types/core/error.d.ts +16 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useBreakpoints.d.ts +15 -0
- package/dist/types/hooks/usePayState.d.ts +3 -6
- package/dist/types/i18n/locales/de-DE.d.ts +8 -0
- package/dist/types/i18n/locales/en-GB.d.ts +8 -0
- package/dist/types/i18n/locales/es-ES.d.ts +8 -0
- package/dist/types/i18n/locales/fr-FR.d.ts +8 -0
- package/dist/types/i18n/locales/index.d.ts +2 -2
- package/dist/types/i18n/locales/ja-JP.d.ts +8 -0
- package/dist/types/i18n/locales/ko-KR.d.ts +8 -0
- package/dist/types/i18n/locales/pt-PT.d.ts +8 -0
- package/dist/types/i18n/locales/ru-RU.d.ts +8 -0
- package/dist/types/i18n/locales/zh-CN.d.ts +8 -0
- package/dist/types/i18n/locales/zh-HK.d.ts +8 -0
- package/dist/types/i18n/locales/zh-TW.d.ts +8 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts +39 -8
- package/dist/types/types/message.d.ts +170 -0
- package/dist/types/utils/card-brand/brands.d.ts +1 -8
- package/dist/types/utils/card-brand/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/style.d.ts +12 -0
- package/package.json +63 -63
- package/dist/es/components/CombinedEncryptedField/index.js +0 -75
- package/dist/es/components/SecuredFieldsProvider/SecuredFieldsProvider.js +0 -268
- package/dist/types/components/CombinedEncryptedField/CombinedEncryptedField.d.ts +0 -4
- package/dist/types/components/CombinedEncryptedField/index.d.ts +0 -2
- /package/dist/types/{components/SecuredFieldsProvider/utils → utils}/iframe.d.ts +0 -0
package/dist/es/api/index.js
CHANGED
|
@@ -12,23 +12,9 @@ async function queryCheckout({ sessionId, clientKey }, options) {
|
|
|
12
12
|
options
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
|
-
function getPaymentMethods({ sessionId, clientKey }, options) {
|
|
16
|
-
return http.post(
|
|
17
|
-
"/session/payment-methods",
|
|
18
|
-
{
|
|
19
|
-
session_id: sessionId,
|
|
20
|
-
client_key: clientKey
|
|
21
|
-
},
|
|
22
|
-
options
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
15
|
async function getCheckoutInfo({ sessionId, clientKey }, options) {
|
|
26
16
|
const checkoutInfo = await queryCheckout({ sessionId, clientKey }, options);
|
|
27
|
-
|
|
28
|
-
if (checkoutInfo) {
|
|
29
|
-
paymentMethods = await getPaymentMethods({ sessionId, clientKey }, options);
|
|
30
|
-
}
|
|
31
|
-
return checkoutMap({ ...checkoutInfo, ...paymentMethods });
|
|
17
|
+
return checkoutMap({ ...checkoutInfo, ...checkoutInfo == null ? void 0 : checkoutInfo.support_methods });
|
|
32
18
|
}
|
|
33
19
|
let getCheckoutInfoIns;
|
|
34
20
|
async function onceGetCheckoutInfo({ sessionId, clientKey }, options) {
|
|
@@ -34,15 +34,17 @@ function formatPaymentMethodInfo(paymentMethods = []) {
|
|
|
34
34
|
}
|
|
35
35
|
function checkoutMap(res = {}) {
|
|
36
36
|
var _a, _b, _c;
|
|
37
|
-
const { theme, bill, payment_methods } = res;
|
|
37
|
+
const { theme, bill, payment_methods, field } = res;
|
|
38
38
|
const paymentMethodsInfo = formatPaymentMethodInfo(payment_methods);
|
|
39
|
+
const sessionMode = res.session_mode === "HOST" ? "HOSTED" : res.session_mode;
|
|
39
40
|
return {
|
|
41
|
+
country: res.country,
|
|
40
42
|
merchantId: res.merchant_id,
|
|
41
43
|
sessionId: res.session_id,
|
|
42
44
|
status: res.status,
|
|
43
45
|
transAmount: amountMap(res.trans_amount),
|
|
44
46
|
expireTime: res.expire_time,
|
|
45
|
-
sessionMode
|
|
47
|
+
sessionMode,
|
|
46
48
|
merchantName: (_a = res.theme) == null ? void 0 : _a.merchant_name,
|
|
47
49
|
returnUrl: res.return_url,
|
|
48
50
|
locale: res.locale,
|
|
@@ -60,7 +62,8 @@ function checkoutMap(res = {}) {
|
|
|
60
62
|
addressLine1: bill == null ? void 0 : bill.address_line1,
|
|
61
63
|
addressLine2: bill == null ? void 0 : bill.address_line2,
|
|
62
64
|
email: bill == null ? void 0 : bill.email,
|
|
63
|
-
descriptor: bill == null ? void 0 : bill.descriptor
|
|
65
|
+
descriptor: bill == null ? void 0 : bill.descriptor,
|
|
66
|
+
country: bill == null ? void 0 : bill.country
|
|
64
67
|
},
|
|
65
68
|
tokens: (_b = res.tokens) == null ? void 0 : _b.map((card) => ({
|
|
66
69
|
token: card.token,
|
|
@@ -69,6 +72,20 @@ function checkoutMap(res = {}) {
|
|
|
69
72
|
billingAddressFilled: card.billing_address_filled
|
|
70
73
|
})),
|
|
71
74
|
storePaymentMethod: (_c = res.payment) == null ? void 0 : _c.store_payment_method,
|
|
75
|
+
field: {
|
|
76
|
+
holderName: {
|
|
77
|
+
show: !!(field == null ? void 0 : field.holder_name_display),
|
|
78
|
+
required: !!(field == null ? void 0 : field.holder_name_required)
|
|
79
|
+
},
|
|
80
|
+
email: {
|
|
81
|
+
show: !!(field == null ? void 0 : field.bill_email_display),
|
|
82
|
+
required: !!(field == null ? void 0 : field.bill_email_required)
|
|
83
|
+
},
|
|
84
|
+
address: {
|
|
85
|
+
show: !!(field == null ? void 0 : field.bill_address_display),
|
|
86
|
+
required: !!(field == null ? void 0 : field.bill_address_required)
|
|
87
|
+
}
|
|
88
|
+
},
|
|
72
89
|
...paymentMethodsInfo
|
|
73
90
|
};
|
|
74
91
|
}
|
|
@@ -2,9 +2,6 @@ import { u } from "../../core.js";
|
|
|
2
2
|
import "../../utils/card-brand/brands.js";
|
|
3
3
|
import "../../utils/system-info/get-browser-info.js";
|
|
4
4
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
5
|
-
import "../../core/context.js";
|
|
6
|
-
import "../../i18n/util.js";
|
|
7
|
-
import "../../i18n/locales/index.js";
|
|
8
5
|
import "../internal/Form/type.js";
|
|
9
6
|
import "../internal/Form/context.js";
|
|
10
7
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -4,12 +4,9 @@ import { EAddressType } from "../../constant.js";
|
|
|
4
4
|
import { createAddressCore } from "../../core/Address.js";
|
|
5
5
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
6
6
|
import { useI18n } from "../../hooks/useI18n.js";
|
|
7
|
-
import "../../core/context.js";
|
|
8
7
|
import { isArray, isNil } from "../../utils/is.js";
|
|
9
8
|
import "../../utils/card-brand/brands.js";
|
|
10
9
|
import "../../utils/system-info/get-browser-info.js";
|
|
11
|
-
import "../../i18n/util.js";
|
|
12
|
-
import "../../i18n/locales/index.js";
|
|
13
10
|
import "../internal/Form/type.js";
|
|
14
11
|
import "../internal/Form/context.js";
|
|
15
12
|
import { FormItem } from "../internal/Form/FormItem.js";
|
|
@@ -107,10 +104,8 @@ const AddressField = w((props, ref) => {
|
|
|
107
104
|
});
|
|
108
105
|
}
|
|
109
106
|
async function getDefaultCountry() {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const countryCode = (areaCode == null ? void 0 : areaCode[1]) ?? "US";
|
|
113
|
-
onSelectCountry(countryCode);
|
|
107
|
+
const countryCode = props.country;
|
|
108
|
+
onSelectCountry(countryCode || "");
|
|
114
109
|
onAddressChange({
|
|
115
110
|
country: addressState.country ?? "",
|
|
116
111
|
province: addressState.province ?? "",
|
|
@@ -7,8 +7,7 @@ import "../../utils/system-info/get-browser-info.js";
|
|
|
7
7
|
import { formatAmount } from "../../utils/format.js";
|
|
8
8
|
import { PaymentType } from "../../constant.js";
|
|
9
9
|
import { CoreContext } from "../../core/context.js";
|
|
10
|
-
import "../../
|
|
11
|
-
import "../../i18n/locales/index.js";
|
|
10
|
+
import { PayKKaError } from "../../core/error.js";
|
|
12
11
|
import { createAddressCore } from "../../core/Address.js";
|
|
13
12
|
import { useBEM } from "../../hooks/useBEM.js";
|
|
14
13
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
@@ -24,9 +23,10 @@ import { RecurringTip } from "../RecurringTip/index.js";
|
|
|
24
23
|
import { SubmitButton } from "../SubmitButton/index.js";
|
|
25
24
|
const { bem } = useBEM("ali-pay");
|
|
26
25
|
const AliPay = w((props, ref) => {
|
|
26
|
+
const { session } = props;
|
|
27
27
|
let addressState = createAddressCore();
|
|
28
28
|
let emailState = createEmailCore();
|
|
29
|
-
const { setErrorMsg, i18n,
|
|
29
|
+
const { setErrorMsg, i18n, errorMsg, sessionReady } = usePayState(session);
|
|
30
30
|
const [submitButtonStatus, setSubmitButtonStatus] = h("unSubmit");
|
|
31
31
|
const formRef = A(null);
|
|
32
32
|
const [form, setForm] = h({
|
|
@@ -131,7 +131,7 @@ const AliPay = w((props, ref) => {
|
|
|
131
131
|
},
|
|
132
132
|
{ locale: i18n.locale, timeout }
|
|
133
133
|
);
|
|
134
|
-
const { status, orderStatus, errorMessage } = res;
|
|
134
|
+
const { status, orderStatus, errorMessage, errorCode } = res;
|
|
135
135
|
!search && ((_a = props.onSubmitResponse) == null ? void 0 : _a.call(props, res));
|
|
136
136
|
if (status === "PROCESSING") {
|
|
137
137
|
if (!orderStatus) {
|
|
@@ -145,7 +145,7 @@ const AliPay = w((props, ref) => {
|
|
|
145
145
|
} else if (orderStatus === "FAILURE") {
|
|
146
146
|
setErrorMsg(errorMessage);
|
|
147
147
|
setSubmitButtonStatus("unSubmit");
|
|
148
|
-
(_c = props.onError) == null ? void 0 : _c.call(props, "
|
|
148
|
+
(_c = props.onError) == null ? void 0 : _c.call(props, new PayKKaError("API_ERROR", errorMessage, { code: errorCode }));
|
|
149
149
|
return {
|
|
150
150
|
end: true
|
|
151
151
|
};
|
|
@@ -188,8 +188,9 @@ const AliPay = w((props, ref) => {
|
|
|
188
188
|
return { end: true };
|
|
189
189
|
}
|
|
190
190
|
} else {
|
|
191
|
-
|
|
192
|
-
(
|
|
191
|
+
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
192
|
+
setErrorMsg(message);
|
|
193
|
+
(_h = props.onError) == null ? void 0 : _h.call(props, new PayKKaError("API_ERROR", message, { code: error.code, cause: error }));
|
|
193
194
|
setSubmitButtonStatus("unSubmit");
|
|
194
195
|
return { end: true };
|
|
195
196
|
}
|
|
@@ -8,8 +8,7 @@ import "../../core/context.js";
|
|
|
8
8
|
import "../../utils/card-brand/brands.js";
|
|
9
9
|
import "../../utils/system-info/get-browser-info.js";
|
|
10
10
|
import { parseE164, underscoreToUpperCamelCase } from "../../utils/format.js";
|
|
11
|
-
import "../../
|
|
12
|
-
import "../../i18n/locales/index.js";
|
|
11
|
+
import { PayKKaError } from "../../core/error.js";
|
|
13
12
|
import { usePayState } from "../../hooks/usePayState.js";
|
|
14
13
|
import { useRetry } from "../../hooks/useRetry.js";
|
|
15
14
|
import { Info } from "../internal/Info/Info.js";
|
|
@@ -44,8 +43,9 @@ async function applePayEnv(id) {
|
|
|
44
43
|
}
|
|
45
44
|
const { bem } = useBEM("apple-pay");
|
|
46
45
|
const ApplePay = w((props) => {
|
|
46
|
+
const { session } = props;
|
|
47
47
|
let applePaySession;
|
|
48
|
-
const { i18n,
|
|
48
|
+
const { i18n, sessionReady, fraudDetection } = usePayState(session);
|
|
49
49
|
const [errorMsg, setErrorMsg] = h("");
|
|
50
50
|
const [showApplePay, setShowApplePay] = h(false);
|
|
51
51
|
const getPaymentSuccessData = () => ({
|
|
@@ -62,7 +62,7 @@ const ApplePay = w((props) => {
|
|
|
62
62
|
}
|
|
63
63
|
loadApplePayJS(
|
|
64
64
|
async () => {
|
|
65
|
-
var _a2, _b, _c, _d
|
|
65
|
+
var _a2, _b, _c, _d;
|
|
66
66
|
const envSupported = await applePayEnv(
|
|
67
67
|
(_c = (_b = (_a2 = session == null ? void 0 : session.checkout) == null ? void 0 : _a2.channelParams) == null ? void 0 : _b.applePay) == null ? void 0 : _c.merchantIdentifier
|
|
68
68
|
);
|
|
@@ -71,7 +71,6 @@ const ApplePay = w((props) => {
|
|
|
71
71
|
}
|
|
72
72
|
setShowApplePay(true);
|
|
73
73
|
(_d = props.onLoad) == null ? void 0 : _d.call(props, true);
|
|
74
|
-
console.log((_e = ApplePaySession.canMakePayments) == null ? void 0 : _e.call(ApplePaySession));
|
|
75
74
|
},
|
|
76
75
|
() => {
|
|
77
76
|
var _a2;
|
|
@@ -139,7 +138,7 @@ const ApplePay = w((props) => {
|
|
|
139
138
|
{ locale: i18n.locale }
|
|
140
139
|
);
|
|
141
140
|
}());
|
|
142
|
-
const { status, orderStatus, errorMessage } = res;
|
|
141
|
+
const { status, orderStatus, errorMessage, errorCode } = res;
|
|
143
142
|
if (status === "PROCESSING") {
|
|
144
143
|
if (orderStatus === "SUCCESS") {
|
|
145
144
|
applePaySession.completePayment({
|
|
@@ -156,7 +155,7 @@ const ApplePay = w((props) => {
|
|
|
156
155
|
};
|
|
157
156
|
} else if (orderStatus === "FAILURE") {
|
|
158
157
|
setErrorMsg(errorMessage);
|
|
159
|
-
(_b = props.onError) == null ? void 0 : _b.call(props, "
|
|
158
|
+
(_b = props.onError) == null ? void 0 : _b.call(props, new PayKKaError("API_ERROR", errorMessage, { code: errorCode }));
|
|
160
159
|
applePaySession.completePayment({
|
|
161
160
|
status: 1,
|
|
162
161
|
errors: [new ApplePayError("unknown", void 0, errorMessage)]
|
|
@@ -211,7 +210,7 @@ const ApplePay = w((props) => {
|
|
|
211
210
|
} else {
|
|
212
211
|
const message = error.i18nKey ? i18n.get(error.i18nKey) : error.message;
|
|
213
212
|
setErrorMsg(message);
|
|
214
|
-
(_g = props.onError) == null ? void 0 : _g.call(props, error);
|
|
213
|
+
(_g = props.onError) == null ? void 0 : _g.call(props, new PayKKaError("API_ERROR", message, { code: error.code, cause: error }));
|
|
215
214
|
applePaySession.completePayment({
|
|
216
215
|
status: 1,
|
|
217
216
|
errors: [new ApplePayError("unknown", void 0, message)]
|