@alipay/ams-checkout 0.0.1757298389-dev.17 → 0.0.1757298389-dev.19
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/constant/index.d.ts +102 -88
- package/esm/constant/index.js +23 -6
- package/esm/core/component/element/elementController/index.d.ts +3 -8
- package/esm/core/component/element/elementController/index.js +54 -36
- package/esm/core/component/element/index.d.ts +3 -10
- package/esm/core/component/element/index.js +4 -1
- package/esm/core/component/element/mock.js +1 -0
- package/esm/core/component/element/type.d.ts +23 -4
- package/esm/core/component/element/type.js +16 -0
- package/esm/core/component/element/util.d.ts +4 -2
- package/esm/core/component/element/util.js +4 -1
- package/esm/plugin/component/index.js +2 -2
- package/esm/types/index.d.ts +2 -2
- package/esm/types/index.js +1 -1
- package/package.json +1 -1
- package/esm/core/component/oldElement/components/address.d.ts +0 -19
- package/esm/core/component/oldElement/components/address.js +0 -68
- package/esm/core/component/oldElement/components/auth.d.ts +0 -17
- package/esm/core/component/oldElement/components/auth.js +0 -60
- package/esm/core/component/oldElement/components/payment.d.ts +0 -19
- package/esm/core/component/oldElement/components/payment.js +0 -74
- package/esm/core/component/oldElement/index.d.ts +0 -59
- package/esm/core/component/oldElement/index.js +0 -956
- package/esm/core/component/oldElement/mock.d.ts +0 -6
- package/esm/core/component/oldElement/mock.js +0 -567
- package/esm/core/component/oldElement/type.d.ts +0 -354
- package/esm/core/component/oldElement/type.js +0 -81
- package/esm/core/component/oldElement/utils.d.ts +0 -13
- package/esm/core/component/oldElement/utils.js +0 -6
|
@@ -17,13 +17,13 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
17
17
|
* 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.
|
|
18
18
|
*/
|
|
19
19
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
20
|
+
import { ElementPaymentMethod } from "../../core/component/element/type";
|
|
20
21
|
import { v4 as uuid } from 'uuid';
|
|
21
22
|
import { sdkVersion } from "../../config";
|
|
22
23
|
import { COMPONENTPLUGINID, COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, COMPONENT_RETENTION_ID, COMPONENT_SECTION_ID, ERRORMESSAGE, EVENT, LISTENER_PREFIX, LOADING_ID, LOADTIME_LIMIT, MOCKUP_ID, POPUP_LOADTIME_LOG_LIMIT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../constant";
|
|
23
|
-
import { ElementPaymentMethod } from "../../core/component/oldElement/type";
|
|
24
24
|
import { queryPaymentInfo, submitPayInfo } from "../../service";
|
|
25
25
|
import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, TargetEnum } from "../../types";
|
|
26
|
-
import { getType, isJsonString, isPC
|
|
26
|
+
import { device, getType, isJsonString, isPC } from "../../util";
|
|
27
27
|
import { getBackScheme } from "../../util/getBackScheme";
|
|
28
28
|
import { isLocalMock } from "../../util/mock";
|
|
29
29
|
import { matchVersion } from "../../util/versionCompare";
|
package/esm/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { IApplePayContactField } from '../plugin/applepay/interface';
|
|
9
9
|
export type onChange = () => onCnageResult;
|
|
10
|
-
export { ElementType, PaymentElementLayout, ThemeType
|
|
10
|
+
export { type IElementOptions, ElementType, PaymentElementLayout, ThemeType } from '../core/component/element/type';
|
|
11
11
|
interface onCnageResult {
|
|
12
12
|
complete: boolean;
|
|
13
13
|
addressValue: AddressItem[];
|
|
@@ -838,6 +838,6 @@ export declare enum EventLoggingEventId {
|
|
|
838
838
|
}
|
|
839
839
|
export interface ErrorMessage {
|
|
840
840
|
code: string;
|
|
841
|
-
message
|
|
841
|
+
message: string;
|
|
842
842
|
[key: string]: ErrorMessage | string;
|
|
843
843
|
}
|
package/esm/types/index.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
10
|
|
|
11
|
-
export { ElementType, PaymentElementLayout, ThemeType } from "../core/component/
|
|
11
|
+
export { ElementType, PaymentElementLayout, ThemeType } from "../core/component/element/type";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* SDK options
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AddressMountComponentsParams } from '../type';
|
|
2
|
-
interface ElementAddressMountOptions extends Omit<AddressMountComponentsParams, 'type'> {
|
|
3
|
-
selector: string;
|
|
4
|
-
}
|
|
5
|
-
export declare class ElementAddressComponent {
|
|
6
|
-
private sdk;
|
|
7
|
-
private elementContainer;
|
|
8
|
-
private isConnect;
|
|
9
|
-
constructor();
|
|
10
|
-
create(options: {
|
|
11
|
-
environment: string;
|
|
12
|
-
locale: string;
|
|
13
|
-
appVersion: string;
|
|
14
|
-
}, isConnect: boolean): void;
|
|
15
|
-
mount(options: ElementAddressMountOptions): Promise<HTMLIFrameElement | undefined>;
|
|
16
|
-
update(): void;
|
|
17
|
-
unmount(): void;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
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); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
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; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
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); }
|
|
8
|
-
import { AddressComponent } from "../../address";
|
|
9
|
-
export var ElementAddressComponent = /*#__PURE__*/function () {
|
|
10
|
-
function ElementAddressComponent() {
|
|
11
|
-
_classCallCheck(this, ElementAddressComponent);
|
|
12
|
-
_defineProperty(this, "sdk", void 0);
|
|
13
|
-
_defineProperty(this, "elementContainer", void 0);
|
|
14
|
-
_defineProperty(this, "isConnect", void 0);
|
|
15
|
-
}
|
|
16
|
-
_createClass(ElementAddressComponent, [{
|
|
17
|
-
key: "create",
|
|
18
|
-
value: function create(options, isConnect) {
|
|
19
|
-
this.isConnect = isConnect;
|
|
20
|
-
this.sdk = new AddressComponent(options);
|
|
21
|
-
}
|
|
22
|
-
}, {
|
|
23
|
-
key: "mount",
|
|
24
|
-
value: function mount(options) {
|
|
25
|
-
var _this = this;
|
|
26
|
-
var elementContainer = document.querySelector(options.selector);
|
|
27
|
-
if (this.isConnect) {
|
|
28
|
-
elementContainer.style.display = 'none';
|
|
29
|
-
}
|
|
30
|
-
return new Promise(function (resolve) {
|
|
31
|
-
_this.sdk.mountComponent({
|
|
32
|
-
sessionData: options.sessionData,
|
|
33
|
-
elementProps: options.elementProps,
|
|
34
|
-
configParams: options.configParams,
|
|
35
|
-
appearance: options.appearance,
|
|
36
|
-
prefillValue: options.prefillValue,
|
|
37
|
-
appendAliasContainerId: true
|
|
38
|
-
}, options.selector).then(function () {
|
|
39
|
-
var _elementContainer$get;
|
|
40
|
-
_this.elementContainer = elementContainer;
|
|
41
|
-
var iframes = elementContainer === null || elementContainer === void 0 || (_elementContainer$get = elementContainer.getElementsByTagName) === null || _elementContainer$get === void 0 ? void 0 : _elementContainer$get.call(elementContainer, 'iframe');
|
|
42
|
-
resolve(iframes === null || iframes === void 0 ? void 0 : iframes[0]);
|
|
43
|
-
}, function () {
|
|
44
|
-
resolve(undefined);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "update",
|
|
50
|
-
value: function update() {
|
|
51
|
-
if (this.elementContainer && this.isConnect) {
|
|
52
|
-
this.elementContainer.style.display = '';
|
|
53
|
-
}
|
|
54
|
-
// 下发数据
|
|
55
|
-
}
|
|
56
|
-
}, {
|
|
57
|
-
key: "unmount",
|
|
58
|
-
value: function unmount() {
|
|
59
|
-
var _this$elementContaine, _this$elementContaine2;
|
|
60
|
-
var containers = (_this$elementContaine = this.elementContainer) === null || _this$elementContaine === void 0 || (_this$elementContaine2 = _this$elementContaine.getElementsByTagName) === null || _this$elementContaine2 === void 0 ? void 0 : _this$elementContaine2.call(_this$elementContaine, 'div');
|
|
61
|
-
if (containers !== null && containers !== void 0 && containers[0]) {
|
|
62
|
-
var _containers$, _containers$$remove;
|
|
63
|
-
(_containers$ = containers[0]) === null || _containers$ === void 0 || (_containers$$remove = _containers$.remove) === null || _containers$$remove === void 0 || _containers$$remove.call(_containers$);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}]);
|
|
67
|
-
return ElementAddressComponent;
|
|
68
|
-
}();
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { LinkAuthMountOptions } from '../type';
|
|
2
|
-
interface ElementAuthMountOptions extends Omit<LinkAuthMountOptions, 'type' | 'elementProps'> {
|
|
3
|
-
selector: string;
|
|
4
|
-
url: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class ElementAuthComponent {
|
|
7
|
-
private elementContainer;
|
|
8
|
-
constructor();
|
|
9
|
-
create(options: {
|
|
10
|
-
environment: string;
|
|
11
|
-
locale: string;
|
|
12
|
-
}): void;
|
|
13
|
-
mount(options: ElementAuthMountOptions): Promise<HTMLIFrameElement | undefined>;
|
|
14
|
-
update(height?: number): void;
|
|
15
|
-
unmount(): void;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
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); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
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; }
|
|
6
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
-
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); }
|
|
8
|
-
import { createIframe } from "../../../../foundation/service/container/utils";
|
|
9
|
-
import { createInlineBaseElement } from "../../../../plugin/component/component.inline.style";
|
|
10
|
-
export var ElementAuthComponent = /*#__PURE__*/function () {
|
|
11
|
-
function ElementAuthComponent() {
|
|
12
|
-
_classCallCheck(this, ElementAuthComponent);
|
|
13
|
-
_defineProperty(this, "elementContainer", void 0);
|
|
14
|
-
}
|
|
15
|
-
_createClass(ElementAuthComponent, [{
|
|
16
|
-
key: "create",
|
|
17
|
-
value: function create(options) {}
|
|
18
|
-
}, {
|
|
19
|
-
key: "mount",
|
|
20
|
-
value: function mount(options) {
|
|
21
|
-
var _this = this;
|
|
22
|
-
return new Promise(function (resolve) {
|
|
23
|
-
try {
|
|
24
|
-
var selector = options.selector,
|
|
25
|
-
url = options.url;
|
|
26
|
-
var containerId = (selector === null || selector === void 0 ? void 0 : selector.indexOf('#')) === -1 ? selector : selector.slice(1);
|
|
27
|
-
var containerSelector = "antom-sdk-web-app-".concat(containerId);
|
|
28
|
-
var container = createInlineBaseElement(selector);
|
|
29
|
-
var webApp = createIframe(containerSelector);
|
|
30
|
-
webApp.src = url;
|
|
31
|
-
container.appendChild(webApp);
|
|
32
|
-
_this.elementContainer = container;
|
|
33
|
-
resolve(webApp);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
resolve(undefined);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}, {
|
|
40
|
-
key: "update",
|
|
41
|
-
value: function update() {
|
|
42
|
-
var _this$elementContaine, _this$elementContaine2;
|
|
43
|
-
var height = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;
|
|
44
|
-
var iframes = (_this$elementContaine = this.elementContainer) === null || _this$elementContaine === void 0 || (_this$elementContaine2 = _this$elementContaine.getElementsByTagName) === null || _this$elementContaine2 === void 0 ? void 0 : _this$elementContaine2.call(_this$elementContaine, 'iframe');
|
|
45
|
-
if (iframes !== null && iframes !== void 0 && iframes[0]) {
|
|
46
|
-
var iframe = iframes[0];
|
|
47
|
-
iframe.style.opacity = '1';
|
|
48
|
-
iframe.style.overflow = 'visible';
|
|
49
|
-
iframe.style.height = "".concat(height, "px");
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
key: "unmount",
|
|
54
|
-
value: function unmount() {
|
|
55
|
-
var _this$elementContaine3, _this$elementContaine4;
|
|
56
|
-
(_this$elementContaine3 = this.elementContainer) === null || _this$elementContaine3 === void 0 || (_this$elementContaine4 = _this$elementContaine3.remove) === null || _this$elementContaine4 === void 0 || _this$elementContaine4.call(_this$elementContaine3);
|
|
57
|
-
}
|
|
58
|
-
}]);
|
|
59
|
-
return ElementAuthComponent;
|
|
60
|
-
}();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { PaymentMountOptions } from '../type';
|
|
2
|
-
interface ElementPaymentMountOptions extends Omit<PaymentMountOptions, 'type'> {
|
|
3
|
-
selector: string;
|
|
4
|
-
}
|
|
5
|
-
export declare class ElementPaymentComponent {
|
|
6
|
-
private sdk;
|
|
7
|
-
private elementContainer;
|
|
8
|
-
private isConnect;
|
|
9
|
-
constructor();
|
|
10
|
-
create(options: {
|
|
11
|
-
environment: string;
|
|
12
|
-
locale: string;
|
|
13
|
-
appVersion: string;
|
|
14
|
-
}, isConnect: boolean): void;
|
|
15
|
-
mount(options: ElementPaymentMountOptions): Promise<HTMLIFrameElement | undefined>;
|
|
16
|
-
update(): void;
|
|
17
|
-
unmount(): void;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
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); } }
|
|
6
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
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
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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 AMSPaymentElement from "../../../../index";
|
|
11
|
-
export var ElementPaymentComponent = /*#__PURE__*/function () {
|
|
12
|
-
function ElementPaymentComponent() {
|
|
13
|
-
_classCallCheck(this, ElementPaymentComponent);
|
|
14
|
-
_defineProperty(this, "sdk", void 0);
|
|
15
|
-
_defineProperty(this, "elementContainer", void 0);
|
|
16
|
-
_defineProperty(this, "isConnect", void 0);
|
|
17
|
-
}
|
|
18
|
-
_createClass(ElementPaymentComponent, [{
|
|
19
|
-
key: "create",
|
|
20
|
-
value: function create(options, isConnect) {
|
|
21
|
-
this.isConnect = isConnect;
|
|
22
|
-
this.sdk = new AMSPaymentElement(_objectSpread(_objectSpread({}, options), {}, {
|
|
23
|
-
analytics: {
|
|
24
|
-
enabled: true
|
|
25
|
-
},
|
|
26
|
-
onEventCallback: function onEventCallback(state) {}
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
key: "mount",
|
|
31
|
-
value: function mount(options) {
|
|
32
|
-
var _this = this;
|
|
33
|
-
var elementContainer = document.querySelector(options.selector);
|
|
34
|
-
if (this.isConnect) {
|
|
35
|
-
elementContainer.style.display = 'none';
|
|
36
|
-
}
|
|
37
|
-
return new Promise(function (resolve) {
|
|
38
|
-
_this.sdk.mountComponent({
|
|
39
|
-
sessionData: options.sessionData,
|
|
40
|
-
appearance: options.appearance,
|
|
41
|
-
elementProps: options.elementProps,
|
|
42
|
-
notRedirectAfterComplete: true,
|
|
43
|
-
appendAliasContainerId: true
|
|
44
|
-
}, options.selector).then(function () {
|
|
45
|
-
var _elementContainer$get;
|
|
46
|
-
_this.elementContainer = elementContainer;
|
|
47
|
-
var iframes = elementContainer === null || elementContainer === void 0 || (_elementContainer$get = elementContainer.getElementsByTagName) === null || _elementContainer$get === void 0 ? void 0 : _elementContainer$get.call(elementContainer, 'iframe');
|
|
48
|
-
resolve(iframes === null || iframes === void 0 ? void 0 : iframes[0]);
|
|
49
|
-
}, function () {
|
|
50
|
-
resolve(undefined);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}, {
|
|
55
|
-
key: "update",
|
|
56
|
-
value: function update() {
|
|
57
|
-
if (this.elementContainer && this.isConnect) {
|
|
58
|
-
this.elementContainer.style.display = 'initial';
|
|
59
|
-
}
|
|
60
|
-
// 下发数据
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
key: "unmount",
|
|
64
|
-
value: function unmount() {
|
|
65
|
-
var _this$elementContaine, _this$elementContaine2;
|
|
66
|
-
var containers = (_this$elementContaine = this.elementContainer) === null || _this$elementContaine === void 0 || (_this$elementContaine2 = _this$elementContaine.getElementsByTagName) === null || _this$elementContaine2 === void 0 ? void 0 : _this$elementContaine2.call(_this$elementContaine, 'div');
|
|
67
|
-
if (containers !== null && containers !== void 0 && containers[0]) {
|
|
68
|
-
var _containers$, _containers$$remove;
|
|
69
|
-
(_containers$ = containers[0]) === null || _containers$ === void 0 || (_containers$$remove = _containers$.remove) === null || _containers$$remove === void 0 || _containers$$remove.call(_containers$);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}]);
|
|
73
|
-
return ElementPaymentComponent;
|
|
74
|
-
}();
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { IPaymentSessionMetaData } from '../../../types';
|
|
2
|
-
import type { AddressMountOptions, AddressMountResult, IElementOptions, LinkAuthMountOptions, LinkAuthMountResult, PaymentMountOptions, PaymentMountResult } from './type';
|
|
3
|
-
export interface IElementProcessorOptions {
|
|
4
|
-
paymentSessionConfig: IPaymentSessionMetaData['paymentSessionConfig'];
|
|
5
|
-
sessionData: string;
|
|
6
|
-
environment: string;
|
|
7
|
-
locale: string;
|
|
8
|
-
isConnect: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare class ElementComponent {
|
|
11
|
-
private parseData;
|
|
12
|
-
private loading;
|
|
13
|
-
private sessionData;
|
|
14
|
-
private elementContainer;
|
|
15
|
-
private authBase;
|
|
16
|
-
private addressBase;
|
|
17
|
-
private paymentBase;
|
|
18
|
-
private _options;
|
|
19
|
-
private eventService;
|
|
20
|
-
private sdkActionRes;
|
|
21
|
-
private oneAccountRes;
|
|
22
|
-
private launchSource;
|
|
23
|
-
private initCompleted;
|
|
24
|
-
private isConnect;
|
|
25
|
-
private iframeSrc;
|
|
26
|
-
private mountOptions;
|
|
27
|
-
private iframes;
|
|
28
|
-
private loadingElement;
|
|
29
|
-
private componentsCount;
|
|
30
|
-
private eventCallback;
|
|
31
|
-
private ApplePayService;
|
|
32
|
-
constructor(options: IElementOptions);
|
|
33
|
-
private createElement;
|
|
34
|
-
private beforeMount;
|
|
35
|
-
private createComponentSdk;
|
|
36
|
-
private createIframeSrc;
|
|
37
|
-
private closeLoading;
|
|
38
|
-
private addListener;
|
|
39
|
-
private launchFunc;
|
|
40
|
-
private showIframe;
|
|
41
|
-
private afterInit;
|
|
42
|
-
private sendRenderData;
|
|
43
|
-
private removeListener;
|
|
44
|
-
private registerEventListener;
|
|
45
|
-
private mountAuth;
|
|
46
|
-
private mountAddress;
|
|
47
|
-
private mountPayment;
|
|
48
|
-
private initApplePaySdk;
|
|
49
|
-
mountErrorHandle(): void;
|
|
50
|
-
mount(renderOptions: AddressMountOptions, sdkSelector: string): AddressMountResult;
|
|
51
|
-
mount(renderOptions: PaymentMountOptions, sdkSelector: string): PaymentMountResult;
|
|
52
|
-
mount(renderOptions: LinkAuthMountOptions, sdkSelector: string): LinkAuthMountResult;
|
|
53
|
-
private resetState;
|
|
54
|
-
unmount(): void;
|
|
55
|
-
private onAfterSubmitFunc;
|
|
56
|
-
private onValidateFunc;
|
|
57
|
-
private validatePromiseFuncs;
|
|
58
|
-
submitPayment(): Promise<void>;
|
|
59
|
-
}
|