@alipay/ams-checkout 1.7.1 → 1.9.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/umd/ams-checkout.min.js +1 -1
- package/esm/common/applepay/index.d.ts +48 -0
- package/esm/common/applepay/index.js +171 -0
- package/esm/common/applepay/interface.d.ts +102 -0
- package/esm/common/applepay/interface.js +1 -0
- package/esm/config/index.js +3 -3
- package/esm/config/request.js +3 -3
- package/esm/constant/index.d.ts +5 -0
- package/esm/constant/index.js +5 -0
- package/esm/core/applepay/index.d.ts +31 -0
- package/esm/core/applepay/index.js +369 -0
- package/esm/core/component/index.d.ts +3 -1
- package/esm/core/component/index.js +5 -2
- package/esm/index.d.ts +3 -0
- package/esm/index.js +18 -8
- package/esm/plugin/component/cashierApp.d.ts +1 -2
- package/esm/plugin/component/cashierApp.js +2 -2
- package/esm/plugin/component/component.popup.style.js +1 -1
- package/esm/plugin/component/index.d.ts +8 -1
- package/esm/plugin/component/index.js +148 -65
- package/esm/request/index.js +14 -8
- package/esm/service/index.d.ts +9 -1
- package/esm/service/index.js +31 -0
- package/esm/types/index.d.ts +61 -7
- package/esm/types/index.js +16 -0
- package/esm/util/logger.d.ts +1 -1
- package/esm/util/logger.js +3 -1
- package/esm/util/security.d.ts +1 -0
- package/esm/util/security.js +1 -1
- package/package.json +56 -1
package/esm/types/index.d.ts
CHANGED
@@ -24,6 +24,8 @@ export interface IoptionsParams {
|
|
24
24
|
};
|
25
25
|
product?: string;
|
26
26
|
}
|
27
|
+
export interface IApplePayOptionsParams extends Pick<IoptionsParams, 'locale' | 'environment' | 'onEventCallback' | 'analytics'> {
|
28
|
+
}
|
27
29
|
export type Iselector = string;
|
28
30
|
export declare enum renderDisplayTypeEnum {
|
29
31
|
'popup' = "popup",
|
@@ -42,6 +44,7 @@ export declare enum componentSignEnum {
|
|
42
44
|
'EASY_PAY_WALLET' = "EASY_PAY_WALLET",
|
43
45
|
'CASHIER_PAYMENT_CARD' = "CASHIER_PAYMENT_CARD",
|
44
46
|
'CASHIER_PAYMENT_BANK' = "CASHIER_PAYMENT_BANK",
|
47
|
+
'CASHIER_PAYMENT_APM' = "CASHIER_PAYMENT_APM",
|
45
48
|
'AUTO_DEBIT_WALLET' = "AUTO_DEBIT_WALLET",
|
46
49
|
'NONE' = "NONE",
|
47
50
|
'VAULTING_CARD' = "VAULTING_CARD"
|
@@ -51,12 +54,14 @@ export declare enum productSceneEnum {
|
|
51
54
|
'CASHIER_PAYMENT' = "CASHIER_PAYMENT",
|
52
55
|
'AUTO_DEBIT' = "AUTO_DEBIT",
|
53
56
|
'VAULTING' = "VAULTING",
|
54
|
-
'FLASH_BUY' = "FLASH_BUY"
|
57
|
+
'FLASH_BUY' = "FLASH_BUY",
|
58
|
+
'CARD_APPLE_PAY' = "CARD_APPLE_PAY"
|
55
59
|
}
|
56
60
|
export declare enum paymentMethodCategoryTypeEnum {
|
57
61
|
'CARD' = "CARD",
|
58
62
|
'WALLET' = "WALLET",
|
59
|
-
'BANK' = "BANK"
|
63
|
+
'BANK' = "BANK",
|
64
|
+
'APM' = "APM"
|
60
65
|
}
|
61
66
|
export interface DeviceIdParameter {
|
62
67
|
scene?: string;
|
@@ -68,14 +73,21 @@ export interface DeviceIdParameter {
|
|
68
73
|
export interface IcreateComponent {
|
69
74
|
sessionData: string;
|
70
75
|
paymentSessionData?: string;
|
71
|
-
appearance?: Record<string, any>;
|
72
76
|
notRedirectAfterComplete?: boolean;
|
77
|
+
appearance?: Record<string, any>;
|
78
|
+
merchantAppointParam?: IMerchantAppointParam;
|
73
79
|
}
|
74
80
|
export interface IappendIframeNodesParams extends IcreateComponent {
|
75
81
|
paymentSessionMetaData: IpaymentSessionMetaData;
|
76
82
|
renderDisplayType: renderDisplayTypeEnum;
|
77
83
|
selector?: Iselector;
|
78
84
|
}
|
85
|
+
export interface IMerchantAppointParam {
|
86
|
+
storedCard?: IStoredCard;
|
87
|
+
}
|
88
|
+
export interface IStoredCard {
|
89
|
+
needCVV?: boolean;
|
90
|
+
}
|
79
91
|
export interface IbillingAddress {
|
80
92
|
region?: string;
|
81
93
|
address1?: string;
|
@@ -122,6 +134,26 @@ export interface IpaymentSessionMetaData {
|
|
122
134
|
autoDebitWithToken: boolean;
|
123
135
|
skipSdkQuery: boolean;
|
124
136
|
};
|
137
|
+
paymentSessionFactor?: {
|
138
|
+
applePay?: {
|
139
|
+
merchantCapabilities?: string[];
|
140
|
+
supportedNetworks?: string[];
|
141
|
+
};
|
142
|
+
merchantInfo?: {
|
143
|
+
registeredCountry?: string;
|
144
|
+
partnerId?: string;
|
145
|
+
};
|
146
|
+
order?: {
|
147
|
+
orderDescription?: string;
|
148
|
+
};
|
149
|
+
paymentAmount?: {
|
150
|
+
value?: string;
|
151
|
+
currency?: string;
|
152
|
+
};
|
153
|
+
paymentMethodInfo?: {
|
154
|
+
paymentMethodType?: string;
|
155
|
+
};
|
156
|
+
};
|
125
157
|
}
|
126
158
|
export declare enum localeEnum {
|
127
159
|
'en-US' = "en-US"
|
@@ -240,7 +272,8 @@ export interface Ianalytics {
|
|
240
272
|
}
|
241
273
|
export declare enum targetEnum {
|
242
274
|
BLANK = "_blank",
|
243
|
-
SELF = "_self"
|
275
|
+
SELF = "_self",
|
276
|
+
REPLACE = "_replace"
|
244
277
|
}
|
245
278
|
export declare enum errorEnum {
|
246
279
|
PARAMS = "PARAMS",
|
@@ -281,6 +314,7 @@ export interface CashierSdkActionQueryRequest {
|
|
281
314
|
paymentSessionConfig?: IpaymentSessionConfig;
|
282
315
|
paymentMethodType?: string;
|
283
316
|
notRedirectAfterComplete?: boolean;
|
317
|
+
merchantAppointParam?: IMerchantAppointParam;
|
284
318
|
extParams?: any;
|
285
319
|
}
|
286
320
|
export interface CashierSubmitPayRequest {
|
@@ -323,9 +357,26 @@ export interface CashierSdkActionQueryResult {
|
|
323
357
|
schemeUrl?: string;
|
324
358
|
authUrl?: string;
|
325
359
|
}
|
360
|
+
/**
|
361
|
+
* Get App Pay Payment Session Request.
|
362
|
+
*/
|
363
|
+
export interface ApplePayPaymentSessionRequest {
|
364
|
+
validateUrl: string;
|
365
|
+
paymentSessionData: string;
|
366
|
+
}
|
367
|
+
/**
|
368
|
+
* Get App Pay Payment Session Result.
|
369
|
+
*/
|
370
|
+
export interface ApplePayPaymentSessionResult {
|
371
|
+
merchantSessionObject: string;
|
372
|
+
success: boolean;
|
373
|
+
errorCode?: string;
|
374
|
+
errorMessage?: string;
|
375
|
+
message?: string;
|
376
|
+
}
|
326
377
|
export declare enum redirectTypeEnum {
|
327
|
-
UNSAFE_BROWSER = "UNSAFE_BROWSER"
|
328
|
-
SAFETY_BROWSER = "SAFETY_BROWSER"
|
378
|
+
UNSAFE_BROWSER = "UNSAFE_BROWSER",// 非安全浏览器
|
379
|
+
SAFETY_BROWSER = "SAFETY_BROWSER",// 安全浏览器
|
329
380
|
INVOKE_SDK = "INVOKE_SDK"
|
330
381
|
}
|
331
382
|
export interface ActionForm {
|
@@ -355,7 +406,10 @@ export declare enum eventCodeEnum {
|
|
355
406
|
SDK_INIT_PARAMETER_ERROR = "SDK_INIT_PARAMETER_ERROR",
|
356
407
|
SDK_CREATECOMPONENT_ERROR = "SDK_CREATECOMPONENT_ERROR",
|
357
408
|
SDK_CALL_URL_ERROR = "SDK_CALL_URL_ERROR",
|
358
|
-
SDK_CALL_URL_SUCCESS = "SDK_CALL_URL_SUCCESS"
|
409
|
+
SDK_CALL_URL_SUCCESS = "SDK_CALL_URL_SUCCESS",
|
410
|
+
SDK_PAYMENT_FINISH = "SDK_PAYMENT_FINISH",
|
411
|
+
SDK_PAYMENT_FAIL = "SDK_PAYMENT_FAIL",
|
412
|
+
SDK_PAYMENT_CANCEL = "SDK_PAYMENT_CANCEL"
|
359
413
|
}
|
360
414
|
export declare enum RedirectType {
|
361
415
|
ApplinkUrl = "ApplinkUrl",
|
package/esm/types/index.js
CHANGED
@@ -19,6 +19,7 @@ export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
|
|
19
19
|
componentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
|
20
20
|
componentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
|
21
21
|
componentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
|
22
|
+
componentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
|
22
23
|
componentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
|
23
24
|
componentSignEnum["NONE"] = "NONE";
|
24
25
|
componentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
@@ -30,12 +31,14 @@ export var productSceneEnum = /*#__PURE__*/function (productSceneEnum) {
|
|
30
31
|
productSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
|
31
32
|
productSceneEnum["VAULTING"] = "VAULTING";
|
32
33
|
productSceneEnum["FLASH_BUY"] = "FLASH_BUY";
|
34
|
+
productSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
|
33
35
|
return productSceneEnum;
|
34
36
|
}({});
|
35
37
|
export var paymentMethodCategoryTypeEnum = /*#__PURE__*/function (paymentMethodCategoryTypeEnum) {
|
36
38
|
paymentMethodCategoryTypeEnum["CARD"] = "CARD";
|
37
39
|
paymentMethodCategoryTypeEnum["WALLET"] = "WALLET";
|
38
40
|
paymentMethodCategoryTypeEnum["BANK"] = "BANK";
|
41
|
+
paymentMethodCategoryTypeEnum["APM"] = "APM";
|
39
42
|
return paymentMethodCategoryTypeEnum;
|
40
43
|
}({});
|
41
44
|
export var localeEnum = /*#__PURE__*/function (localeEnum) {
|
@@ -107,6 +110,7 @@ export var messageName = /*#__PURE__*/function (messageName) {
|
|
107
110
|
export var targetEnum = /*#__PURE__*/function (targetEnum) {
|
108
111
|
targetEnum["BLANK"] = "_blank";
|
109
112
|
targetEnum["SELF"] = "_self";
|
113
|
+
targetEnum["REPLACE"] = "_replace";
|
110
114
|
return targetEnum;
|
111
115
|
}({});
|
112
116
|
export var errorEnum = /*#__PURE__*/function (errorEnum) {
|
@@ -125,6 +129,15 @@ export var errorEnum = /*#__PURE__*/function (errorEnum) {
|
|
125
129
|
errorEnum["GETSIGNPARAMSERROR"] = "GETSIGNPARAMSERROR";
|
126
130
|
return errorEnum;
|
127
131
|
}({});
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Get App Pay Payment Session Request.
|
135
|
+
*/
|
136
|
+
|
137
|
+
/**
|
138
|
+
* Get App Pay Payment Session Result.
|
139
|
+
*/
|
140
|
+
|
128
141
|
export var redirectTypeEnum = /*#__PURE__*/function (redirectTypeEnum) {
|
129
142
|
redirectTypeEnum["UNSAFE_BROWSER"] = "UNSAFE_BROWSER";
|
130
143
|
redirectTypeEnum["SAFETY_BROWSER"] = "SAFETY_BROWSER";
|
@@ -140,6 +153,9 @@ export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
|
|
140
153
|
eventCodeEnum["SDK_CREATECOMPONENT_ERROR"] = "SDK_CREATECOMPONENT_ERROR";
|
141
154
|
eventCodeEnum["SDK_CALL_URL_ERROR"] = "SDK_CALL_URL_ERROR";
|
142
155
|
eventCodeEnum["SDK_CALL_URL_SUCCESS"] = "SDK_CALL_URL_SUCCESS";
|
156
|
+
eventCodeEnum["SDK_PAYMENT_FINISH"] = "SDK_PAYMENT_FINISH";
|
157
|
+
eventCodeEnum["SDK_PAYMENT_FAIL"] = "SDK_PAYMENT_FAIL";
|
158
|
+
eventCodeEnum["SDK_PAYMENT_CANCEL"] = "SDK_PAYMENT_CANCEL";
|
143
159
|
return eventCodeEnum;
|
144
160
|
}({});
|
145
161
|
export var RedirectType = /*#__PURE__*/function (RedirectType) {
|
package/esm/util/logger.d.ts
CHANGED
package/esm/util/logger.js
CHANGED
@@ -29,7 +29,9 @@ export var Logger = /*#__PURE__*/function () {
|
|
29
29
|
this.config.mdata = Object.assign(this.config.mdata, mdata);
|
30
30
|
if ((_window = window) !== null && _window !== void 0 && _window.iTracker) {
|
31
31
|
var _window2;
|
32
|
-
(_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.iTracker) === null || _window2 === void 0 || _window2.set(
|
32
|
+
(_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.iTracker) === null || _window2 === void 0 || _window2.set({
|
33
|
+
mdata: this.config.mdata
|
34
|
+
});
|
33
35
|
setTimeout(function () {
|
34
36
|
_this.reportLogs();
|
35
37
|
}, 80);
|
package/esm/util/security.d.ts
CHANGED
package/esm/util/security.js
CHANGED
@@ -24,7 +24,7 @@ export var securityHost = {
|
|
24
24
|
US: 'https://open-na-global.alipay.com/api/open/risk_client',
|
25
25
|
DE: 'https://open-de-global.alipay.com/api/open/risk_client'
|
26
26
|
};
|
27
|
-
export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, productSceneEnum.CASHIER_PAYMENT, 'Acquirer'), productSceneEnum.AUTO_DEBIT, 'Acquirer'), productSceneEnum.VAULTING, 'Acquirer'), "EASYPAY", 'EasyPay'), productSceneEnum.EASY_PAY, 'EasyPay'), productSceneEnum.FLASH_BUY, 'OneAccount');
|
27
|
+
export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, productSceneEnum.CASHIER_PAYMENT, 'Acquirer'), productSceneEnum.AUTO_DEBIT, 'Acquirer'), productSceneEnum.VAULTING, 'Acquirer'), productSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), productSceneEnum.EASY_PAY, 'EasyPay'), productSceneEnum.FLASH_BUY, 'OneAccount');
|
28
28
|
export var getSecurityHost = function getSecurityHost(region) {
|
29
29
|
return securityHost[region] || securityHost[SecurityRegionEnum.SG];
|
30
30
|
};
|
package/package.json
CHANGED
@@ -1 +1,56 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"name": "@alipay/ams-checkout",
|
3
|
+
"version": "1.9.0",
|
4
|
+
"description": "",
|
5
|
+
"author": "",
|
6
|
+
"main": "esm/index.js",
|
7
|
+
"module": "esm/index.js",
|
8
|
+
"typings": "esm/index.d.ts",
|
9
|
+
"files": [
|
10
|
+
"dist",
|
11
|
+
"esm",
|
12
|
+
"LEGAL.md",
|
13
|
+
"LICENSE",
|
14
|
+
"README.md"
|
15
|
+
],
|
16
|
+
"scripts": {
|
17
|
+
"build": "father build",
|
18
|
+
"ci": "npm run lint",
|
19
|
+
"cov": "jest --coverage",
|
20
|
+
"format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
|
21
|
+
"lint": "eslint ./src",
|
22
|
+
"test": "jest"
|
23
|
+
},
|
24
|
+
"dependencies": {
|
25
|
+
"axios": "^1.3.4",
|
26
|
+
"uuid": "^9.0.0"
|
27
|
+
},
|
28
|
+
"devDependencies": {
|
29
|
+
"@babel/core": "^7.20.7",
|
30
|
+
"@babel/preset-env": "^7.20.2",
|
31
|
+
"@testing-library/jest-dom": "^5.1.1",
|
32
|
+
"@testing-library/react": "^9.5.0",
|
33
|
+
"@types/jest": "^29.2.4",
|
34
|
+
"@types/uuid": "^9.0.0",
|
35
|
+
"@typescript-eslint/eslint-plugin": "latest",
|
36
|
+
"@typescript-eslint/parser": "^5.60.0",
|
37
|
+
"babel-jest": "^29.3.1",
|
38
|
+
"babel-loader": "^9.1.0",
|
39
|
+
"babel-plugin-import": "^1.13.0",
|
40
|
+
"eslint": "^8.36.0",
|
41
|
+
"eslint-plugin-prettier": "latest",
|
42
|
+
"father": "^4.2.3",
|
43
|
+
"jest": "^29.5.0",
|
44
|
+
"jest-environment-jsdom": "^29.3.1",
|
45
|
+
"prettier": "^2.8.4",
|
46
|
+
"prettier-plugin-organize-imports": "^3.2.3",
|
47
|
+
"prettier-plugin-packagejson": "^2.4.5",
|
48
|
+
"ts-jest": "^29.0.3",
|
49
|
+
"ts-node": "^10.9.1",
|
50
|
+
"typescript": "^4.9.5"
|
51
|
+
},
|
52
|
+
"engines": {},
|
53
|
+
"publishConfig": {
|
54
|
+
"access": "public"
|
55
|
+
}
|
56
|
+
}
|