@alipay/ams-checkout 0.0.1733711101-dev.8 → 0.0.1734681171-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 +7 -7
- package/esm/config/index.js +21 -9
- package/esm/foundation/core/index.js +5 -3
- package/esm/foundation/product-processor/easysafepay/index.js +5 -4
- package/esm/foundation/service/event-center.d.ts +2 -2
- package/esm/foundation/service/event-center.js +6 -6
- package/package.json +1 -1
package/esm/config/index.d.ts
CHANGED
@@ -5,10 +5,10 @@ export declare const sdkVersion: string;
|
|
5
5
|
/**
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
7
7
|
*/
|
8
|
-
export declare const AMSCheckoutAppVersion = "1.26.
|
9
|
-
export declare const AMSAutoDebitAppVersion = "1.26.
|
10
|
-
export declare const AMSEasyPayAppVersion = "1.26.
|
11
|
-
export declare const AMSCashierPaymentAppVersion = "1.26.
|
12
|
-
export declare const AMSVaultingAppVersion = "1.26.
|
13
|
-
export declare const AMSPaymentElementAppVersion = "1.26.
|
14
|
-
export declare const ADDRESSElementAppVersion = "1.26.
|
8
|
+
export declare const AMSCheckoutAppVersion = "1.26.1";
|
9
|
+
export declare const AMSAutoDebitAppVersion = "1.26.1";
|
10
|
+
export declare const AMSEasyPayAppVersion = "1.26.1";
|
11
|
+
export declare const AMSCashierPaymentAppVersion = "1.26.1";
|
12
|
+
export declare const AMSVaultingAppVersion = "1.26.1";
|
13
|
+
export declare const AMSPaymentElementAppVersion = "1.26.1";
|
14
|
+
export declare const ADDRESSElementAppVersion = "1.26.1";
|
package/esm/config/index.js
CHANGED
@@ -6,13 +6,25 @@
|
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
8
|
import json from "../../package.json";
|
9
|
-
|
9
|
+
|
10
|
+
/*
|
11
|
+
export const marmotMap: Record<string, string> = {
|
10
12
|
dev: 'http://page.alipay.net/page/antom-web-checkout/src/component-app',
|
11
13
|
sit: 'http://page.test.alipay.net/page/antom-web-checkout/src/component-app',
|
12
14
|
pre: 'https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app',
|
13
15
|
sandbox: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
|
14
16
|
light_sandbox: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
|
15
|
-
prod: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app'
|
17
|
+
prod: 'https://ac.alipay.com/page/antom-web-checkout/src/component-app',
|
18
|
+
};
|
19
|
+
*/
|
20
|
+
|
21
|
+
// FIXME: for popmart test
|
22
|
+
export var marmotMap = {
|
23
|
+
dev: 'http://dev.page.alipay.net/page/antom-web-checkout/feat-small-font-size/src/component-app',
|
24
|
+
pre: 'https://pre.ac.alipay.com/page/antom-web-checkout/feat-small-font-size/src/component-app',
|
25
|
+
sandbox: 'https://pre.ac.alipay.com/page/antom-web-checkout/feat-small-font-size/src/component-app',
|
26
|
+
light_sandbox: 'https://pre.ac.alipay.com/page/antom-web-checkout/feat-small-font-size/src/component-app',
|
27
|
+
prod: 'https://pre.ac.alipay.com/page/antom-web-checkout/feat-small-font-size/src/component-app'
|
16
28
|
};
|
17
29
|
export var marmotConfigMap = {
|
18
30
|
dev: 'https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json',
|
@@ -35,10 +47,10 @@ export var sdkVersion = json.version;
|
|
35
47
|
/**
|
36
48
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
37
49
|
*/
|
38
|
-
export var AMSCheckoutAppVersion = '1.26.
|
39
|
-
export var AMSAutoDebitAppVersion = '1.26.
|
40
|
-
export var AMSEasyPayAppVersion = '1.26.
|
41
|
-
export var AMSCashierPaymentAppVersion = '1.26.
|
42
|
-
export var AMSVaultingAppVersion = '1.26.
|
43
|
-
export var AMSPaymentElementAppVersion = '1.26.
|
44
|
-
export var ADDRESSElementAppVersion = '1.26.
|
50
|
+
export var AMSCheckoutAppVersion = '1.26.1'; // 兜底版本号
|
51
|
+
export var AMSAutoDebitAppVersion = '1.26.1'; // 代扣
|
52
|
+
export var AMSEasyPayAppVersion = '1.26.1'; // easypay
|
53
|
+
export var AMSCashierPaymentAppVersion = '1.26.1'; // 收银台(卡、apm)
|
54
|
+
export var AMSVaultingAppVersion = '1.26.1'; // 绑卡
|
55
|
+
export var AMSPaymentElementAppVersion = '1.26.1'; // payment element
|
56
|
+
export var ADDRESSElementAppVersion = '1.26.1'; // address element
|
@@ -302,6 +302,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
302
302
|
var platform = this.paymentContext.displayInfo.platform;
|
303
303
|
var payload = this.bizFlowStartBehavior.payload;
|
304
304
|
var closeBtnCallbackForPopup = function closeBtnCallbackForPopup() {
|
305
|
+
var isOnCloseEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
305
306
|
if (displayType === DisplayTypeEnum.inline) {
|
306
307
|
return;
|
307
308
|
}
|
@@ -309,13 +310,13 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
309
310
|
showRetentionPopup();
|
310
311
|
return;
|
311
312
|
} else {
|
312
|
-
_this2.handleClose();
|
313
|
+
_this2.handleClose(isOnCloseEvent);
|
313
314
|
}
|
314
315
|
};
|
315
316
|
|
316
317
|
// TODO 感觉有死循环
|
317
318
|
eventCenter.listen(EVENT.close.name, function () {
|
318
|
-
closeBtnCallbackForPopup();
|
319
|
+
closeBtnCallbackForPopup(true);
|
319
320
|
});
|
320
321
|
eventCenter.listen(EVENT.setAllowRetention.name, function (data) {
|
321
322
|
if (data === undefined || typeof data !== 'boolean') {
|
@@ -351,9 +352,10 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
351
352
|
}, {
|
352
353
|
key: "handleClose",
|
353
354
|
value: function handleClose() {
|
355
|
+
var isOnCloseEvent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
354
356
|
var eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
|
355
357
|
eventCenter.emit(EVENT.closeCallback.name, {});
|
356
|
-
if (this.enablePopWindowEventCallback) {
|
358
|
+
if (this.enablePopWindowEventCallback && !isOnCloseEvent) {
|
357
359
|
eventCenter.emit(EVENT.eventCallback.name, {
|
358
360
|
code: eventCodeEnum.SDK_PAYMENT_CANCEL,
|
359
361
|
result: {
|
@@ -116,7 +116,8 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
116
116
|
}, {
|
117
117
|
key: "buildWebAppPreloadUrl",
|
118
118
|
value: function buildWebAppPreloadUrl(initConfig, instanceId, sdkMetaData) {
|
119
|
-
var _this = this
|
119
|
+
var _this = this,
|
120
|
+
_initConfig$analytics;
|
120
121
|
var previousProductInfo = ProductInfoCacheUtil.getPreviousProductInfo(ProductSceneEnum.EASY_PAY, function (errorMsg) {
|
121
122
|
if (errorMsg) {
|
122
123
|
_this.logger.logError({
|
@@ -137,7 +138,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
137
138
|
isPreload: true,
|
138
139
|
productSceneVersion: productSceneVersion,
|
139
140
|
query: {
|
140
|
-
analyticsEnabled: initConfig.analytics.enabled,
|
141
|
+
analyticsEnabled: (_initConfig$analytics = initConfig.analytics) === null || _initConfig$analytics === void 0 ? void 0 : _initConfig$analytics.enabled,
|
141
142
|
displayType: DisplayTypeEnum.popup,
|
142
143
|
instanceId: instanceId,
|
143
144
|
locale: initConfig.locale,
|
@@ -152,7 +153,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
152
153
|
}, {
|
153
154
|
key: "buildWebAppUrl",
|
154
155
|
value: function buildWebAppUrl() {
|
155
|
-
var _paymentContext$payme3, _paymentContext$payme4;
|
156
|
+
var _paymentContext$payme3, _paymentContext$payme4, _this$initConfig$anal;
|
156
157
|
var paymentContext = this.paymentContext;
|
157
158
|
var paymentMethodCategoryType = (_paymentContext$payme3 = paymentContext.paymentSessionObj.paymentSessionConfig) === null || _paymentContext$payme3 === void 0 ? void 0 : _paymentContext$payme3.paymentMethodCategoryType;
|
158
159
|
var productSceneVersion = (_paymentContext$payme4 = paymentContext.paymentSessionObj.paymentSessionConfig) === null || _paymentContext$payme4 === void 0 ? void 0 : _paymentContext$payme4.productSceneVersion;
|
@@ -164,7 +165,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
164
165
|
productSceneVersion: productSceneVersion,
|
165
166
|
isPreload: false,
|
166
167
|
query: {
|
167
|
-
analyticsEnabled: this.initConfig.analytics.enabled,
|
168
|
+
analyticsEnabled: (_this$initConfig$anal = this.initConfig.analytics) === null || _this$initConfig$anal === void 0 ? void 0 : _this$initConfig$anal.enabled,
|
168
169
|
displayType: DisplayTypeEnum.popup,
|
169
170
|
instanceId: this.instanceId,
|
170
171
|
locale: this.initConfig.locale,
|
@@ -61,7 +61,7 @@ export declare class EventCenter implements Service {
|
|
61
61
|
* @param name - The name of the event to emit.
|
62
62
|
* @param data - The event data to pass to the event listeners.
|
63
63
|
*/
|
64
|
-
emit(name: string, data: any,
|
64
|
+
emit(name: string, data: any, eventPayload?: EventPayload): void;
|
65
65
|
/**
|
66
66
|
* Registers a callback for an event and immediately dispatches the event to the app.
|
67
67
|
* @param payloadContext - The context containing event information and callback ID.
|
@@ -77,6 +77,6 @@ export declare class EventCenter implements Service {
|
|
77
77
|
isExist(name: string): boolean;
|
78
78
|
}
|
79
79
|
interface IListener {
|
80
|
-
(data: any,
|
80
|
+
(data: any, eventPayload?: EventPayload): void;
|
81
81
|
}
|
82
82
|
export {};
|
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
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
10
|
import { v4 as uuid } from 'uuid';
|
11
11
|
import { ERRORMESSAGE } from "../../constant";
|
12
|
-
import {
|
12
|
+
import { MessageName } from "../../types";
|
13
13
|
import { isJsonString } from "../../util";
|
14
14
|
import { getIframeOrigin, registerSystemEvents, unRegisterSystemEvents } from "../utils/system_events";
|
15
15
|
|
@@ -108,11 +108,11 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
108
108
|
}
|
109
109
|
var isJson = isJsonString(e.data);
|
110
110
|
if (isJson) {
|
111
|
-
var
|
112
|
-
if (!this.checkEventCompliant(
|
111
|
+
var _eventPayload = JSON.parse(e.data);
|
112
|
+
if (!this.checkEventCompliant(_eventPayload)) {
|
113
113
|
return;
|
114
114
|
}
|
115
|
-
this._handleAppMessage(
|
115
|
+
this._handleAppMessage(_eventPayload);
|
116
116
|
} else {
|
117
117
|
console.error(ERRORMESSAGE.NOT_JSON_FORMAT);
|
118
118
|
}
|
@@ -196,11 +196,11 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
196
196
|
*/
|
197
197
|
}, {
|
198
198
|
key: "emit",
|
199
|
-
value: function emit(name, data,
|
199
|
+
value: function emit(name, data, eventPayload) {
|
200
200
|
if (this.events.has(name)) {
|
201
201
|
var eventList = this.events.get(name);
|
202
202
|
eventList.forEach(function (item) {
|
203
|
-
item.func(data,
|
203
|
+
item.func(data, eventPayload);
|
204
204
|
});
|
205
205
|
}
|
206
206
|
}
|