@alipay/ams-checkout 0.0.1716265961-dev.0 → 0.0.1716362599-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/request.js +3 -3
- package/esm/core/component/appPreloadProcessing.d.ts +1 -0
- package/esm/core/component/appPreloadProcessing.js +89 -0
- package/esm/core/component/ckp/index.d.ts +41 -0
- package/esm/core/component/ckp/index.js +139 -0
- package/esm/core/component/index.js +44 -15
- package/esm/index.d.ts +6 -1
- package/esm/index.js +26 -13
- package/esm/plugin/component/cashierApp.js +3 -3
- package/esm/plugin/component/channel.d.ts +20 -0
- package/esm/plugin/component/channel.js +52 -0
- package/esm/plugin/component/component.popup.style.d.ts +4 -1
- package/esm/plugin/component/component.popup.style.js +7 -1
- package/esm/plugin/component/index.d.ts +2 -0
- package/esm/plugin/component/index.js +218 -76
- package/esm/plugin/paypal/index.js +1 -1
- package/esm/request/index.js +2 -2
- package/esm/types/index.d.ts +19 -0
- package/esm/types/index.js +3 -0
- package/esm/util/index.d.ts +7 -1
- package/esm/util/index.js +67 -1
- package/esm/util/upgrade.d.ts +4 -4
- package/esm/util/upgrade.js +6 -6
- package/package.json +1 -1
@@ -124,7 +124,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
124
124
|
locale: locale,
|
125
125
|
'client-id': channelMerchantAccountId
|
126
126
|
});
|
127
|
-
var disableFundingArr = [];
|
127
|
+
var disableFundingArr = ['bancontact', 'blik', 'eps', 'giropay', 'ideal', 'mercadopago', 'mybank', 'p24', 'sepa', 'sofort'];
|
128
128
|
if (blockPayPalCreditButton && !displayPayPalPayLaterButtonOnly) {
|
129
129
|
disableFundingArr.push('card');
|
130
130
|
}
|
package/esm/request/index.js
CHANGED
@@ -91,9 +91,9 @@ function _request() {
|
|
91
91
|
if (envInfo.terminalType === 'WAP') envInfo.osType = device.iOS ? 'IOS' : 'ANDROID';
|
92
92
|
_data = [_objectSpread(_objectSpread({}, requestData), {}, {
|
93
93
|
envInfo: envInfo,
|
94
|
-
extParams: {
|
94
|
+
extParams: _objectSpread(_objectSpread({}, requestData === null || requestData === void 0 ? void 0 : requestData.extParams), {}, {
|
95
95
|
refUrl: window.location.href
|
96
|
-
}
|
96
|
+
})
|
97
97
|
})];
|
98
98
|
startTime = Date.now();
|
99
99
|
_context.prev = 5;
|
package/esm/types/index.d.ts
CHANGED
@@ -42,10 +42,12 @@ export interface IcreatePaymentParams {
|
|
42
42
|
}
|
43
43
|
export declare enum componentSignEnum {
|
44
44
|
'EASY_PAY_WALLET' = "EASY_PAY_WALLET",
|
45
|
+
'EASY_PAY_APM' = "EASY_PAY_APM",
|
45
46
|
'CASHIER_PAYMENT_CARD' = "CASHIER_PAYMENT_CARD",
|
46
47
|
'CASHIER_PAYMENT_BANK' = "CASHIER_PAYMENT_BANK",
|
47
48
|
'CASHIER_PAYMENT_APM' = "CASHIER_PAYMENT_APM",
|
48
49
|
'AUTO_DEBIT_WALLET' = "AUTO_DEBIT_WALLET",
|
50
|
+
'AUTO_DEBIT_PAY_WALLET' = "AUTO_DEBIT_PAY_WALLET",
|
49
51
|
'NONE' = "NONE",
|
50
52
|
'VAULTING_CARD' = "VAULTING_CARD"
|
51
53
|
}
|
@@ -53,6 +55,7 @@ export declare enum productSceneEnum {
|
|
53
55
|
'EASY_PAY' = "EASY_PAY",
|
54
56
|
'CASHIER_PAYMENT' = "CASHIER_PAYMENT",
|
55
57
|
'AUTO_DEBIT' = "AUTO_DEBIT",
|
58
|
+
'AUTO_DEBIT_PAY' = "AUTO_DEBIT_PAY",
|
56
59
|
'VAULTING' = "VAULTING",
|
57
60
|
'FLASH_BUY' = "FLASH_BUY",
|
58
61
|
'CARD_APPLE_PAY' = "CARD_APPLE_PAY"
|
@@ -135,6 +138,10 @@ export interface InitSecurityConfig {
|
|
135
138
|
product: productSceneEnum;
|
136
139
|
region?: string;
|
137
140
|
}
|
141
|
+
export interface frontModulesToBeLoadedInterface {
|
142
|
+
acquirerName: string;
|
143
|
+
scriptUrl: string;
|
144
|
+
}
|
138
145
|
export interface IpaymentSessionMetaData {
|
139
146
|
clientId?: string;
|
140
147
|
renderDisplayType?: string;
|
@@ -144,14 +151,24 @@ export interface IpaymentSessionMetaData {
|
|
144
151
|
extendInfo?: string;
|
145
152
|
paymentMethodInfoView?: any;
|
146
153
|
action?: {
|
154
|
+
amountConfirmRequired?: boolean;
|
147
155
|
autoDebitWithToken: boolean;
|
156
|
+
enableSignAgreement?: boolean;
|
148
157
|
skipSdkQuery: boolean;
|
158
|
+
requireFastSdk: boolean;
|
149
159
|
skipSdkQueryForm?: {
|
150
160
|
value: boolean;
|
151
161
|
version: string;
|
152
162
|
platform: string;
|
153
163
|
};
|
154
164
|
};
|
165
|
+
authUrlInfo?: {
|
166
|
+
appIdentifier?: string;
|
167
|
+
applinkUrl?: string;
|
168
|
+
normalUrl?: string;
|
169
|
+
schemeUrl?: string;
|
170
|
+
authUrl?: string;
|
171
|
+
};
|
155
172
|
paymentSessionFactor?: {
|
156
173
|
extendInfo?: {
|
157
174
|
merchantCapabilities?: string[];
|
@@ -212,6 +229,7 @@ export interface IpaymentSessionMetaData {
|
|
212
229
|
*/
|
213
230
|
agreementDescription?: string;
|
214
231
|
};
|
232
|
+
frontModulesToBeLoaded?: frontModulesToBeLoadedInterface[];
|
215
233
|
};
|
216
234
|
}
|
217
235
|
export interface IPaymentSessionFactor {
|
@@ -425,6 +443,7 @@ export interface CashierSubmitPayRequest {
|
|
425
443
|
verifyFactors?: Record<string, string>;
|
426
444
|
paymentSessionData: string;
|
427
445
|
paymentSessionConfig?: any;
|
446
|
+
extParams?: any;
|
428
447
|
}
|
429
448
|
export interface CashierSdkActionQueryResult {
|
430
449
|
supportedLanguages?: any[];
|
package/esm/types/index.js
CHANGED
@@ -17,10 +17,12 @@ export var renderDisplayTypeEnum = /*#__PURE__*/function (renderDisplayTypeEnum)
|
|
17
17
|
}({});
|
18
18
|
export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
|
19
19
|
componentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
|
20
|
+
componentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
|
20
21
|
componentSignEnum["CASHIER_PAYMENT_CARD"] = "CASHIER_PAYMENT_CARD";
|
21
22
|
componentSignEnum["CASHIER_PAYMENT_BANK"] = "CASHIER_PAYMENT_BANK";
|
22
23
|
componentSignEnum["CASHIER_PAYMENT_APM"] = "CASHIER_PAYMENT_APM";
|
23
24
|
componentSignEnum["AUTO_DEBIT_WALLET"] = "AUTO_DEBIT_WALLET";
|
25
|
+
componentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
|
24
26
|
componentSignEnum["NONE"] = "NONE";
|
25
27
|
componentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
26
28
|
return componentSignEnum;
|
@@ -29,6 +31,7 @@ export var productSceneEnum = /*#__PURE__*/function (productSceneEnum) {
|
|
29
31
|
productSceneEnum["EASY_PAY"] = "EASY_PAY";
|
30
32
|
productSceneEnum["CASHIER_PAYMENT"] = "CASHIER_PAYMENT";
|
31
33
|
productSceneEnum["AUTO_DEBIT"] = "AUTO_DEBIT";
|
34
|
+
productSceneEnum["AUTO_DEBIT_PAY"] = "AUTO_DEBIT_PAY";
|
32
35
|
productSceneEnum["VAULTING"] = "VAULTING";
|
33
36
|
productSceneEnum["FLASH_BUY"] = "FLASH_BUY";
|
34
37
|
productSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
|
package/esm/util/index.d.ts
CHANGED
@@ -39,4 +39,10 @@ declare const getOrSetStorageId: (key: string, value?: string) => string;
|
|
39
39
|
declare const checkTimeElapsed: () => boolean;
|
40
40
|
declare const isFunction: (func: any) => boolean;
|
41
41
|
declare function parseBase64ToString(base64: string): string;
|
42
|
-
|
42
|
+
declare function loadSDKScript({ src, attrOptions, timeOut, loadCallback }: {
|
43
|
+
src: any;
|
44
|
+
attrOptions?: {};
|
45
|
+
timeOut?: number;
|
46
|
+
loadCallback?: any;
|
47
|
+
}, logger: any): Promise<unknown>;
|
48
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript };
|
package/esm/util/index.js
CHANGED
@@ -261,4 +261,70 @@ function parseBase64ToString(base64) {
|
|
261
261
|
return null;
|
262
262
|
}
|
263
263
|
}
|
264
|
-
|
264
|
+
function loadSDKScript(_ref, logger) {
|
265
|
+
var _this2 = this;
|
266
|
+
var src = _ref.src,
|
267
|
+
_ref$attrOptions = _ref.attrOptions,
|
268
|
+
attrOptions = _ref$attrOptions === void 0 ? {} : _ref$attrOptions,
|
269
|
+
_ref$timeOut = _ref.timeOut,
|
270
|
+
timeOut = _ref$timeOut === void 0 ? 3 : _ref$timeOut,
|
271
|
+
_ref$loadCallback = _ref.loadCallback,
|
272
|
+
loadCallback = _ref$loadCallback === void 0 ? null : _ref$loadCallback;
|
273
|
+
return new Promise(function (resolve, reject) {
|
274
|
+
// 创建 script 标签
|
275
|
+
logger.logInfo({
|
276
|
+
title: 'load_item_sdk_start'
|
277
|
+
}, {
|
278
|
+
src: src,
|
279
|
+
attrOptions: JSON.stringify(attrOptions)
|
280
|
+
});
|
281
|
+
console.time();
|
282
|
+
var script = document.createElement('script');
|
283
|
+
var timer = null;
|
284
|
+
script.type = 'text/javascript';
|
285
|
+
|
286
|
+
// 监听加载完成事件
|
287
|
+
script.onload = function () {
|
288
|
+
// 当脚本加载完毕时,执行回调函数
|
289
|
+
logger.logInfo({
|
290
|
+
title: 'load_item_sdk_end'
|
291
|
+
}, {
|
292
|
+
src: src,
|
293
|
+
attrOptions: JSON.stringify(attrOptions)
|
294
|
+
});
|
295
|
+
console.timeEnd();
|
296
|
+
clearTimeout(timer);
|
297
|
+
if (loadCallback) loadCallback();
|
298
|
+
resolve(true);
|
299
|
+
};
|
300
|
+
|
301
|
+
// 监听加载失败事件
|
302
|
+
script.onerror = function () {
|
303
|
+
logger.logError({
|
304
|
+
title: 'load_item_sdk_error'
|
305
|
+
}, {
|
306
|
+
src: src,
|
307
|
+
attrOptions: JSON.stringify(attrOptions)
|
308
|
+
});
|
309
|
+
clearTimeout(timer);
|
310
|
+
console.error('The script ' + src + ' is not accessible.');
|
311
|
+
reject(false);
|
312
|
+
};
|
313
|
+
timer = setTimeout(function () {
|
314
|
+
_this2.logger.logError({
|
315
|
+
title: 'load_item_sdk_timeout'
|
316
|
+
}, {
|
317
|
+
src: src,
|
318
|
+
attrOptions: JSON.stringify(attrOptions)
|
319
|
+
});
|
320
|
+
reject(false);
|
321
|
+
}, timeOut * 1000);
|
322
|
+
script.src = src;
|
323
|
+
attrOptions && Object.keys(attrOptions).forEach(function (key) {
|
324
|
+
script.setAttribute(key, attrOptions[key]);
|
325
|
+
});
|
326
|
+
// 将 script 标签添加到页面中
|
327
|
+
document.head.appendChild(script);
|
328
|
+
});
|
329
|
+
}
|
330
|
+
export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, isFunction, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed, parseBase64ToString, loadSDKScript };
|
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 versionKey
|
31
31
|
* @returns
|
32
32
|
*/
|
33
|
-
export declare const getLastAppVersion: (
|
33
|
+
export declare const getLastAppVersion: (versionKey: string) => string;
|
34
34
|
/**
|
35
35
|
* 保存指定场景的加载版本供下次使用
|
36
|
-
* @param
|
36
|
+
* @param versionKey
|
37
37
|
* @returns
|
38
38
|
*/
|
39
|
-
export declare const setLastAppVersion: (
|
39
|
+
export declare const setLastAppVersion: (versionKey: 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 versionKey
|
93
93
|
* @returns
|
94
94
|
*/
|
95
|
-
export var getLastAppVersion = function getLastAppVersion(
|
95
|
+
export var getLastAppVersion = function getLastAppVersion(versionKey) {
|
96
96
|
try {
|
97
|
-
var key = "Antom_".concat(
|
97
|
+
var key = "Antom_".concat(versionKey, "_LastAppVersion");
|
98
98
|
return getStorageString(key, '');
|
99
99
|
} catch (error) {
|
100
100
|
return '';
|
@@ -102,12 +102,12 @@ export var getLastAppVersion = function getLastAppVersion(productScene) {
|
|
102
102
|
};
|
103
103
|
/**
|
104
104
|
* 保存指定场景的加载版本供下次使用
|
105
|
-
* @param
|
105
|
+
* @param versionKey
|
106
106
|
* @returns
|
107
107
|
*/
|
108
|
-
export var setLastAppVersion = function setLastAppVersion(
|
108
|
+
export var setLastAppVersion = function setLastAppVersion(versionKey, appVersion) {
|
109
109
|
try {
|
110
|
-
var key = "Antom_".concat(
|
110
|
+
var key = "Antom_".concat(versionKey, "_LastAppVersion");
|
111
111
|
return setStorageString(key, appVersion);
|
112
112
|
} catch (error) {
|
113
113
|
return false;
|