@alipay/ams-checkout 1.3.1 → 1.4.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.
Files changed (58) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/config/index.d.ts +2 -0
  3. package/esm/config/index.js +17 -0
  4. package/esm/config/request.d.ts +21 -0
  5. package/esm/config/request.js +67 -0
  6. package/esm/constant/index.d.ts +136 -0
  7. package/esm/constant/index.js +136 -0
  8. package/esm/core/component/index.d.ts +17 -0
  9. package/esm/core/component/index.js +100 -0
  10. package/esm/core/drop-in/index.d.ts +29 -0
  11. package/esm/core/drop-in/index.js +104 -0
  12. package/esm/core/instance/index.d.ts +59 -0
  13. package/esm/core/instance/index.js +254 -0
  14. package/esm/image/cta.svg +9 -0
  15. package/esm/index.d.ts +22 -0
  16. package/esm/plugin/component/cashierApp.d.ts +23 -0
  17. package/esm/plugin/component/cashierApp.js +122 -0
  18. package/esm/plugin/component/component.style.d.ts +8 -0
  19. package/esm/plugin/component/component.style.js +15 -0
  20. package/esm/plugin/component/index.d.ts +102 -0
  21. package/esm/plugin/component/index.js +900 -0
  22. package/esm/plugin/drop-in/index.d.ts +73 -0
  23. package/esm/plugin/drop-in/index.js +323 -0
  24. package/esm/request/index.d.ts +15 -0
  25. package/esm/request/index.js +145 -0
  26. package/esm/request/utils.d.ts +28 -0
  27. package/esm/request/utils.js +59 -0
  28. package/esm/service/index.d.ts +2 -0
  29. package/esm/service/index.js +40 -0
  30. package/esm/types/index.d.ts +216 -0
  31. package/esm/types/index.js +97 -0
  32. package/esm/util/createIframeNode.d.ts +5 -0
  33. package/esm/util/createIframeNode.js +35 -0
  34. package/esm/util/get.d.ts +25 -0
  35. package/esm/util/get.js +145 -0
  36. package/esm/util/index.d.ts +53 -0
  37. package/esm/util/index.js +237 -0
  38. package/esm/util/intl-callapp/es/browser.d.ts +21 -0
  39. package/esm/util/intl-callapp/es/browser.js +42 -0
  40. package/esm/util/intl-callapp/es/evoke.d.ts +13 -0
  41. package/esm/util/intl-callapp/es/evoke.js +39 -0
  42. package/esm/util/intl-callapp/es/generate.d.ts +29 -0
  43. package/esm/util/intl-callapp/es/generate.js +44 -0
  44. package/esm/util/intl-callapp/es/index.d.ts +43 -0
  45. package/esm/util/intl-callapp/es/index.js +298 -0
  46. package/esm/util/intl-callapp/es/main.d.ts +41 -0
  47. package/esm/util/intl-callapp/es/main.js +305 -0
  48. package/esm/util/intl-callapp/es/openWallet.d.ts +15 -0
  49. package/esm/util/intl-callapp/es/openWallet.js +197 -0
  50. package/esm/util/intl-callapp/es/types.d.ts +46 -0
  51. package/esm/util/intl-callapp/es/types.js +1 -0
  52. package/esm/util/intl-callapp/es/utils/config.d.ts +24 -0
  53. package/esm/util/intl-callapp/es/utils/config.js +57 -0
  54. package/esm/util/intl-callapp/es/utils/index.d.ts +15 -0
  55. package/esm/util/intl-callapp/es/utils/index.js +98 -0
  56. package/esm/util/mock.d.ts +1 -0
  57. package/esm/util/mock.js +4 -0
  58. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ import type { AMSCheckoutOptions, callOnError, callOnLog, callOnSizeChanged, checkoutState, optionsParams } from '../../types/index';
