@alipay/ams-checkout 0.0.1760520369-dev.1 → 0.0.1761013649-dev.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/config/index.d.ts +8 -8
- package/esm/config/index.js +8 -8
- package/esm/config/request.js +14 -2
- package/esm/constant/index.d.ts +1 -1
- package/esm/constant/index.js +5 -5
- package/esm/core/component/element/elementController/index.js +13 -12
- package/esm/core/component/element/type.d.ts +4 -3
- package/esm/core/component/element/type.js +2 -0
- package/esm/core/component/element/util.d.ts +1 -1
- package/package.json +1 -1
package/esm/config/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export declare const sdkVersion: string;
|
|
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
7
7
|
* TODO 这里考虑直接换成packagejson.version
|
|
8
8
|
*/
|
|
9
|
-
export declare const AMSCheckoutAppVersion = "1.
|
|
10
|
-
export declare const AMSAutoDebitAppVersion = "1.
|
|
11
|
-
export declare const AMSEasyPayAppVersion = "1.
|
|
12
|
-
export declare const AMSCashierPaymentAppVersion = "1.
|
|
13
|
-
export declare const AMSVaultingAppVersion = "1.
|
|
14
|
-
export declare const AMSPaymentElementAppVersion = "1.
|
|
15
|
-
export declare const ADDRESSElementAppVersion = "1.
|
|
16
|
-
export declare const AUTHElementAppVersion = "1.
|
|
9
|
+
export declare const AMSCheckoutAppVersion = "1.45.0";
|
|
10
|
+
export declare const AMSAutoDebitAppVersion = "1.45.0";
|
|
11
|
+
export declare const AMSEasyPayAppVersion = "1.45.0";
|
|
12
|
+
export declare const AMSCashierPaymentAppVersion = "1.45.0";
|
|
13
|
+
export declare const AMSVaultingAppVersion = "1.45.0";
|
|
14
|
+
export declare const AMSPaymentElementAppVersion = "1.45.0";
|
|
15
|
+
export declare const ADDRESSElementAppVersion = "1.45.0";
|
|
16
|
+
export declare const AUTHElementAppVersion = "1.45.0";
|
package/esm/config/index.js
CHANGED
|
@@ -36,11 +36,11 @@ export var sdkVersion = json.version;
|
|
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
37
37
|
* TODO 这里考虑直接换成packagejson.version
|
|
38
38
|
*/
|
|
39
|
-
export var AMSCheckoutAppVersion = '1.
|
|
40
|
-
export var AMSAutoDebitAppVersion = '1.
|
|
41
|
-
export var AMSEasyPayAppVersion = '1.
|
|
42
|
-
export var AMSCashierPaymentAppVersion = '1.
|
|
43
|
-
export var AMSVaultingAppVersion = '1.
|
|
44
|
-
export var AMSPaymentElementAppVersion = '1.
|
|
45
|
-
export var ADDRESSElementAppVersion = '1.
|
|
46
|
-
export var AUTHElementAppVersion = '1.
|
|
39
|
+
export var AMSCheckoutAppVersion = '1.45.0'; // 兜底版本号
|
|
40
|
+
export var AMSAutoDebitAppVersion = '1.45.0'; // 代扣
|
|
41
|
+
export var AMSEasyPayAppVersion = '1.45.0'; // easypay
|
|
42
|
+
export var AMSCashierPaymentAppVersion = '1.45.0'; // 收银台(卡、apm)
|
|
43
|
+
export var AMSVaultingAppVersion = '1.45.0'; // 绑卡
|
|
44
|
+
export var AMSPaymentElementAppVersion = '1.45.0'; // payment element
|
|
45
|
+
export var ADDRESSElementAppVersion = '1.45.0'; // address element
|
|
46
|
+
export var AUTHElementAppVersion = '1.45.0'; // auth element
|
package/esm/config/request.js
CHANGED
|
@@ -27,12 +27,24 @@ export var hostSignMap = function hostSignMap(hostSign, env) {
|
|
|
27
27
|
var map = {
|
|
28
28
|
SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
|
|
29
29
|
US: 'https://imgs-na-global.alipay.com/mgw.htm',
|
|
30
|
-
DE: 'https://imgs-de-global.alipay.com/mgw.htm'
|
|
30
|
+
DE: 'https://imgs-de-global.alipay.com/mgw.htm',
|
|
31
|
+
// QK 和 ID 机房未经过验证
|
|
32
|
+
QK: 'https://imgs-qk.alipay.com/mgw.htm',
|
|
33
|
+
// https://imgs-qk.alipay.com/mgw.htm
|
|
34
|
+
ID: 'https://imgs-id.alipay.com/mgw.htm',
|
|
35
|
+
// https://imgs-id.alipay.com/mgw.htm
|
|
36
|
+
SA: 'https://imgs-sa.alipay.com/mgw.htm' // https://imgs-sa.alipay.com/mgw.htm
|
|
31
37
|
};
|
|
32
38
|
var preMap = {
|
|
33
39
|
SG: 'https://imgs-sea-pre.alipay.com/mgw.htm',
|
|
34
40
|
US: 'https://imgs-pre.alipay.com/mgw.htm',
|
|
35
|
-
DE: 'https://imgs-de-pre.alipay.com/mgw.htm'
|
|
41
|
+
DE: 'https://imgs-de-pre.alipay.com/mgw.htm',
|
|
42
|
+
// QK 和 ID 机房未经过验证
|
|
43
|
+
QK: 'https://iopengw-qkgz99p.alipay.com/mgw.htm',
|
|
44
|
+
// https://iopengw-qkgz99p.alipay.com/mgw.htm
|
|
45
|
+
ID: 'https://imgs-id-pre.alipay.com/mgw.htm',
|
|
46
|
+
// https://imgs-id-pre.alipay.com/mgw.htm
|
|
47
|
+
SA: 'https://imgs-sa-pre.alipay.com/mgw.htm' // https://imgs-sa-pre.alipay.com/mgw.htm
|
|
36
48
|
};
|
|
37
49
|
if (env === 'prod' || env === 'sandbox' || env === 'light_sandbox') {
|
|
38
50
|
return map[hostSign || 'SG'];
|
package/esm/constant/index.d.ts
CHANGED
package/esm/constant/index.js
CHANGED
|
@@ -98,14 +98,14 @@ export var ERRORMESSAGE = {
|
|
|
98
98
|
code: 'UI_STATE_ERROR',
|
|
99
99
|
message: 'An error occurred. The transaction cannot be initiated.'
|
|
100
100
|
},
|
|
101
|
-
|
|
102
|
-
code: '
|
|
101
|
+
INITIALIZE_TIMEOUT: {
|
|
102
|
+
code: 'INITIALIZE_TIMEOUT',
|
|
103
103
|
API: {
|
|
104
|
-
code: '
|
|
104
|
+
code: 'INITIALIZE_API_TIMEOUT',
|
|
105
105
|
message: 'An error occurred. The transaction cannot be initiated.'
|
|
106
106
|
},
|
|
107
107
|
WEB: {
|
|
108
|
-
code: '
|
|
108
|
+
code: 'INITIALIZE_WEB_TIMEOUT',
|
|
109
109
|
message: 'An error occurred; the transaction cannot be initiated.'
|
|
110
110
|
}
|
|
111
111
|
},
|
|
@@ -287,7 +287,7 @@ export var EVENT = {
|
|
|
287
287
|
},
|
|
288
288
|
// Element支付完成后事件
|
|
289
289
|
submitPromiseCallback: {
|
|
290
|
-
name: '
|
|
290
|
+
name: 'submitPromiseCallback'
|
|
291
291
|
},
|
|
292
292
|
validateFieldsResult: {
|
|
293
293
|
name: 'validateFieldsResult',
|
|
@@ -195,7 +195,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
195
195
|
title: 'sdk_event_web_app_timeout'
|
|
196
196
|
});
|
|
197
197
|
resolve({
|
|
198
|
-
error: ERRORMESSAGE.
|
|
198
|
+
error: ERRORMESSAGE.INITIALIZE_TIMEOUT.WEB
|
|
199
199
|
});
|
|
200
200
|
}, TIMEOUT_DURATION);
|
|
201
201
|
}
|
|
@@ -254,9 +254,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
254
254
|
_this2.elementEventCenter.endEvent(startEventId, {
|
|
255
255
|
msg: safeStringify(payload)
|
|
256
256
|
});
|
|
257
|
-
resolve(_objectSpread(
|
|
258
|
-
needChangeSessionForRetry: false
|
|
259
|
-
}));
|
|
257
|
+
resolve(_objectSpread({}, payload || {}));
|
|
260
258
|
};
|
|
261
259
|
if (!checkMountResult.success) {
|
|
262
260
|
_this2.handleMountError({
|
|
@@ -351,9 +349,10 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
351
349
|
break;
|
|
352
350
|
}
|
|
353
351
|
res = {
|
|
354
|
-
error: ERRORMESSAGE.UI_STATE_ERROR,
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
error: _objectSpread(_objectSpread({}, ERRORMESSAGE.UI_STATE_ERROR), {}, {
|
|
353
|
+
needChangeSessionForRetry: false
|
|
354
|
+
}),
|
|
355
|
+
status: PaymentStatus.FAIL
|
|
357
356
|
};
|
|
358
357
|
logParams = {
|
|
359
358
|
eventCode: PaymentStatus.FAIL,
|
|
@@ -376,9 +375,11 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
376
375
|
case 0:
|
|
377
376
|
recordResultCallback = function _recordResultCallback(result) {
|
|
378
377
|
if (result instanceof Object) {
|
|
379
|
-
var _that$elementProcesso;
|
|
380
|
-
var needChangeSessionForRetry = typeof (result === null || result === void 0 ? void 0 :
|
|
381
|
-
result
|
|
378
|
+
var _result$error, _that$elementProcesso, _result$error2;
|
|
379
|
+
var needChangeSessionForRetry = typeof (result === null || result === void 0 || (_result$error = result.error) === null || _result$error === void 0 ? void 0 : _result$error.needChangeSessionForRetry) === 'undefined' ? (_that$elementProcesso = that.elementProcessors[ElementType.payment]) === null || _that$elementProcesso === void 0 || (_that$elementProcesso = _that$elementProcesso.obtainDataRes) === null || _that$elementProcesso === void 0 || (_that$elementProcesso = _that$elementProcesso.originActionQueryResult) === null || _that$elementProcesso === void 0 ? void 0 : _that$elementProcesso.notSupportRetryPayForSameSession : result === null || result === void 0 || (_result$error2 = result.error) === null || _result$error2 === void 0 ? void 0 : _result$error2.needChangeSessionForRetry;
|
|
380
|
+
if (result !== null && result !== void 0 && result.error) {
|
|
381
|
+
result.error.needChangeSessionForRetry = needChangeSessionForRetry;
|
|
382
|
+
}
|
|
382
383
|
}
|
|
383
384
|
recordResult = result;
|
|
384
385
|
resolve(recordResult);
|
|
@@ -493,7 +494,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
493
494
|
eventCode: (_recordResult = recordResult) === null || _recordResult === void 0 ? void 0 : _recordResult.status,
|
|
494
495
|
errorName: (_recordResult2 = recordResult) === null || _recordResult2 === void 0 || (_recordResult2 = _recordResult2.error) === null || _recordResult2 === void 0 ? void 0 : _recordResult2.code,
|
|
495
496
|
errormessage: (_recordResult3 = recordResult) === null || _recordResult3 === void 0 || (_recordResult3 = _recordResult3.error) === null || _recordResult3 === void 0 ? void 0 : _recordResult3.message,
|
|
496
|
-
needChangeSessionForRetry: (_recordResult4 = recordResult) === null || _recordResult4 === void 0 ? void 0 : _recordResult4.needChangeSessionForRetry,
|
|
497
|
+
needChangeSessionForRetry: (_recordResult4 = recordResult) === null || _recordResult4 === void 0 || (_recordResult4 = _recordResult4.error) === null || _recordResult4 === void 0 ? void 0 : _recordResult4.needChangeSessionForRetry,
|
|
497
498
|
rpcTraceId: (_recordResult5 = recordResult) === null || _recordResult5 === void 0 || (_recordResult5 = _recordResult5.error) === null || _recordResult5 === void 0 ? void 0 : _recordResult5.traceId,
|
|
498
499
|
msg: safeStringify(recordResult)
|
|
499
500
|
};
|
|
@@ -641,7 +642,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
|
641
642
|
_context5.t0 = _context5["catch"](1);
|
|
642
643
|
this.handleInitializationError();
|
|
643
644
|
readyCallback({
|
|
644
|
-
error: _objectSpread(_objectSpread({}, ERRORMESSAGE.
|
|
645
|
+
error: _objectSpread(_objectSpread({}, ERRORMESSAGE.INITIALIZE_TIMEOUT.API), {}, {
|
|
645
646
|
traceId: _context5.t0 === null || _context5.t0 === void 0 ? void 0 : _context5.t0.traceId
|
|
646
647
|
})
|
|
647
648
|
});
|
|
@@ -91,7 +91,8 @@ export declare enum ELEMENT_ENVIRONMENT {
|
|
|
91
91
|
PROD = "PROD",
|
|
92
92
|
SANDBOX = "SANDBOX"
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
type ELEMENT_ENVIRONMENT_VALUE = 'dev' | 'test' | 'sit' | 'pre' | 'prod' | 'sandbox';
|
|
95
|
+
export type ELEMENT_ENVIRONMENT_TYPE = keyof typeof ELEMENT_ENVIRONMENT | (typeof ELEMENT_ENVIRONMENT)[keyof typeof ELEMENT_ENVIRONMENT] | ELEMENT_ENVIRONMENT_VALUE;
|
|
95
96
|
export interface AddressMountComponentsParams {
|
|
96
97
|
configParams?: AddressMountConfig;
|
|
97
98
|
prefillValue: Array<AddressSubmitData>;
|
|
@@ -381,7 +382,7 @@ export interface IElementOptions {
|
|
|
381
382
|
appearance?: {
|
|
382
383
|
theme: ThemeType.Default | ThemeType.Night;
|
|
383
384
|
};
|
|
384
|
-
onEventCallback?: ({ code, message, result
|
|
385
|
+
onEventCallback?: ({ code, message, result }: {
|
|
385
386
|
code: EventCallbackCode;
|
|
386
387
|
message: string;
|
|
387
388
|
result?: any;
|
|
@@ -415,8 +416,8 @@ export interface ICommonApiResponse {
|
|
|
415
416
|
message: string;
|
|
416
417
|
traceId?: string;
|
|
417
418
|
context?: any;
|
|
419
|
+
needChangeSessionForRetry?: boolean;
|
|
418
420
|
};
|
|
419
|
-
needChangeSessionForRetry?: boolean;
|
|
420
421
|
}
|
|
421
422
|
export interface IPaymentApiResponse extends ICommonApiResponse {
|
|
422
423
|
status: keyof typeof PaymentStatus;
|
|
@@ -10,7 +10,7 @@ export declare const formatElementOption: (options: IElementOptions) => {
|
|
|
10
10
|
appearance?: {
|
|
11
11
|
theme: import("./type").ThemeType.Default | import("./type").ThemeType.Night;
|
|
12
12
|
};
|
|
13
|
-
onEventCallback?: ({ code, message, result
|
|
13
|
+
onEventCallback?: ({ code, message, result }: {
|
|
14
14
|
code: EventCallbackCode;
|
|
15
15
|
message: string;
|
|
16
16
|
result?: any;
|