@alipay/ams-checkout 2.0.27 → 2.0.28
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/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/ckp/index.js +21 -1
- package/esm/core/component/element/modernElementController/adapter.js +3 -3
- package/esm/core/component/element/modernElementController/index.d.ts +2 -0
- package/esm/core/component/element/modernElementController/index.js +103 -93
- package/esm/modern/index.js +1 -1
- package/esm/modern/tools.js +1 -1
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/util/logger.js +1 -1
- package/package.json +1 -1
- package/types.d.ts +137 -39
- package/types.untrimmed.d.ts +140 -36
package/esm/config/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export var v2AppMarmotMap = {
|
|
|
30
30
|
light_sandbox: 'https://checkout.antom.com',
|
|
31
31
|
prod: 'https://checkout.antom.com'
|
|
32
32
|
};
|
|
33
|
-
export var sdkVersion = "2.0.
|
|
33
|
+
export var sdkVersion = "2.0.28";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
@@ -7,6 +7,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
import { isModernWeb } from "../../../modern/tools";
|
|
10
11
|
import { redirect } from "../../../util/redirect";
|
|
11
12
|
import { v4 as uuid } from 'uuid';
|
|
12
13
|
import { EnvironmentEnum, MessageName } from "../../../types";
|
|
@@ -23,6 +24,8 @@ var CKP_PAYMENT_PAGE_HOST = {
|
|
|
23
24
|
|
|
24
25
|
var CKP_PAGE_ADDRESS = '/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html';
|
|
25
26
|
var CKP_PAGE_NEW_ADDRESS = '/checkout-page/pages/payment/index.html';
|
|
27
|
+
var CKP2_PAGE_ADDRESS = '/checkout-page2/pages/payment/index.html';
|
|
28
|
+
var CKP2_FLOW_SWITCH_TAG = 'ckp2';
|
|
26
29
|
export var getCKPPageAddress = function getCKPPageAddress(env) {
|
|
27
30
|
switch (env) {
|
|
28
31
|
case 'dev':
|
|
@@ -40,6 +43,23 @@ export var getCKPPageAddress = function getCKPPageAddress(env) {
|
|
|
40
43
|
return env;
|
|
41
44
|
}
|
|
42
45
|
};
|
|
46
|
+
var getCKP2PageAddress = function getCKP2PageAddress(env) {
|
|
47
|
+
switch (env) {
|
|
48
|
+
case 'dev':
|
|
49
|
+
return "".concat(CKP_PAYMENT_PAGE_HOST.DEV).concat(CKP2_PAGE_ADDRESS);
|
|
50
|
+
case 'sit':
|
|
51
|
+
return "".concat(CKP_PAYMENT_PAGE_HOST.TEST).concat(CKP2_PAGE_ADDRESS);
|
|
52
|
+
case 'pre':
|
|
53
|
+
return "".concat(CKP_PAYMENT_PAGE_HOST.PRE).concat(CKP2_PAGE_ADDRESS);
|
|
54
|
+
case 'prod':
|
|
55
|
+
case 'sandbox':
|
|
56
|
+
case 'light_sandbox':
|
|
57
|
+
return "".concat(CKP_PAYMENT_PAGE_HOST.PROD).concat(CKP2_PAGE_ADDRESS);
|
|
58
|
+
default:
|
|
59
|
+
// A caller-provided URL is already the explicit page selection authority.
|
|
60
|
+
return env;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
43
63
|
export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
44
64
|
function AMSCheckoutPage(options) {
|
|
45
65
|
var _this = this;
|
|
@@ -54,7 +74,7 @@ export var AMSCheckoutPage = /*#__PURE__*/function () {
|
|
|
54
74
|
var env = _this.originOptions.environment || 'prod';
|
|
55
75
|
var session = sessionData || '';
|
|
56
76
|
var lang = _this.originOptions.locale || 'en_US';
|
|
57
|
-
var ckpPageAddress = getCKPPageAddress(env);
|
|
77
|
+
var ckpPageAddress = isModernWeb(sessionData, CKP2_FLOW_SWITCH_TAG).modernWeb ? getCKP2PageAddress(env) : getCKPPageAddress(env);
|
|
58
78
|
console.log('[antom-web-sdk] <antom-checkout-page> generateIframeSrc', _this.originOptions, env, session, lang, ckpPageAddress);
|
|
59
79
|
|
|
60
80
|
// 先获取去除的 query 参数的 url
|
|
@@ -41,7 +41,7 @@ export function adaptErrorToEventCallback(error) {
|
|
|
41
41
|
* 4. layout: 直接透传
|
|
42
42
|
*/
|
|
43
43
|
export function adaptAppearance(appearance, merchantAppointParam) {
|
|
44
|
-
var _merchantAppointParam, _appearance$card, _appearance$accordion;
|
|
44
|
+
var _merchantAppointParam, _appearance$card$show, _appearance$card, _appearance$accordion, _appearance$accordion2;
|
|
45
45
|
var merchantDisplaySetting = {
|
|
46
46
|
showCardCVV: !!(merchantAppointParam !== null && merchantAppointParam !== void 0 && (_merchantAppointParam = merchantAppointParam.storedCard) !== null && _merchantAppointParam !== void 0 && _merchantAppointParam.needCVV),
|
|
47
47
|
showPaymentMethodListWhenSingleOption: (merchantAppointParam === null || merchantAppointParam === void 0 ? void 0 : merchantAppointParam.singleOption) === 'list'
|
|
@@ -66,9 +66,9 @@ export function adaptAppearance(appearance, merchantAppointParam) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
result.displaySetting = _objectSpread(_objectSpread({
|
|
69
|
-
showCardBrandIcon:
|
|
69
|
+
showCardBrandIcon: (_appearance$card$show = (_appearance$card = appearance.card) === null || _appearance$card === void 0 ? void 0 : _appearance$card.showBrandIcon) !== null && _appearance$card$show !== void 0 ? _appearance$card$show : true
|
|
70
70
|
}, merchantDisplaySetting), {}, {
|
|
71
|
-
showRadioWhenAccordionLayout:
|
|
71
|
+
showRadioWhenAccordionLayout: (_appearance$accordion = (_appearance$accordion2 = appearance.accordion) === null || _appearance$accordion2 === void 0 ? void 0 : _appearance$accordion2.showRadio) !== null && _appearance$accordion !== void 0 ? _appearance$accordion : true
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
// Layout: 直接透传
|
|
@@ -38,6 +38,8 @@ export declare class ModernElementController implements IElementController {
|
|
|
38
38
|
private _merchantCurrency;
|
|
39
39
|
/** 当前选中的支付方式类型(如 'APPLEPAY', 'CARD'),通过 paymentMethodChanged 事件更新 */
|
|
40
40
|
private currentPaymentMethodType;
|
|
41
|
+
/** Removes the passive host-window modal monitor for this controller. */
|
|
42
|
+
private readonly stopModalMessageMonitor;
|
|
41
43
|
/** 提交进行中标志:submitPayment 执行期间为 true,用于拒绝并发重入,避免旧闭包串扰/重复拉起钱包 */
|
|
42
44
|
private isSubmitting;
|
|
43
45
|
/**
|