@alipay/ams-checkout 0.0.1732886551-dev.3 → 0.0.1733198624-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 +7 -7
- package/esm/constant/index.d.ts +0 -4
- package/esm/constant/index.js +0 -5
- package/esm/foundation/core/index.d.ts +0 -1
- package/esm/foundation/core/index.js +11 -28
- package/esm/foundation/service/container/index.js +0 -2
- package/esm/foundation/service/event-center.d.ts +1 -6
- package/esm/foundation/service/event-center.js +4 -15
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -5
- 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.25.
|
9
|
-
export declare const AMSAutoDebitAppVersion = "1.25.
|
10
|
-
export declare const AMSEasyPayAppVersion = "1.25.
|
11
|
-
export declare const AMSCashierPaymentAppVersion = "1.25.
|
12
|
-
export declare const AMSVaultingAppVersion = "1.25.
|
13
|
-
export declare const AMSPaymentElementAppVersion = "1.25.
|
14
|
-
export declare const ADDRESSElementAppVersion = "1.25.
|
8
|
+
export declare const AMSCheckoutAppVersion = "1.25.2";
|
9
|
+
export declare const AMSAutoDebitAppVersion = "1.25.2";
|
10
|
+
export declare const AMSEasyPayAppVersion = "1.25.2";
|
11
|
+
export declare const AMSCashierPaymentAppVersion = "1.25.2";
|
12
|
+
export declare const AMSVaultingAppVersion = "1.25.2";
|
13
|
+
export declare const AMSPaymentElementAppVersion = "1.25.2";
|
14
|
+
export declare const ADDRESSElementAppVersion = "1.25.2";
|
package/esm/config/index.js
CHANGED
@@ -35,10 +35,10 @@ export var sdkVersion = json.version;
|
|
35
35
|
/**
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
37
37
|
*/
|
38
|
-
export var AMSCheckoutAppVersion = '1.25.
|
39
|
-
export var AMSAutoDebitAppVersion = '1.25.
|
40
|
-
export var AMSEasyPayAppVersion = '1.25.
|
41
|
-
export var AMSCashierPaymentAppVersion = '1.25.
|
42
|
-
export var AMSVaultingAppVersion = '1.25.
|
43
|
-
export var AMSPaymentElementAppVersion = '1.25.
|
44
|
-
export var ADDRESSElementAppVersion = '1.25.
|
38
|
+
export var AMSCheckoutAppVersion = '1.25.2'; // 兜底版本号
|
39
|
+
export var AMSAutoDebitAppVersion = '1.25.2'; // 代扣
|
40
|
+
export var AMSEasyPayAppVersion = '1.25.2'; // easypay
|
41
|
+
export var AMSCashierPaymentAppVersion = '1.25.2'; // 收银台(卡、apm)
|
42
|
+
export var AMSVaultingAppVersion = '1.25.2'; // 绑卡
|
43
|
+
export var AMSPaymentElementAppVersion = '1.25.2'; // payment element
|
44
|
+
export var ADDRESSElementAppVersion = '1.25.2'; // address element
|
package/esm/constant/index.d.ts
CHANGED
package/esm/constant/index.js
CHANGED
@@ -112,11 +112,6 @@ export var EVENT = {
|
|
112
112
|
name: 'onClose',
|
113
113
|
uniqueKey: 'userOnClose'
|
114
114
|
},
|
115
|
-
// 标记 SDK 回调事件
|
116
|
-
closeCallback: {
|
117
|
-
name: 'onCloseCallback',
|
118
|
-
uniqueKey: 'closeCallback'
|
119
|
-
},
|
120
115
|
eventCallback: {
|
121
116
|
name: 'onEventCallback',
|
122
117
|
uniqueKey: 'userEventCallback'
|
@@ -10,7 +10,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
10
10
|
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; }
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
12
12
|
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); }
|
13
|
-
import { DisplayTypeEnum
|
13
|
+
import { DisplayTypeEnum } from "../../types";
|
14
14
|
import { DisplayInfo } from "../index";
|
15
15
|
import { v4 as uuid } from 'uuid';
|
16
16
|
import { ServiceProvider } from "../service";
|
@@ -150,18 +150,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
150
150
|
return _ref2.apply(this, arguments);
|
151
151
|
};
|
152
152
|
}());
|
153
|
-
eventCenter.listen(EVENT.closeCallback.name, function () {
|
154
|
-
var _options$onClose;
|
155
|
-
(_options$onClose = options.onClose) === null || _options$onClose === void 0 || _options$onClose.call(options);
|
156
|
-
});
|
157
|
-
eventCenter.listen(EVENT.eventCallback.name, function (data) {
|
158
|
-
var _options$onEventCallb;
|
159
|
-
(_options$onEventCallb = options.onEventCallback) === null || _options$onEventCallb === void 0 || _options$onEventCallb.call(options, data);
|
160
|
-
});
|
161
|
-
eventCenter.listen(EVENT.error.name, function (data) {
|
162
|
-
var _options$onError;
|
163
|
-
(_options$onError = options.onError) === null || _options$onError === void 0 || _options$onError.call(options, data);
|
164
|
-
});
|
165
153
|
|
166
154
|
// execute additional logic from specified product
|
167
155
|
if (this.productProcessors[sdkMetaData.productScene]) {
|
@@ -303,7 +291,11 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
303
291
|
showRetentionPopup();
|
304
292
|
return;
|
305
293
|
} else {
|
306
|
-
_this2.
|
294
|
+
_this2.cleanRender();
|
295
|
+
eventCenter.dispatchToApp({
|
296
|
+
event: EVENT.close.name,
|
297
|
+
data: {}
|
298
|
+
});
|
307
299
|
}
|
308
300
|
};
|
309
301
|
|
@@ -330,8 +322,12 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
330
322
|
createRetentionPopup(platform, function () {
|
331
323
|
hideRetentionPopup();
|
332
324
|
}, function () {
|
325
|
+
eventCenter.dispatchToApp({
|
326
|
+
event: EVENT.close.name,
|
327
|
+
data: {}
|
328
|
+
});
|
333
329
|
hideRetentionPopup();
|
334
|
-
_this2.
|
330
|
+
_this2.cleanRender();
|
335
331
|
});
|
336
332
|
createMockup({
|
337
333
|
platform: platform,
|
@@ -341,19 +337,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
341
337
|
return;
|
342
338
|
}
|
343
339
|
}
|
344
|
-
}, {
|
345
|
-
key: "handleClose",
|
346
|
-
value: function handleClose() {
|
347
|
-
var eventCenter = ServiceProvider.getInstance(this.instanceId).getService('EventCenter');
|
348
|
-
eventCenter.emit(EVENT.closeCallback.name, {});
|
349
|
-
eventCenter.emit(EVENT.eventCallback.name, {
|
350
|
-
code: eventCodeEnum.SDK_PAYMENT_CANCEL,
|
351
|
-
result: {
|
352
|
-
result: {}
|
353
|
-
}
|
354
|
-
});
|
355
|
-
this.cleanRender();
|
356
|
-
}
|
357
340
|
}, {
|
358
341
|
key: "cleanRender",
|
359
342
|
value: function cleanRender() {
|
@@ -82,8 +82,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
82
82
|
}
|
83
83
|
var container = document.getElementById(COMPONENT_CONTAINER_ID);
|
84
84
|
if (container) container === null || container === void 0 || container.remove();
|
85
|
-
this.webApp = null;
|
86
|
-
this.eventCenter.cleanIFrames();
|
87
85
|
|
88
86
|
// animation
|
89
87
|
(_document$getElementB = document.getElementById("".concat(COMPONENT_CONTAINER_ID, "-").concat(displayInfo.platform, "-animation-style"))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
@@ -27,10 +27,6 @@ export declare class EventCenter implements Service {
|
|
27
27
|
* @param domain - The domain of the app.
|
28
28
|
*/
|
29
29
|
addIFrame(iframe: HTMLIFrameElement): void;
|
30
|
-
/**
|
31
|
-
* Cleans iframes when web app close
|
32
|
-
*/
|
33
|
-
cleanIFrames(): void;
|
34
30
|
removeIFrame(iframe: HTMLIFrameElement): void;
|
35
31
|
/**
|
36
32
|
* Handles messages received from the app.
|
@@ -46,9 +42,8 @@ export declare class EventCenter implements Service {
|
|
46
42
|
* Listens to an event by adding a callback function.
|
47
43
|
* @param name - The name of the event to listen for.
|
48
44
|
* @param func - The callback function to execute when the event is emitted.
|
49
|
-
* @param isAppend - Append to event handlers as chain, default value is false
|
50
45
|
*/
|
51
|
-
listen(name: string, func: IListener
|
46
|
+
listen(name: string, func: IListener): void;
|
52
47
|
/**
|
53
48
|
* Unsubscribes from an event. If a function is provided, only that function is removed.
|
54
49
|
* @param name - The name of the event to unlisten to.
|
@@ -72,15 +72,6 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
72
72
|
origin: getIframeOrigin(iframe)
|
73
73
|
});
|
74
74
|
}
|
75
|
-
|
76
|
-
/**
|
77
|
-
* Cleans iframes when web app close
|
78
|
-
*/
|
79
|
-
}, {
|
80
|
-
key: "cleanIFrames",
|
81
|
-
value: function cleanIFrames() {
|
82
|
-
this.iframes = [];
|
83
|
-
}
|
84
75
|
}, {
|
85
76
|
key: "removeIFrame",
|
86
77
|
value: function removeIFrame(iframe) {
|
@@ -108,11 +99,11 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
108
99
|
}
|
109
100
|
var isJson = isJsonString(e.data);
|
110
101
|
if (isJson) {
|
111
|
-
var
|
112
|
-
if (
|
102
|
+
var _EventPayload = JSON.parse(e.data);
|
103
|
+
if (_EventPayload.name !== MessageName.APP_TO_SDK) {
|
113
104
|
return;
|
114
105
|
}
|
115
|
-
this._handleAppMessage(
|
106
|
+
this._handleAppMessage(_EventPayload);
|
116
107
|
} else {
|
117
108
|
console.error(ERRORMESSAGE.NOT_JSON_FORMAT);
|
118
109
|
}
|
@@ -135,13 +126,11 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
135
126
|
* Listens to an event by adding a callback function.
|
136
127
|
* @param name - The name of the event to listen for.
|
137
128
|
* @param func - The callback function to execute when the event is emitted.
|
138
|
-
* @param isAppend - Append to event handlers as chain, default value is false
|
139
129
|
*/
|
140
130
|
}, {
|
141
131
|
key: "listen",
|
142
132
|
value: function listen(name, func) {
|
143
|
-
var
|
144
|
-
var eventList = isAppend ? this.events.get(name) || [] : [];
|
133
|
+
var eventList = this.events.get(name) || [];
|
145
134
|
eventList.push({
|
146
135
|
func: func
|
147
136
|
});
|
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED