@alipay/ams-checkout 1.41.0 → 1.42.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/esm/config/index.d.ts
CHANGED
@@ -4,11 +4,12 @@ export declare const v2AppMarmotMap: Record<string, string>;
|
|
4
4
|
export declare const sdkVersion: string;
|
5
5
|
/**
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
7
|
+
* TODO 这里考虑直接换成packagejson.version
|
7
8
|
*/
|
8
|
-
export declare const AMSCheckoutAppVersion = "1.
|
9
|
-
export declare const AMSAutoDebitAppVersion = "1.
|
10
|
-
export declare const AMSEasyPayAppVersion = "1.
|
11
|
-
export declare const AMSCashierPaymentAppVersion = "1.
|
12
|
-
export declare const AMSVaultingAppVersion = "1.
|
13
|
-
export declare const AMSPaymentElementAppVersion = "1.
|
14
|
-
export declare const ADDRESSElementAppVersion = "1.
|
9
|
+
export declare const AMSCheckoutAppVersion = "1.42.1";
|
10
|
+
export declare const AMSAutoDebitAppVersion = "1.42.1";
|
11
|
+
export declare const AMSEasyPayAppVersion = "1.42.1";
|
12
|
+
export declare const AMSCashierPaymentAppVersion = "1.42.1";
|
13
|
+
export declare const AMSVaultingAppVersion = "1.42.1";
|
14
|
+
export declare const AMSPaymentElementAppVersion = "1.42.1";
|
15
|
+
export declare const ADDRESSElementAppVersion = "1.42.1";
|
package/esm/config/index.js
CHANGED
@@ -34,11 +34,12 @@ export var sdkVersion = json.version;
|
|
34
34
|
|
35
35
|
/**
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
37
|
+
* TODO 这里考虑直接换成packagejson.version
|
37
38
|
*/
|
38
|
-
export var AMSCheckoutAppVersion = '1.
|
39
|
-
export var AMSAutoDebitAppVersion = '1.
|
40
|
-
export var AMSEasyPayAppVersion = '1.
|
41
|
-
export var AMSCashierPaymentAppVersion = '1.
|
42
|
-
export var AMSVaultingAppVersion = '1.
|
43
|
-
export var AMSPaymentElementAppVersion = '1.
|
44
|
-
export var ADDRESSElementAppVersion = '1.
|
39
|
+
export var AMSCheckoutAppVersion = '1.42.1'; // 兜底版本号
|
40
|
+
export var AMSAutoDebitAppVersion = '1.42.1'; // 代扣
|
41
|
+
export var AMSEasyPayAppVersion = '1.42.1'; // easypay
|
42
|
+
export var AMSCashierPaymentAppVersion = '1.42.1'; // 收银台(卡、apm)
|
43
|
+
export var AMSVaultingAppVersion = '1.42.1'; // 绑卡
|
44
|
+
export var AMSPaymentElementAppVersion = '1.42.1'; // payment element
|
45
|
+
export var ADDRESSElementAppVersion = '1.42.1'; // address element
|
package/esm/constant/index.d.ts
CHANGED
package/esm/constant/index.js
CHANGED
@@ -65,6 +65,10 @@ export var ERRORMESSAGE = {
|
|
65
65
|
LOAD_APP_TIMEOUT: {
|
66
66
|
code: eventCodeEnum.SDK_CREATECOMPONENT_ERROR,
|
67
67
|
message: 'Load resource timeout'
|
68
|
+
},
|
69
|
+
NETWORK_REQUEST_ERROR: {
|
70
|
+
code: eventCodeEnum.SDK_CREATECOMPONENT_ERROR,
|
71
|
+
message: 'Network request error'
|
68
72
|
}
|
69
73
|
},
|
70
74
|
SDK_LAUNCH_PAYMENT_APP_ERROR: {
|
@@ -447,6 +447,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
447
447
|
}, loadTimeLimit !== null && loadTimeLimit !== void 0 ? loadTimeLimit : LOADTIME_LIMIT);
|
448
448
|
}).catch(function (error) {
|
449
449
|
_this4.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
450
|
+
_this4.dispatchToSDK(EVENT.eventCallback.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
450
451
|
_this4.AMSSDK.logger.logError({
|
451
452
|
title: 'sdk_error_web_app_timeout'
|
452
453
|
}).send();
|
@@ -658,13 +659,32 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
658
659
|
key: 'sdk_action_query_end',
|
659
660
|
value: Date.now()
|
660
661
|
});
|
661
|
-
resolve(res);
|
662
662
|
_this5.AMSSDK.logger.logInfo({
|
663
663
|
title: 'sdk_event_sdkQueryEnd'
|
664
664
|
}, {
|
665
665
|
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
666
666
|
}).send();
|
667
|
+
// fix: 泡泡玛特CVV场景,actionQuery报错会进入错误兜底页,导致CVV页面占用大幅空间
|
668
|
+
if (ComponentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign && !(res !== null && res !== void 0 && res.success)) {
|
669
|
+
var _res$errorActions;
|
670
|
+
// 通用操作:抛CREATECOMPONENT_ERROR错误码给商户,商户升级到新版本需要处理CREATECOMPONENT_ERROR逻辑
|
671
|
+
var createComponentError = {
|
672
|
+
code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code,
|
673
|
+
message: res === null || res === void 0 ? void 0 : res.errorMessage
|
674
|
+
};
|
675
|
+
_this5.dispatchToSDK(EVENT.error.name, createComponentError);
|
676
|
+
if ((res === null || res === void 0 || (_res$errorActions = res.errorActions) === null || _res$errorActions === void 0 ? void 0 : _res$errorActions.showType) === 'NONE') {
|
677
|
+
// 抛错销毁SDK,不展示错误页面
|
678
|
+
reject(createComponentError);
|
679
|
+
return;
|
680
|
+
}
|
681
|
+
}
|
682
|
+
resolve(res);
|
667
683
|
}).catch(function (err) {
|
684
|
+
if (ComponentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign) {
|
685
|
+
// 通用操作:抛CREATECOMPONENT_ERROR错误码给商户,商户升级到新版本需要处理CREATECOMPONENT_ERROR逻辑
|
686
|
+
_this5.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR);
|
687
|
+
}
|
668
688
|
if ([ComponentSignEnum.CASHIER_PAYMENT_CARD, ComponentSignEnum.VAULTING_CARD, ComponentSignEnum.CASHIER_PAYMENT_APM].includes(_this5._componentSign)) {
|
669
689
|
return resolve({
|
670
690
|
success: false
|
package/esm/types/index.d.ts
CHANGED
@@ -590,6 +590,7 @@ export interface CashierSdkActionQueryResult {
|
|
590
590
|
extendInfo?: {
|
591
591
|
channelOrderId?: string;
|
592
592
|
};
|
593
|
+
errorActions?: Record<string, string>;
|
593
594
|
}
|
594
595
|
export interface CashierSdkActionQuerySessionResult extends IPaymentSessionMetaData {
|
595
596
|
success: boolean;
|