2
+ import { EventCenter } from '../../util/index';
3
+ export default class AMSSDK {
4
+ options: AMSCheckoutOptions;
5
+ checkoutState: checkoutState;
6
+ eventCenter: EventCenter;
7
+ protected plugins: Map<string, any>;
8
+ _instanceId: string;
9
+ constructor(options: optionsParams);
10
+ /**
11
+ * @description Destroy and process some contents of the plug-in
12
+ */
13
+ destroy(): void;
14
+ /**
15
+ * @description Set the sdk basic configuration
16
+ */
17
+ private _setOptions;
18
+ /**
19
+ * @description Set environment variables
20
+ */
21
+ private _setEnv;
22
+ /**
23
+ * @description Set UI and Network Mode
24
+ */
25
+ private _setMode;
26
+ /**
27
+ * @description Initialize event related tasks
28
+ */
29
+ private _initEvent;
30
+ /**
31
+ * @description Register plug-in
32
+ */
33
+ protected _registerPlugin(pluginId: string, plugin: any): void;
34
+ /**
35
+ * @description Get Plug-in
36
+ */
37
+ _getPlugin(pluginId: string): any;
38
+ /**
39
+ * @description Execute to open app or jump link
40
+ */
41
+ _redirect(data: {
42
+ normalUrl?: string;
43
+ schemeUrl?: string;
44
+ applinkUrl?: string;
45
+ }): Promise<void>;
46
+ /**
47
+ * @description Overlay Subscription
48
+ */
49
+ protected _overrideSubscription(name: string, func: any, funcKey: string): void;
50
+ /**
51
+ * @description Create an event handler, called when an error occurs in AMSCheckout.
52
+ */
53
+ onError(event: callOnError): void;
54
+ /**
55
+ * @description Create an event handler
56
+ */
57
+ onSizeChanged(event: callOnSizeChanged): void;
58
+ onLog(event: callOnLog): void;
59
+ }
@@ -0,0 +1,254 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+ 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; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
+ /**
12
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
13
+ *
14
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
15
+ * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
16
+ * 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.
17
+ */
18
+ import { v4 as uuid } from 'uuid';
19
+ import { ERRORMESSAGE, EVENT } from "../../constant";
20
+ import { environment, mode, networkMode, osType, terminalType } from "../../types/index";
21
+ import { device, EventCenter, getType, queryParse } from "../../util/index";
22
+ import CallApp from "../../util/intl-callapp/es/main";
23
+ var AMSSDK = /*#__PURE__*/function () {
24
+ function AMSSDK(options) {
25
+ _classCallCheck(this, AMSSDK);
26
+ _defineProperty(this, "options", void 0);
27
+ _defineProperty(this, "checkoutState", void 0);
28
+ _defineProperty(this, "eventCenter", void 0);
29
+ _defineProperty(this, "plugins", void 0);
30
+ _defineProperty(this, "_instanceId", void 0);
31
+ this._instanceId = uuid();
32
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
33
+ this.options = {};
34
+ this.eventCenter = new EventCenter();
35
+ this.checkoutState = {
36
+ paymentMethodType: ''
37
+ };
38
+ this._initEvent(options);
39
+ this._setOptions(options);
40
+ this.plugins = new Map();
41
+ }
42
+ /**
43
+ * @description Destroy and process some contents of the plug-in
44
+ */
45
+ _createClass(AMSSDK, [{
46
+ key: "destroy",
47
+ value: function destroy() {
48
+ var _iterator = _createForOfIteratorHelper(this.plugins.values()),
49
+ _step;
50
+ try {
51
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
52
+ var plugin = _step.value;
53
+ try {
54
+ plugin.logoutPlugin();
55
+ // eslint-disable-next-line no-empty
56
+ } catch (error) {}
57
+ }
58
+ } catch (err) {
59
+ _iterator.e(err);
60
+ } finally {
61
+ _iterator.f();
62
+ }
63
+ }
64
+ /**
65
+ * @description Set the sdk basic configuration
66
+ */
67
+ }, {
68
+ key: "_setOptions",
69
+ value: function _setOptions(options) {
70
+ this._setMode(options);
71
+ this._setEnv(options);
72
+ this.options.locale = (options === null || options === void 0 ? void 0 : options.locale) || '';
73
+ }
74
+ /**
75
+ * @description Set environment variables
76
+ */
77
+ }, {
78
+ key: "_setEnv",
79
+ value: function _setEnv(options) {
80
+ var _queryParse = queryParse(),
81
+ _moreEnv = _queryParse._moreEnv;
82
+ if (options !== null && options !== void 0 && options.environment && !((options === null || options === void 0 ? void 0 : options.environment) in environment) && _moreEnv !== 'true') {
83
+ console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.errorMessage);
84
+ options.environment = 'prod';
85
+ }
86
+ this.options.env = {
87
+ terminalType: device.isMobile ? terminalType.WAP : terminalType.WEB,
88
+ environment: (options === null || options === void 0 ? void 0 : options.environment) || 'prod'
89
+ };
90
+ if (this.options.env.terminalType === terminalType.WAP) {
91
+ // eslint-disable-next-line no-nested-ternary
92
+ this.options.env.osType = device.iOS ? osType.IOS : device.Android ? osType.ANDROID : osType.ELSE;
93
+ }
94
+ }
95
+ /**
96
+ * @description Set UI and Network Mode
97
+ */
98
+ }, {
99
+ key: "_setMode",
100
+ value: function _setMode(options) {
101
+ this.options.mode = (options === null || options === void 0 ? void 0 : options.mode) || mode.dropin;
102
+ if (options !== null && options !== void 0 && options.mode && !((options === null || options === void 0 ? void 0 : options.mode) in mode)) {
103
+ console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.MODE_ERROR.errorMessage);
104
+ this.options.mode = mode.component;
105
+ }
106
+ this.options.networkMode = (options === null || options === void 0 ? void 0 : options.networkMode) || networkMode.session;
107
+ if (options !== null && options !== void 0 && options.networkMode && !((options === null || options === void 0 ? void 0 : options.networkMode) in networkMode)) {
108
+ console.warn(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.errorMessage);
109
+ this.options.networkMode = networkMode.proxy;
110
+ }
111
+ }
112
+ /**
113
+ * @description Initialize event related tasks
114
+ */
115
+ }, {
116
+ key: "_initEvent",
117
+ value: function _initEvent(options) {
118
+ if (options !== null && options !== void 0 && options.onError) {
119
+ if (getType(options.onError) !== 'function') throw new Error(ERRORMESSAGE.INIT_PARAMETER_ERROR.EVENT_ERROR.errorMessage);
120
+ this._overrideSubscription(EVENT.error.name, options.onError, EVENT.error.uniqueKey);
121
+ }
122
+ if (options !== null && options !== void 0 && options.onPaymentMethodSelected) {
123
+ if (getType(options.onPaymentMethodSelected) !== 'function') throw new Error(ERRORMESSAGE.INIT_PARAMETER_ERROR.EVENT_ERROR.errorMessage);
124
+ this._overrideSubscription(EVENT.paymentMethodSelected.name, options.onPaymentMethodSelected, EVENT.paymentMethodSelected.uniqueKey);
125
+ }
126
+ if (options !== null && options !== void 0 && options.onSizeChanged) {
127
+ if (getType(options.onSizeChanged) !== 'function') throw new Error(ERRORMESSAGE.INIT_PARAMETER_ERROR.EVENT_ERROR.errorMessage);
128
+ this._overrideSubscription(EVENT.sizeChanged.name, options.onSizeChanged, EVENT.sizeChanged.uniqueKey);
129
+ }
130
+ if (options !== null && options !== void 0 && options.onLog) {
131
+ if (getType(options.onLog) !== 'function') throw new Error(ERRORMESSAGE.INIT_PARAMETER_ERROR.EVENT_ERROR.errorMessage);
132
+ this._overrideSubscription(EVENT.log.name, options.onLog, EVENT.log.uniqueKey);
133
+ }
134
+ if (options !== null && options !== void 0 && options.onEventCallback) {
135
+ if (getType(options.onEventCallback) !== 'function') throw new Error(ERRORMESSAGE.INIT_PARAMETER_ERROR.EVENT_ERROR.errorMessage);
136
+ this._overrideSubscription(EVENT.eventCallback.name, options.onEventCallback, EVENT.eventCallback.uniqueKey);
137
+ }
138
+ if (options !== null && options !== void 0 && options.onClose) {
139
+ if (getType(options.onClose) !== 'function') throw new Error(ERRORMESSAGE.INIT_PARAMETER_ERROR.EVENT_ERROR.errorMessage);
140
+ this._overrideSubscription(EVENT.onClose.name, options.onClose, EVENT.onClose.uniqueKey);
141
+ }
142
+ }
143
+ /**
144
+ * @description Register plug-in
145
+ */
146
+ }, {
147
+ key: "_registerPlugin",
148
+ value: function _registerPlugin(pluginId, plugin) {
149
+ this.plugins.set(pluginId, plugin);
150
+ try {
151
+ plugin.applyPlugin(this);
152
+ } catch (error) {
153
+ this.plugins.delete(pluginId);
154
+ if (getType(error) === 'error') throw error;
155
+ throw new Error("Failed to register plug-in\uFF1A".concat(pluginId, " Exception in the apply function of the plug-in"));
156
+ }
157
+ }
158
+ /**
159
+ * @description Get Plug-in
160
+ */
161
+ }, {
162
+ key: "_getPlugin",
163
+ value: function _getPlugin(pluginId) {
164
+ if (!this.plugins.has(pluginId)) {
165
+ console.warn("".concat(pluginId, "Plugin unregistered"));
166
+ return null;
167
+ }
168
+ return this.plugins.get(pluginId);
169
+ }
170
+ /**
171
+ * @description Execute to open app or jump link
172
+ */
173
+ }, {
174
+ key: "_redirect",
175
+ value: function _redirect(data) {
176
+ var _this = this;
177
+ return new Promise(function (resolve, reject) {
178
+ var isWeb = _this.options.env.terminalType === terminalType.WEB;
179
+ var normalUrl = (data === null || data === void 0 ? void 0 : data.normalUrl) || '';
180
+ var schemeUrl = (data === null || data === void 0 ? void 0 : data.schemeUrl) || '';
181
+ var applinkUrl = (data === null || data === void 0 ? void 0 : data.applinkUrl) || '';
182
+ var jumpFunc = function jumpFunc() {
183
+ if (normalUrl) {
184
+ resolve();
185
+ window.location.href = normalUrl;
186
+ return;
187
+ }
188
+ reject(ERRORMESSAGE.SDK_CALL_URL_ERROR.REDIRECT_ERROR);
189
+ };
190
+ var callAppFunc = function callAppFunc() {
191
+ if (!schemeUrl && !applinkUrl) {
192
+ jumpFunc();
193
+ return;
194
+ }
195
+ var config = {
196
+ fallback: function fallback() {
197
+ jumpFunc();
198
+ },
199
+ successCb: function successCb() {
200
+ resolve();
201
+ },
202
+ delay: 0
203
+ };
204
+ try {
205
+ var callLib = new CallApp(config);
206
+ callLib.open({
207
+ scheme: schemeUrl,
208
+ link: applinkUrl
209
+ });
210
+ } catch (error) {
211
+ jumpFunc();
212
+ }
213
+ };
214
+ if (isWeb) {
215
+ jumpFunc();
216
+ } else {
217
+ callAppFunc();
218
+ }
219
+ });
220
+ }
221
+ /**
222
+ * @description Overlay Subscription
223
+ */
224
+ }, {
225
+ key: "_overrideSubscription",
226
+ value: function _overrideSubscription(name, func, funcKey) {
227
+ this.eventCenter.off(name, func, funcKey);
228
+ this.eventCenter.on(name, func, funcKey);
229
+ }
230
+ /**
231
+ * @description Create an event handler, called when an error occurs in AMSCheckout.
232
+ */
233
+ }, {
234
+ key: "onError",
235
+ value: function onError(event) {
236
+ this._overrideSubscription(EVENT.error.name, event, EVENT.error.uniqueKey);
237
+ }
238
+ /**
239
+ * @description Create an event handler
240
+ */
241
+ }, {
242
+ key: "onSizeChanged",
243
+ value: function onSizeChanged(event) {
244
+ this._overrideSubscription(EVENT.sizeChanged.name, event, EVENT.sizeChanged.uniqueKey);
245
+ }
246
+ }, {
247
+ key: "onLog",
248
+ value: function onLog(event) {
249
+ this._overrideSubscription(EVENT.log.name, event, EVENT.log.uniqueKey);
250
+ }
251
+ }]);
252
+ return AMSSDK;
253
+ }();
254
+ export { AMSSDK as default };
@@ -0,0 +1,9 @@
1
+ <svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="">
2
+ <path d="M-9.61651e-07 22C-1.49276e-06 9.84974 9.84973 -4.30546e-07 22 -9.61651e-07C34.1503 -1.49276e-06 44 9.84973 44 22C44 34.1503 34.1503 44 22 44C9.84974 44 -4.30546e-07 34.1503 -9.61651e-07 22ZM4 22C4 31.9411 12.0589 40 22 40C31.9411 40 40 31.9411 40 22C40 12.0589 31.9411 4 22 4C12.0589 4 4 12.0589 4 22Z" fill="url(#paint0_angular_2884_126722)"/>
3
+ <defs>
4
+ <radialGradient id="paint0_angular_2884_126722" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(22 22) rotate(180) scale(22)">
5
+ <stop stop-color="#889CB8"/>
6
+ <stop offset="1" stop-color="#CFD8E5" stop-opacity="0"/>
7
+ </radialGradient>
8
+ </defs>
9
+ </svg>
package/esm/index.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
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
+ */
8
+ import { IcreateComponentFunc } from './core/component/index';
9
+ import { IconfirmPaymentFunc, IcreatePaymentFunc } from './core/drop-in/index';
10
+ import AMSSDK from './core/instance';
11
+ import { optionsParams } from './types';
12
+ export * from './types';
13
+ export declare class AMSCheckout extends AMSSDK {
14
+ createComponent: IcreateComponentFunc;
15
+ createPayment: IcreatePaymentFunc;
16
+ confirmPayment: IconfirmPaymentFunc;
17
+ constructor(options: optionsParams);
18
+ }
19
+ export declare class AMSAutoDebit extends AMSCheckout {
20
+ constructor(options: optionsParams);
21
+ }
22
+ export default AMSCheckout;
@@ -0,0 +1,23 @@
1
+ import { componentSignEnum, Ianalytics } from '../../types';
2
+ export declare const getAppPath: (environment: string | undefined, appVersion: string, componentSign: componentSignEnum, productSceneVersion: string, extendInfo: string) => any;
3
+ export declare const getAppDomain: (domainParams: {
4
+ environment: string;
5
+ appVersion: string;
6
+ componentSign: componentSignEnum;
7
+ productSceneVersion: string;
8
+ extendInfo: string;
9
+ }) => string;
10
+ export declare const getIframeUrl: (iframeParams: {
11
+ componentSign: componentSignEnum;
12
+ analytics?: Ianalytics;
13
+ productSceneVersion: string;
14
+ environment: string;
15
+ appVersion: string;
16
+ extendInfo: string;
17
+ locale: string;
18
+ instanceId: string;
19
+ }) => string;
20
+ /**
21
+ * @description Create iframe
22
+ */
23
+ export declare const createIframe: (mode: string) => HTMLIFrameElement;
@@ -0,0 +1,122 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ 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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ /**
6
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
10
+ * 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.
11
+ */
12
+ import { marmptMap, sdkVersion } from "../../config/index";
13
+ import { componentSignEnum } from "../../types";
14
+ import { getViewPort, queryParse, serialize } from "../../util/index";
15
+ var getAppVersion = function getAppVersion(_extendInfo) {
16
+ try {
17
+ var info = JSON.parse(_extendInfo);
18
+ return info.versionMap.web[sdkVersion].targetWebVerison;
19
+ } catch (error) {
20
+ return '';
21
+ }
22
+ };
23
+ var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
24
+ var _signSupportMap;
25
+ var signSupportMap = (_signSupportMap = {}, _defineProperty(_signSupportMap, componentSignEnum.NONE, ['']), _defineProperty(_signSupportMap, componentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), _defineProperty(_signSupportMap, componentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), _signSupportMap);
26
+ var supportProductSceneVersion = signSupportMap[componentSign];
27
+ // 从左到右,从旧到新
28
+ var isSupport = supportProductSceneVersion.find(function (it) {
29
+ return it === productSceneVersion;
30
+ });
31
+ var finalProductSceneVersion = supportProductSceneVersion[supportProductSceneVersion.length - 1];
32
+ return isSupport ? productSceneVersion : finalProductSceneVersion;
33
+ };
34
+ export var getAppPath = function getAppPath() {
35
+ var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
36
+ var appVersion = arguments.length > 1 ? arguments[1] : undefined;
37
+ var componentSign = arguments.length > 2 ? arguments[2] : undefined;
38
+ var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
39
+ var extendInfo = arguments.length > 4 ? arguments[4] : undefined;
40
+ var _ref = queryParse() || {},
41
+ urlTestHost = _ref.host;
42
+ var finalAppVersion = getAppVersion(extendInfo) || appVersion;
43
+ var finalProductSceneVersion = getFinalProductSceneVersion(componentSign, productSceneVersion);
44
+
45
+ // only for test while testurl?host=https://xxxxx.test.html
46
+ if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
47
+ return urlTestHost;
48
+ }
49
+ return "".concat(marmptMap[environment], "/").concat(componentSign, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
50
+ };
51
+ export var getAppDomain = function getAppDomain(domainParams) {
52
+ var environment = domainParams.environment,
53
+ appVersion = domainParams.appVersion,
54
+ componentSign = domainParams.componentSign,
55
+ productSceneVersion = domainParams.productSceneVersion,
56
+ extendInfo = domainParams.extendInfo;
57
+ var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
58
+ var macth = reg.exec(getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo));
59
+ return macth && macth[0] || '';
60
+ };
61
+ export var getIframeUrl = function getIframeUrl(iframeParams) {
62
+ var componentSign = iframeParams.componentSign,
63
+ _iframeParams$analyti = iframeParams.analytics,
64
+ analytics = _iframeParams$analyti === void 0 ? {
65
+ enabled: true
66
+ } : _iframeParams$analyti,
67
+ productSceneVersion = iframeParams.productSceneVersion,
68
+ environment = iframeParams.environment,
69
+ appVersion = iframeParams.appVersion,
70
+ extendInfo = iframeParams.extendInfo,
71
+ locale = iframeParams.locale,
72
+ instanceId = iframeParams.instanceId;
73
+ var path = getAppPath(environment, appVersion, componentSign, productSceneVersion, extendInfo || '');
74
+ var initialScale = 1;
75
+ var scale = getViewPort('initial-scale') || initialScale;
76
+ var _queryParse = queryParse(),
77
+ _sandbox = _queryParse._sandbox,
78
+ _light_sandbox = _queryParse._light_sandbox,
79
+ _queryParse$requestHo = _queryParse.requestHost,
80
+ requestHost = _queryParse$requestHo === void 0 ? '' : _queryParse$requestHo,
81
+ _queryParse$groupId = _queryParse.groupId,
82
+ groupId = _queryParse$groupId === void 0 ? '' : _queryParse$groupId,
83
+ LOCAL_MOCK = _queryParse.LOCAL_MOCK;
84
+ var urlParams = Object.assign({}, {
85
+ locale: locale,
86
+ scale: scale,
87
+ instanceId: instanceId,
88
+ sandbox: environment === 'light_sandbox' || _light_sandbox === 'true' ? 'true' : 'false',
89
+ analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
90
+ sdkVersion: sdkVersion,
91
+ refUrl: window.location.href,
92
+ shadow: environment === 'sandbox' || _sandbox === 'true' ? 'true' : 'false',
93
+ requestHost: requestHost,
94
+ groupId: groupId,
95
+ LOCAL_MOCK: LOCAL_MOCK
96
+ });
97
+ var locationSearch = serialize(urlParams);
98
+ return "".concat(path, "?").concat(locationSearch);
99
+ };
100
+ var getIframeId = function getIframeId(UIMode) {
101
+ var IdMap = {
102
+ dropin: 'checkout-dropin',
103
+ component: 'checkout-component'
104
+ };
105
+ return IdMap[UIMode] || 'checkout-component';
106
+ };
107
+
108
+ /**
109
+ * @description Create iframe
110
+ */
111
+ export var createIframe = function createIframe(mode) {
112
+ var iframe = document.createElement('iframe');
113
+ var iframeId = getIframeId(mode);
114
+ var none = '0';
115
+ var width = '100%';
116
+ iframe.id = iframeId;
117
+ iframe.style.height = none;
118
+ iframe.style.width = width;
119
+ iframe.style.border = none;
120
+ iframe.style.overflow = 'hidden';
121
+ return iframe;
122
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
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
+ */
8
+ export declare function componentAddCSS(): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+ * 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
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
+ */
8
+
9
+ var componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n transform-origin: 50% 50%;\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n \n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translateX(-50%) translateY(-50%) scale(0.4);\n opacity: 0\n }\n\n 80% {\n opacity: 1\n }\n\n 100% {\n opacity: 1;\n transform: translateX(-50%) translateY(-50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation-fill-mode: forwards;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 600;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 600;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 8px;\n max-width: 225px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 600;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 8px;\n max-width: 225px;\n}\n\n";
10
+ export function componentAddCSS() {
11
+ var style = document.createElement('style');
12
+ style.type = 'text/css';
13
+ style.innerHTML = componentCss;
14
+ document.head.appendChild(style);
15
+ }
@@ -0,0 +1,102 @@
1
+ import type AMSCheckout from '../../core/instance';
2
+ import type { IappendIframeNodesParams, IcreateComponent } from '../../types';
3
+ import { CashierSdkActionQueryResult, componentSignEnum } from '../../types';
4
+ export default class ComponentApp {
5
+ app: any;
6
+ appDomain: string;
7
+ AMSSDK: AMSCheckout;
8
+ platform: 'desktop' | 'mobile';
9
+ private createIframeNode;
10
+ private _selector;
11
+ private _appVersion;
12
+ private _isRetention;
13
+ private _actionQueryPromise;
14
+ private _renderParams;
15
+ private _componentSign;
16
+ private _performanceData;
17
+ private _isInitComponent;
18
+ private _clickEventName;
19
+ constructor();
20
+ /**
21
+ * @description Cancel listening and destroy the dom
22
+ */
23
+ logoutPlugin(): void;
24
+ /**
25
+ * @description When SDK registers plug-ins, it is a required function to receive SDK instances
26
+ */
27
+ applyPlugin(AMSSDK: AMSCheckout): void;
28
+ /**
29
+ * @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
30
+ */
31
+ setRender(createIframeNode: (context: ComponentApp, params: IcreateComponent) => Promise<void>): void;
32
+ /**
33
+ * @description render iframe content
34
+ */
35
+ appendIframeNodes(componentSign: componentSignEnum, renderParams: IappendIframeNodesParams): Promise<void | [void, CashierSdkActionQueryResult | null]>;
36
+ /**
37
+ * @description Interface request
38
+ */
39
+ private createActionQueryPromise;
40
+ private cleanApp;
41
+ /**
42
+ * @description Create app
43
+ */
44
+ private createApp;
45
+ private listener;
46
+ private resizeListener;
47
+ /**
48
+ * @description Initialize subscription iframe message
49
+ */
50
+ private _addEventListener;
51
+ private _removeEventListener;
52
+ /**
53
+ * @description Processing messages from iframe
54
+ */
55
+ private _handleAppMessage;
56
+ private handleSizeChanged;
57
+ private handleRedirect;
58
+ private handleDeclareInfo;
59
+ private handleCloseBtnShow;
60
+ /**
61
+ * @description Send message to SDK
62
+ */
63
+ private dispatchToSDK;
64
+ /**
65
+ * @description Send message to iframe
66
+ */
67
+ private dispatchToApp;
68
+ /**
69
+ * @description Subscribe to messages from SDK
70
+ */
71
+ private subscribeFromSDK;
72
+ /**
73
+ * @description Send rendering events to iframe
74
+ */
75
+ private sendRenderEvent;
76
+ private showLoading;
77
+ /**
78
+ * @description show cashier
79
+ */
80
+ private showCashier;
81
+ /**
82
+ * @description close cashier
83
+ */
84
+ private closeCashier;
85
+ private hideComponentAndCleanDom;
86
+ private closeBtnFunc;
87
+ /**
88
+ * @description create mount node
89
+ */
90
+ private createMountElement;
91
+ private createCloseBtn;
92
+ private createRetentionPopup;
93
+ private retentionPopupLeaveFunc;
94
+ private removeRetentionPopup;
95
+ private showRetentionPopup;
96
+ private hideRetentionPopup;
97
+ /**
98
+ * @description create mockup
99
+ */
100
+ private createMockup;
101
+ private submitForm;
102
+ }