@alipay/ams-checkout 0.0.1719907614-dev.0 → 0.0.1720423407-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/index.d.ts +3 -0
- package/esm/index.js +24 -12
- package/esm/plugin/component/cashierApp.js +3 -3
- package/esm/plugin/component/index.js +13 -1
- package/esm/types/index.d.ts +2 -0
- package/esm/types/index.js +2 -0
- package/esm/util/upgrade.d.ts +4 -4
- package/esm/util/upgrade.js +6 -6
- package/package.json +1 -1
package/esm/index.d.ts
CHANGED
@@ -14,6 +14,9 @@ export declare class AMSCheckout extends AMSComponent {
|
|
14
14
|
export declare class AMSAutoDebit extends AMSCheckout {
|
15
15
|
constructor(options: IoptionsParams);
|
16
16
|
}
|
17
|
+
export declare class AMSAutoDebitPay extends AMSCheckout {
|
18
|
+
constructor(options: IoptionsParams);
|
19
|
+
}
|
17
20
|
export declare class AMSEasyPay extends AMSCheckout {
|
18
21
|
constructor(options: IoptionsParams);
|
19
22
|
}
|
package/esm/index.js
CHANGED
@@ -49,9 +49,21 @@ export var AMSAutoDebit = /*#__PURE__*/function (_AMSCheckout) {
|
|
49
49
|
}
|
50
50
|
return _createClass(AMSAutoDebit);
|
51
51
|
}(AMSCheckout);
|
52
|
-
export var
|
53
|
-
_inherits(
|
54
|
-
var _super3 = _createSuper(
|
52
|
+
export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout2) {
|
53
|
+
_inherits(AMSAutoDebitPay, _AMSCheckout2);
|
54
|
+
var _super3 = _createSuper(AMSAutoDebitPay);
|
55
|
+
function AMSAutoDebitPay(options) {
|
56
|
+
_classCallCheck(this, AMSAutoDebitPay);
|
57
|
+
var _options = Object.assign({}, options, {
|
58
|
+
product: productSceneEnum.AUTO_DEBIT_PAY
|
59
|
+
});
|
60
|
+
return _super3.call(this, _options, [componentSignEnum.AUTO_DEBIT_PAY_WALLET]);
|
61
|
+
}
|
62
|
+
return _createClass(AMSAutoDebitPay);
|
63
|
+
}(AMSCheckout);
|
64
|
+
export var AMSEasyPay = /*#__PURE__*/function (_AMSCheckout3) {
|
65
|
+
_inherits(AMSEasyPay, _AMSCheckout3);
|
66
|
+
var _super4 = _createSuper(AMSEasyPay);
|
55
67
|
function AMSEasyPay(options) {
|
56
68
|
_classCallCheck(this, AMSEasyPay);
|
57
69
|
var _options = Object.assign({}, options, {
|
@@ -76,13 +88,13 @@ export var AMSEasyPay = /*#__PURE__*/function (_AMSCheckout2) {
|
|
76
88
|
error: error
|
77
89
|
});
|
78
90
|
}
|
79
|
-
return
|
91
|
+
return _super4.call(this, _options, [componentSignEnum.EASY_PAY_WALLET], currentProductSceneVersion);
|
80
92
|
}
|
81
93
|
return _createClass(AMSEasyPay);
|
82
94
|
}(AMSCheckout);
|
83
|
-
export var AMSCashierPayment = /*#__PURE__*/function (
|
84
|
-
_inherits(AMSCashierPayment,
|
85
|
-
var
|
95
|
+
export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout4) {
|
96
|
+
_inherits(AMSCashierPayment, _AMSCheckout4);
|
97
|
+
var _super5 = _createSuper(AMSCashierPayment);
|
86
98
|
function AMSCashierPayment(options) {
|
87
99
|
_classCallCheck(this, AMSCashierPayment);
|
88
100
|
var _options = Object.assign({}, options, {
|
@@ -107,19 +119,19 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
|
|
107
119
|
error: error
|
108
120
|
});
|
109
121
|
}
|
110
|
-
return
|
122
|
+
return _super5.call(this, _options, currentChannelType);
|
111
123
|
}
|
112
124
|
return _createClass(AMSCashierPayment);
|
113
125
|
}(AMSCheckout);
|
114
|
-
export var AMSVaulting = /*#__PURE__*/function (
|
115
|
-
_inherits(AMSVaulting,
|
116
|
-
var
|
126
|
+
export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout5) {
|
127
|
+
_inherits(AMSVaulting, _AMSCheckout5);
|
128
|
+
var _super6 = _createSuper(AMSVaulting);
|
117
129
|
function AMSVaulting(options) {
|
118
130
|
_classCallCheck(this, AMSVaulting);
|
119
131
|
var _options = Object.assign({}, options, {
|
120
132
|
product: productSceneEnum.VAULTING
|
121
133
|
});
|
122
|
-
return
|
134
|
+
return _super6.call(this, _options, [componentSignEnum.CASHIER_PAYMENT_CARD]);
|
123
135
|
}
|
124
136
|
return _createClass(AMSVaulting);
|
125
137
|
}(AMSCheckout);
|
@@ -39,12 +39,12 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
|
39
39
|
|
40
40
|
// 没有匹配到版本,查询上次的加载版本
|
41
41
|
if (!appVersion) {
|
42
|
-
appVersion = getLastAppVersion(
|
42
|
+
appVersion = getLastAppVersion(productScene);
|
43
43
|
return appVersion;
|
44
44
|
}
|
45
45
|
// 不为空时代表是有sessionData,因此要保存当前版本
|
46
46
|
if (_extendInfo) {
|
47
|
-
setLastAppVersion(
|
47
|
+
setLastAppVersion(productScene, appVersion);
|
48
48
|
}
|
49
49
|
return appVersion;
|
50
50
|
} catch (error) {
|
@@ -52,7 +52,7 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
|
52
52
|
}
|
53
53
|
};
|
54
54
|
var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
|
55
|
-
var signSupportMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentSignEnum.NONE, ['']), componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), componentSignEnum.CASHIER_PAYMENT_APM, ['1.0']), componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), componentSignEnum.EASY_PAY_APM, ['2.0']), componentSignEnum.VAULTING_CARD, ['1.0']);
|
55
|
+
var signSupportMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, componentSignEnum.NONE, ['']), componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), componentSignEnum.AUTO_DEBIT_PAY_WALLET, ['']), componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), componentSignEnum.CASHIER_PAYMENT_APM, ['1.0']), componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), componentSignEnum.EASY_PAY_APM, ['2.0']), componentSignEnum.VAULTING_CARD, ['1.0']);
|
56
56
|
var supportProductSceneVersion = signSupportMap[componentSign];
|
57
57
|
// 从左到右,从旧到新
|
58
58
|
var isSupport = supportProductSceneVersion.find(function (it) {
|
@@ -57,7 +57,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
57
57
|
_defineProperty(this, "_multipleCallbackEvents", void 0);
|
58
58
|
_defineProperty(this, "_merchantAppointParam", void 0);
|
59
59
|
_defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
|
60
|
-
this._appVersion = '1.
|
60
|
+
this._appVersion = '1.18.0';
|
61
61
|
this._isInitComponent = false;
|
62
62
|
this._selector = "#".concat(COMPONENT_SECTION_ID);
|
63
63
|
this.createIframeNode = function () {
|
@@ -314,6 +314,18 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
314
314
|
return;
|
315
315
|
}
|
316
316
|
}
|
317
|
+
if (componentSignEnum.AUTO_DEBIT_PAY_WALLET === this._componentSign) {
|
318
|
+
if (requireFastSdk === true && productSceneVersion === '1.0') {
|
319
|
+
// REDIRECT,requireFastSdk为true,不需要接口请求
|
320
|
+
this.handleAuthUrlInfo(authUrlInfo);
|
321
|
+
return;
|
322
|
+
} else {
|
323
|
+
return Promise.reject({
|
324
|
+
code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
|
325
|
+
message: "Abnormal response data, interface failure, or unsupported payment method."
|
326
|
+
});
|
327
|
+
}
|
328
|
+
}
|
317
329
|
this.dispatchToSDK(EVENT.eventCallback.name, {
|
318
330
|
code: eventCodeEnum.SDK_START_OF_LOADING
|
319
331
|
});
|
package/esm/types/index.d.ts
CHANGED
@@ -47,6 +47,7 @@ export declare enum componentSignEnum {
|
|
47
47
|
'CASHIER_PAYMENT_BANK' = "CASHIER_PAYMENT_BANK",
|
48
48
|
'CASHIER_PAYMENT_APM' = "CASHIER_PAYMENT_APM",
|
49
49
|
'AUTO_DEBIT_WALLET' = "AUTO_DEBIT_WALLET",
|
50
|
+
'AUTO_DEBIT_PAY_WALLET' = "AUTO_DEBIT_PAY_WALLET",
|
50
51
|
'NONE' = "NONE",
|
51
52
|
'VAULTING_CARD' = "VAULTING_CARD"
|
52
53
|
}
|
@@ -54,6 +55,7 @@ export declare enum productSceneEnum {
|
|
54
55
|
'EASY_PAY' = "EASY_PAY",
|
55
56
|
'CASHIER_PAYMENT' = "CASHIER_PAYMENT",
|
56
57
|
'AUTO_DEBIT' = "AUTO_DEBIT",
|
58
|
+
'AUTO_DEBIT_PAY' = "AUTO_DEBIT_PAY",
|
57
59
|
'VAULTING' = "VAULTING",
|
58
60
|
'FLASH_BUY' = "FLASH_BUY",
|
59
61
|
'CARD_APPLE_PAY' = "CARD_APPLE_PAY"
|
package/esm/types/index.js
CHANGED
@@ -22,6 +22,7 @@ export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
|
|
22
22
|
componentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
|
23
23
|
componentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
|
24
24
|
componentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
|
25
|
+
componentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
|
25
26
|
componentSignEnum["NONE"] = "NONE";
|
26
27
|
componentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
27
28
|
return componentSignEnum;
|
@@ -30,6 +31,7 @@ export var productSceneEnum = /*#__PURE__*/function (productSceneEnum) {
|
|
30
31
|
productSceneEnum["EASY_PAY"] = "EASY_PAY";
|
31
32
|
productSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
|
32
33
|
productSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
|
34
|
+
productSceneEnum["AUTO_DEBIT_PAY"] = "AUTO_DEBIT_PAY";
|
33
35
|
productSceneEnum["VAULTING"] = "VAULTING";
|
34
36
|
productSceneEnum["FLASH_BUY"] = "FLASH_BUY";
|
35
37
|
productSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
|
package/esm/util/upgrade.d.ts
CHANGED
@@ -27,13 +27,13 @@ export declare function isGreyscaleMatch(item: UpgradeItem, randomGreyscale: num
|
|
27
27
|
export declare const getMatchAppVersion: (_extendInfo: string, sdkInfo: UpgradeSdkInfo) => string;
|
28
28
|
/**
|
29
29
|
* 获取保存的加载版本
|
30
|
-
* @param
|
30
|
+
* @param productScene
|
31
31
|
* @returns
|
32
32
|
*/
|
33
|
-
export declare const getLastAppVersion: (
|
33
|
+
export declare const getLastAppVersion: (productScene: string) => string;
|
34
34
|
/**
|
35
35
|
* 保存指定场景的加载版本供下次使用
|
36
|
-
* @param
|
36
|
+
* @param productScene
|
37
37
|
* @returns
|
38
38
|
*/
|
39
|
-
export declare const setLastAppVersion: (
|
39
|
+
export declare const setLastAppVersion: (productScene: string, appVersion: string) => boolean;
|
package/esm/util/upgrade.js
CHANGED
@@ -89,12 +89,12 @@ export var getMatchAppVersion = function getMatchAppVersion(_extendInfo, sdkInfo
|
|
89
89
|
|
90
90
|
/**
|
91
91
|
* 获取保存的加载版本
|
92
|
-
* @param
|
92
|
+
* @param productScene
|
93
93
|
* @returns
|
94
94
|
*/
|
95
|
-
export var getLastAppVersion = function getLastAppVersion(
|
95
|
+
export var getLastAppVersion = function getLastAppVersion(productScene) {
|
96
96
|
try {
|
97
|
-
var key = "Antom_".concat(
|
97
|
+
var key = "Antom_".concat(productScene, "_LastAppVersion");
|
98
98
|
return getStorageString(key, '');
|
99
99
|
} catch (error) {
|
100
100
|
return '';
|
@@ -102,12 +102,12 @@ export var getLastAppVersion = function getLastAppVersion(versionKey) {
|
|
102
102
|
};
|
103
103
|
/**
|
104
104
|
* 保存指定场景的加载版本供下次使用
|
105
|
-
* @param
|
105
|
+
* @param productScene
|
106
106
|
* @returns
|
107
107
|
*/
|
108
|
-
export var setLastAppVersion = function setLastAppVersion(
|
108
|
+
export var setLastAppVersion = function setLastAppVersion(productScene, appVersion) {
|
109
109
|
try {
|
110
|
-
var key = "Antom_".concat(
|
110
|
+
var key = "Antom_".concat(productScene, "_LastAppVersion");
|
111
111
|
return setStorageString(key, appVersion);
|
112
112
|
} catch (error) {
|
113
113
|
return false;
|