@alipay/ams-checkout 0.0.1743078169-dev.6 → 0.0.1744265398-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/component/component.inline.style.js +1 -1
- package/esm/component/popupWindow.style.js +1 -4
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +0 -3
- package/esm/constant/index.js +0 -3
- package/esm/core/component/element/index.d.ts +46 -8
- package/esm/core/component/element/index.js +922 -28
- package/esm/core/component/element/type.d.ts +1 -29
- package/esm/core/component/index.d.ts +1 -5
- package/esm/core/component/index.js +2 -1
- package/esm/foundation/core/index.d.ts +1 -6
- package/esm/foundation/core/index.js +34 -68
- package/esm/foundation/index.d.ts +0 -7
- package/esm/foundation/index.js +2 -10
- package/esm/foundation/service/container/index.d.ts +3 -6
- package/esm/foundation/service/container/index.js +14 -34
- package/esm/foundation/service/container/popup.d.ts +1 -1
- package/esm/foundation/service/event-center.js +0 -1
- package/esm/index.js +0 -1
- package/esm/plugin/component/cashierApp.d.ts +1 -1
- package/esm/plugin/component/index.js +1 -1
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.js +1 -1
- package/package.json +1 -1
- package/esm/core/component/element/elementContainerService/containerService.d.ts +0 -30
- package/esm/core/component/element/elementContainerService/containerService.js +0 -107
- package/esm/core/component/element/elementContainerService/index.d.ts +0 -19
- package/esm/core/component/element/elementContainerService/index.js +0 -55
- package/esm/core/component/element/elementController/index.d.ts +0 -22
- package/esm/core/component/element/elementController/index.js +0 -370
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +0 -17
- package/esm/core/component/element/elementProcessor/addressProcessor.js +0 -122
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +0 -14
- package/esm/core/component/element/elementProcessor/authProcessor.js +0 -70
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +0 -36
- package/esm/core/component/element/elementProcessor/baseElementProcessor.js +0 -79
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +0 -299
- package/esm/core/component/element/util.d.ts +0 -59
- package/esm/core/component/element/util.js +0 -327
- package/esm/core/component/oldElement/index.d.ts +0 -59
- package/esm/core/component/oldElement/index.js +0 -956
- package/esm/core/component/oldElement/type.d.ts +0 -351
- package/esm/core/component/oldElement/type.js +0 -81
- package/esm/foundation/product-processor/element/index.d.ts +0 -7
- package/esm/foundation/product-processor/element/index.js +0 -24
- /package/esm/core/component/{oldElement → element}/components/address.d.ts +0 -0
- /package/esm/core/component/{oldElement → element}/components/address.js +0 -0
- /package/esm/core/component/{oldElement → element}/components/auth.d.ts +0 -0
- /package/esm/core/component/{oldElement → element}/components/auth.js +0 -0
- /package/esm/core/component/{oldElement → element}/components/payment.d.ts +0 -0
- /package/esm/core/component/{oldElement → element}/components/payment.js +0 -0
- /package/esm/core/component/{oldElement → element}/mock.d.ts +0 -0
- /package/esm/core/component/{oldElement → element}/mock.js +0 -0
- /package/esm/core/component/{oldElement → element}/utils.d.ts +0 -0
- /package/esm/core/component/{oldElement → element}/utils.js +0 -0
@@ -1,7 +1,4 @@
|
|
1
|
-
import { ActionForm, ConnectErrorCode, IAmount, IAmountView,
|
2
|
-
import AddressProcessor from './elementProcessor/addressProcessor';
|
3
|
-
import AuthProcessor from './elementProcessor/authProcessor';
|
4
|
-
import PaymentProcessor from './elementProcessor/paymentProcessor';
|
1
|
+
import { ActionForm, ConnectErrorCode, IAmount, IAmountView, IPaymentMethod } from '../../../types';
|
5
2
|
export declare enum ElementPaymentEvent {
|
6
3
|
RENDER_COMPONENT = "renderComponent",
|
7
4
|
CAPTURE_ASSET = "onCaptureAsset",
|
@@ -163,8 +160,6 @@ export interface PaymentMountOptions extends BaseMountOptions {
|
|
163
160
|
'radius-button': string;
|
164
161
|
};
|
165
162
|
};
|
166
|
-
notRedirectAfterComplete?: boolean;
|
167
|
-
merchantAppointParam?: IMerchantAppointParam;
|
168
163
|
}
|
169
164
|
export declare enum AddressEventCallbackName {
|
170
165
|
SHIPPING_CHANGE = "SHIPPING_CHANGE"
|
@@ -352,27 +347,4 @@ export interface AccountQueryResult {
|
|
352
347
|
errorStatus?: string;
|
353
348
|
shippingInfo?: CKPShipping;
|
354
349
|
}
|
355
|
-
export interface IElementOptions {
|
356
|
-
sessionData: string;
|
357
|
-
environment?: ELEMENT_ENVIRONMENT_TYPE;
|
358
|
-
locale?: string;
|
359
|
-
version?: string;
|
360
|
-
appearance?: {
|
361
|
-
theme: ThemeType.Default | ThemeType.Night;
|
362
|
-
};
|
363
|
-
onEventCallback?: ({ code, message, result }: {
|
364
|
-
code: EventCallbackCode;
|
365
|
-
message: string;
|
366
|
-
result?: any;
|
367
|
-
}) => void;
|
368
|
-
loading?: {
|
369
|
-
onStartLoading: () => void;
|
370
|
-
onEndLoading: () => void;
|
371
|
-
};
|
372
|
-
}
|
373
|
-
export interface IElementProcessors {
|
374
|
-
[ElementType.auth]: AuthProcessor;
|
375
|
-
[ElementType.address]: AddressProcessor;
|
376
|
-
[ElementType.payment]: PaymentProcessor;
|
377
|
-
}
|
378
350
|
export {};
|
@@ -1,12 +1,8 @@
|
|
1
1
|
import ComponentApp from '../../plugin/component';
|
2
|
-
import { ComponentSignEnum,
|
2
|
+
import { ComponentSignEnum, IcreateComponent, IoptionsParams, IPaymentSessionMetaData, Iselector, Isubmit, PaymentMethodTypeEnum, SubPaymentMethodTypeEnum } from '../../types';
|
3
3
|
import CoreInstance from '../instance/index';
|
4
4
|
export declare const getComponentSign: (params: IPaymentSessionMetaData) => ComponentSignEnum;
|
5
5
|
export declare const parseSessionData: (sessionData: string) => [IPaymentSessionMetaData, string];
|
6
|
-
export declare const handleParams: (params: IcreateComponent, _this: any) => Promise<{
|
7
|
-
iframeNodesParams: IappendIframeNodesParams;
|
8
|
-
componentSign: ComponentSignEnum.EASY_PAY_WALLET | ComponentSignEnum.EASY_PAY_APM | ComponentSignEnum.CASHIER_PAYMENT_CARD | ComponentSignEnum.CASHIER_PAYMENT_BANK | ComponentSignEnum.CASHIER_PAYMENT_APM | ComponentSignEnum.AUTO_DEBIT_WALLET | ComponentSignEnum.AUTO_DEBIT_PAY_WALLET | ComponentSignEnum.VAULTING_CARD | ComponentSignEnum.CHECKOUT_PAYMENT | ComponentSignEnum.ELEMENT_PAYMENT | ComponentSignEnum.ELEMENT_ADDRESS;
|
9
|
-
}>;
|
10
6
|
export type IAMSComponentOptions = IoptionsParams & {
|
11
7
|
appVersion: string;
|
12
8
|
};
|
@@ -70,6 +70,7 @@ export var parseSessionData = function parseSessionData(sessionData) {
|
|
70
70
|
return [{}, sessionData];
|
71
71
|
}
|
72
72
|
};
|
73
|
+
|
73
74
|
// pc easy-pay execute 1.0 Process
|
74
75
|
var resetEasyPaySceneVersion = function resetEasyPaySceneVersion(parseData) {
|
75
76
|
if (isPC() && parseData !== null && parseData !== void 0 && parseData.paymentSessionConfig) {
|
@@ -91,7 +92,7 @@ var handleSessionData = function handleSessionData(originSessionData) {
|
|
91
92
|
resetEasyPaySceneVersion(parseData);
|
92
93
|
return [parseData !== null && parseData !== void 0 ? parseData : {}, sessionData];
|
93
94
|
};
|
94
|
-
|
95
|
+
var handleParams = function handleParams(params, _this) {
|
95
96
|
var _params = Object.assign({
|
96
97
|
paymentSessionMetaData: {},
|
97
98
|
renderDisplayType: DisplayTypeEnum.popup
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IoptionsParams, ProductSceneEnum } from '../../types';
|
2
|
-
import { BizFlowStartBehavior,
|
2
|
+
import { BizFlowStartBehavior, PaymentContext, ProductProcessor, StartBizFlowOptions } from '../index';
|
3
3
|
import { ServiceProvider } from '../service';
|
4
4
|
/**
|
5
5
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
@@ -13,11 +13,7 @@ export declare class AntomSDKCore {
|
|
13
13
|
private sdkMetaData;
|
14
14
|
private productProcessors;
|
15
15
|
private enablePopWindowEventCallback;
|
16
|
-
private status;
|
17
16
|
constructor();
|
18
|
-
getStatus(): IElementStatus;
|
19
|
-
setStatus(status: any): void;
|
20
|
-
updatePaymentSessionData(paymentSession: string): void;
|
21
17
|
registerProcessor(productScene: string, paymentMethod: string, processor: ProductProcessor): void;
|
22
18
|
init(options: IoptionsParams, productScene: ProductSceneEnum): void;
|
23
19
|
private prepare;
|
@@ -29,5 +25,4 @@ export declare class AntomSDKCore {
|
|
29
25
|
private handleBehaviorRender;
|
30
26
|
private handleClose;
|
31
27
|
private cleanRender;
|
32
|
-
getInstanceId(): string;
|
33
28
|
}
|
@@ -1,28 +1,27 @@
|
|
1
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; }
|
2
4
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
3
5
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
4
6
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
5
|
-
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; }
|
6
|
-
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; }
|
7
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
8
8
|
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); } }
|
9
9
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
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 { v4 as uuid } from 'uuid';
|
14
|
-
import { cleanMockup, createMockup, createRetentionPopup, handleDeclareInfo, hideMockup, hideRetentionPopup, removeRetentionPopup, showRetentionPopup } from "../../component/component.popup.style";
|
15
|
-
import { insertStyleSheet } from "../../component/popupWindow.style";
|
16
|
-
import { sdkVersion } from "../../config";
|
17
|
-
import { COMPONENT_CLOSE_MASK_BLOCK_ID, EVENT, LOADING_ID } from "../../constant";
|
18
13
|
import { DisplayTypeEnum, eventCodeEnum } from "../../types";
|
19
|
-
import { DisplayInfo
|
14
|
+
import { DisplayInfo } from "../index";
|
15
|
+
import { v4 as uuid } from 'uuid';
|
20
16
|
import { ServiceProvider } from "../service";
|
21
|
-
import { getGrayscaleId } from "../utils/gray_scale_utils";
|
22
17
|
import { convertPaymentSession, getWebAppVersion, saveWebAppVersion } from "../utils/payment_context_utils";
|
23
|
-
import {
|
18
|
+
import { getGrayscaleId } from "../utils/gray_scale_utils";
|
19
|
+
import { sdkVersion } from "../../config";
|
24
20
|
import { parseWebAppMatchConfig } from "../utils/web_app_url_utils";
|
25
|
-
|
21
|
+
import { redirect } from "../utils/redirect_utils";
|
22
|
+
import { insertStyleSheet } from "../../component/popupWindow.style";
|
23
|
+
import { hideMockup, createMockup, createRetentionPopup, hideRetentionPopup, showRetentionPopup, cleanMockup, removeRetentionPopup, handleDeclareInfo } from "../../component/component.popup.style";
|
24
|
+
import { COMPONENT_CLOSE_MASK_BLOCK_ID, EVENT, LOADING_ID } from "../../constant";
|
26
25
|
/**
|
27
26
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
28
27
|
* @date 2024/9/17
|
@@ -37,34 +36,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
37
36
|
_defineProperty(this, "sdkMetaData", void 0);
|
38
37
|
_defineProperty(this, "productProcessors", {});
|
39
38
|
_defineProperty(this, "enablePopWindowEventCallback", false);
|
40
|
-
_defineProperty(this, "status", IElementStatus.UNINIT);
|
41
|
-
this.status = IElementStatus.INITING;
|
42
39
|
}
|
43
40
|
_createClass(AntomSDKCore, [{
|
44
|
-
key: "getStatus",
|
45
|
-
value: function getStatus() {
|
46
|
-
return this.status;
|
47
|
-
}
|
48
|
-
}, {
|
49
|
-
key: "setStatus",
|
50
|
-
value: function setStatus(status) {
|
51
|
-
if (status === this.getStatus()) return;
|
52
|
-
console.log("[test] status has changed from ".concat(this.getStatus(), " to ").concat(status));
|
53
|
-
this.status = status;
|
54
|
-
}
|
55
|
-
}, {
|
56
|
-
key: "updatePaymentSessionData",
|
57
|
-
value: function updatePaymentSessionData(paymentSession) {
|
58
|
-
var _convertPaymentSessio = convertPaymentSession(paymentSession),
|
59
|
-
paymentSessionId = _convertPaymentSessio.id,
|
60
|
-
paymentSessionMetaData = _convertPaymentSessio.data;
|
61
|
-
this.paymentContext = _objectSpread(_objectSpread({}, this.paymentContext), {}, {
|
62
|
-
paymentSession: paymentSession,
|
63
|
-
paymentSessionId: paymentSessionId,
|
64
|
-
paymentSessionObj: paymentSessionMetaData
|
65
|
-
});
|
66
|
-
}
|
67
|
-
}, {
|
68
41
|
key: "registerProcessor",
|
69
42
|
value: function registerProcessor(productScene) {
|
70
43
|
var paymentMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
@@ -179,7 +152,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
179
152
|
};
|
180
153
|
}());
|
181
154
|
eventCenter.listen(EVENT.destroy.name, function (data) {
|
182
|
-
_this.setStatus(IElementStatus.READY);
|
183
155
|
_this.destroy();
|
184
156
|
});
|
185
157
|
eventCenter.listen(EVENT.closeCallback.name, function () {
|
@@ -210,7 +182,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
210
182
|
value: function () {
|
211
183
|
var _startBizFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(options) {
|
212
184
|
var _this$paymentContext$, _this$paymentContext$2, _this$paymentContext$3;
|
213
|
-
var paymentSession, displayInfo,
|
185
|
+
var paymentSession, displayInfo, _convertPaymentSessio, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload;
|
214
186
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
215
187
|
while (1) switch (_context3.prev = _context3.next) {
|
216
188
|
case 0:
|
@@ -220,9 +192,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
220
192
|
}
|
221
193
|
throw new Error('paymentSession is empty');
|
222
194
|
case 2:
|
223
|
-
this.setStatus(IElementStatus.IN_BIZ_FLOW);
|
224
195
|
paymentSession = options.paymentSession, displayInfo = options.displayInfo;
|
225
|
-
|
196
|
+
_convertPaymentSessio = convertPaymentSession(paymentSession), paymentSessionId = _convertPaymentSessio.id, paymentSessionMetaData = _convertPaymentSessio.data;
|
226
197
|
this.paymentContext = {
|
227
198
|
initOptions: this.initOptions,
|
228
199
|
startBizFlowOptions: options,
|
@@ -245,59 +216,59 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
245
216
|
// Invoke processor
|
246
217
|
productScene = (_this$paymentContext$2 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$2 === void 0 || (_this$paymentContext$2 = _this$paymentContext$2.paymentSessionConfig) === null || _this$paymentContext$2 === void 0 ? void 0 : _this$paymentContext$2.productScene;
|
247
218
|
paymentMethod = (_this$paymentContext$3 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$3 === void 0 || (_this$paymentContext$3 = _this$paymentContext$3.paymentMethodInfoView) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.paymentMethodType;
|
248
|
-
_context3.prev =
|
219
|
+
_context3.prev = 13;
|
249
220
|
if (!this.productProcessors["".concat(productScene, "|").concat(paymentMethod)]) {
|
250
|
-
_context3.next =
|
221
|
+
_context3.next = 20;
|
251
222
|
break;
|
252
223
|
}
|
253
|
-
_context3.next =
|
224
|
+
_context3.next = 17;
|
254
225
|
return this.productProcessors["".concat(productScene, "|").concat(paymentMethod)].startBizFlow(this.paymentContext);
|
255
|
-
case
|
226
|
+
case 17:
|
256
227
|
this.bizFlowStartBehavior = _context3.sent;
|
257
|
-
_context3.next =
|
228
|
+
_context3.next = 24;
|
258
229
|
break;
|
259
|
-
case
|
230
|
+
case 20:
|
260
231
|
if (!this.productProcessors["".concat(productScene)]) {
|
261
|
-
_context3.next =
|
232
|
+
_context3.next = 24;
|
262
233
|
break;
|
263
234
|
}
|
264
|
-
_context3.next =
|
235
|
+
_context3.next = 23;
|
265
236
|
return this.productProcessors["".concat(productScene)].startBizFlow(this.paymentContext);
|
266
|
-
case
|
237
|
+
case 23:
|
267
238
|
this.bizFlowStartBehavior = _context3.sent;
|
268
|
-
case
|
269
|
-
_context3.next =
|
239
|
+
case 24:
|
240
|
+
_context3.next = 29;
|
270
241
|
break;
|
271
|
-
case
|
272
|
-
_context3.prev =
|
273
|
-
_context3.t0 = _context3["catch"](
|
242
|
+
case 26:
|
243
|
+
_context3.prev = 26;
|
244
|
+
_context3.t0 = _context3["catch"](13);
|
274
245
|
console.error('Invoke processor failed', _context3.t0);
|
275
|
-
case
|
246
|
+
case 29:
|
276
247
|
if (!(!this.bizFlowStartBehavior || this.bizFlowStartBehavior.behaviorType === 'NONE' || !this.bizFlowStartBehavior.payload)) {
|
277
|
-
_context3.next =
|
248
|
+
_context3.next = 31;
|
278
249
|
break;
|
279
250
|
}
|
280
251
|
return _context3.abrupt("return");
|
281
|
-
case
|
252
|
+
case 31:
|
282
253
|
if (!(this.bizFlowStartBehavior.behaviorType === 'RENDER')) {
|
283
|
-
_context3.next =
|
254
|
+
_context3.next = 34;
|
284
255
|
break;
|
285
256
|
}
|
286
257
|
this.handleBehaviorRender();
|
287
258
|
return _context3.abrupt("return");
|
288
|
-
case
|
259
|
+
case 34:
|
289
260
|
if (!(this.bizFlowStartBehavior.behaviorType === 'REDIRECT')) {
|
290
|
-
_context3.next =
|
261
|
+
_context3.next = 38;
|
291
262
|
break;
|
292
263
|
}
|
293
264
|
payload = (_this$bizFlowStartBeh = this.bizFlowStartBehavior) === null || _this$bizFlowStartBeh === void 0 ? void 0 : _this$bizFlowStartBeh.payload;
|
294
265
|
redirect(payload, this.instanceId);
|
295
266
|
return _context3.abrupt("return");
|
296
|
-
case
|
267
|
+
case 38:
|
297
268
|
case "end":
|
298
269
|
return _context3.stop();
|
299
270
|
}
|
300
|
-
}, _callee3, this, [[
|
271
|
+
}, _callee3, this, [[13, 26]]);
|
301
272
|
}));
|
302
273
|
function startBizFlow(_x5) {
|
303
274
|
return _startBizFlow.apply(this, arguments);
|
@@ -423,11 +394,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
423
394
|
cleanElement();
|
424
395
|
}, 300);
|
425
396
|
}
|
426
|
-
}, {
|
427
|
-
key: "getInstanceId",
|
428
|
-
value: function getInstanceId() {
|
429
|
-
return this.instanceId;
|
430
|
-
}
|
431
397
|
}]);
|
432
398
|
return AntomSDKCore;
|
433
399
|
}();
|
@@ -73,10 +73,3 @@ export interface InitContext {
|
|
73
73
|
initOptions: IoptionsParams;
|
74
74
|
sdkMetaData: SDKMetaData;
|
75
75
|
}
|
76
|
-
export declare enum IElementStatus {
|
77
|
-
UNINIT = "UNINIT",
|
78
|
-
INITING = "INITING",
|
79
|
-
READY = "READY",
|
80
|
-
IN_BIZ_FLOW = "IN_BIZ_FLOW",
|
81
|
-
DESTROYED = "DESTROYED"
|
82
|
-
}
|
package/esm/foundation/index.js
CHANGED
@@ -7,6 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
7
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
8
|
import { DisplayTypeEnum, PlatformEnum } from "../types";
|
9
9
|
import { isPC } from "../util";
|
10
|
+
|
10
11
|
/**
|
11
12
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
12
13
|
* @date 2024/9/17
|
@@ -38,13 +39,4 @@ export var DisplayInfo = /*#__PURE__*/_createClass(function DisplayInfo() {
|
|
38
39
|
|
39
40
|
/**
|
40
41
|
* Provide some capability, such as MonitorService, EventBusService, SecurityService
|
41
|
-
*/
|
42
|
-
|
43
|
-
export var IElementStatus = /*#__PURE__*/function (IElementStatus) {
|
44
|
-
IElementStatus["UNINIT"] = "UNINIT";
|
45
|
-
IElementStatus["INITING"] = "INITING";
|
46
|
-
IElementStatus["READY"] = "READY";
|
47
|
-
IElementStatus["IN_BIZ_FLOW"] = "IN_BIZ_FLOW";
|
48
|
-
IElementStatus["DESTROYED"] = "DESTROYED";
|
49
|
-
return IElementStatus;
|
50
|
-
}({});
|
42
|
+
*/
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import { IoptionsParams } from '../../../types';
|
2
1
|
import { DisplayInfo, SDKMetaData, Service } from '../../index';
|
3
|
-
import {
|
2
|
+
import { IoptionsParams } from '../../../types';
|
4
3
|
export declare class ContainerService implements Service {
|
5
4
|
private instanceId;
|
6
5
|
private sdkMetaData;
|
7
|
-
private initMessageEvent;
|
8
6
|
private clearTimerIdMapping;
|
9
|
-
popupManager
|
7
|
+
private popupManager;
|
10
8
|
private eventCenter;
|
11
9
|
private logService;
|
12
10
|
private displayInfo;
|
@@ -16,7 +14,7 @@ export declare class ContainerService implements Service {
|
|
16
14
|
destroy(): void;
|
17
15
|
init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
|
18
16
|
update(): void;
|
19
|
-
load(displayInfo: DisplayInfo, url: string, closeBtnFunc
|
17
|
+
load(displayInfo: DisplayInfo, url: string, closeBtnFunc: () => void): HTMLDivElement;
|
20
18
|
cleanContainer(displayInfo: DisplayInfo): void;
|
21
19
|
showLoading(container: HTMLDivElement, displayInfo: DisplayInfo): void;
|
22
20
|
dismissLoading(isKeepMockup?: boolean): void;
|
@@ -29,5 +27,4 @@ export declare class ContainerService implements Service {
|
|
29
27
|
private handleAppHeartBeat;
|
30
28
|
private changeCloseBtnVisibility;
|
31
29
|
private handleMaskCloseBtnShow;
|
32
|
-
getWebApp(): HTMLIFrameElement;
|
33
30
|
}
|
@@ -7,15 +7,14 @@ 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 { DisplayTypeEnum } from "../../../types";
|
11
|
+
import { createIframe, startSizeChangeAnim } from "./utils";
|
10
12
|
import { addInlineLoading, createInlineBaseElement } from "../../../component/component.inline.style";
|
11
13
|
import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
|
12
|
-
import {
|
13
|
-
import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, EVENT, LOADING_ID, MOCKUP_ID, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../../constant";
|
14
|
-
import { DisplayTypeEnum } from "../../../types";
|
14
|
+
import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, LOADING_ID, MOCKUP_ID } from "../../../constant";
|
15
15
|
import { ServiceProvider } from "../index";
|
16
|
+
import { EVENT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../../constant";
|
16
17
|
import { PopupManager } from "./popup";
|
17
|
-
import { createIframe, startSizeChangeAnim } from "./utils";
|
18
|
-
|
19
18
|
/**
|
20
19
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
21
20
|
* @date 2024/9/17
|
@@ -26,7 +25,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
26
25
|
_classCallCheck(this, ContainerService);
|
27
26
|
_defineProperty(this, "instanceId", void 0);
|
28
27
|
_defineProperty(this, "sdkMetaData", void 0);
|
29
|
-
_defineProperty(this, "initMessageEvent", void 0);
|
30
28
|
_defineProperty(this, "clearTimerIdMapping", {});
|
31
29
|
_defineProperty(this, "popupManager", void 0);
|
32
30
|
_defineProperty(this, "eventCenter", void 0);
|
@@ -48,9 +46,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
48
46
|
this.eventCenter = ServiceProvider.getInstance(instanceId).getService('EventCenter');
|
49
47
|
this.logService = ServiceProvider.getInstance(instanceId).getService('Log');
|
50
48
|
this.popupManager = new PopupManager();
|
51
|
-
|
52
|
-
this.addCapabilityToEventCenter();
|
53
|
-
}
|
49
|
+
this.addCapabilityToEventCenter();
|
54
50
|
this.addCapabilityToApiBusManager();
|
55
51
|
}
|
56
52
|
}, {
|
@@ -59,11 +55,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
59
55
|
}, {
|
60
56
|
key: "load",
|
61
57
|
value: function load(displayInfo, url, closeBtnFunc) {
|
62
|
-
var
|
63
|
-
selector = displayInfo.selector,
|
64
|
-
type = displayInfo.type,
|
65
|
-
platform = displayInfo.platform;
|
66
|
-
var webApp = createIframe('antom-sdk-web-app' + (displayInfo.appendAliasContainerId ? "-".concat(selector) : ''));
|
58
|
+
var webApp = createIframe('antom-sdk-web-app' + (displayInfo.appendAliasContainerId ? "-".concat(displayInfo.selector) : ''));
|
67
59
|
this.webApp = webApp;
|
68
60
|
this.displayInfo = displayInfo;
|
69
61
|
webApp.src = url;
|
@@ -74,7 +66,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
74
66
|
// TODO call ApiBusManager to add listener to iframe, componentApp line 979
|
75
67
|
|
76
68
|
// create container and append web app
|
77
|
-
var container = type === DisplayTypeEnum.inline ? createInlineBaseElement(
|
69
|
+
var container = displayInfo.type === DisplayTypeEnum.inline ? createInlineBaseElement(displayInfo.selector) : createBaseElement(displayInfo.platform, closeBtnFunc);
|
78
70
|
container.appendChild(webApp);
|
79
71
|
return container;
|
80
72
|
}
|
@@ -165,13 +157,10 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
165
157
|
});
|
166
158
|
this.eventCenter.listen(EVENT.popupWindow.name, function (data) {
|
167
159
|
var _this$displayInfo2;
|
168
|
-
|
169
|
-
insertStyleSheet();
|
160
|
+
if (data.paymentElementOldModel) return;
|
170
161
|
_this.popupManager.popup(_objectSpread({
|
171
162
|
platform: (_this$displayInfo2 = _this.displayInfo) === null || _this$displayInfo2 === void 0 ? void 0 : _this$displayInfo2.platform
|
172
|
-
}, data)).
|
173
|
-
_this.eventCenter.addIFrame(_this.popupManager.popupApp);
|
174
|
-
}).catch(function (error) {
|
163
|
+
}, data)).catch(function (error) {
|
175
164
|
_this.logService.logError({
|
176
165
|
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
177
166
|
}, error);
|
@@ -218,26 +207,22 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
218
207
|
}, {
|
219
208
|
key: "handleSizeChanged",
|
220
209
|
value: function handleSizeChanged(data) {
|
221
|
-
var _this$displayInfo3 = this.displayInfo,
|
222
|
-
appendAliasContainerId = _this$displayInfo3.appendAliasContainerId,
|
223
|
-
selector = _this$displayInfo3.selector;
|
224
|
-
var cashierId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat((selector === null || selector === void 0 ? void 0 : selector.indexOf('#')) === -1 ? selector : selector.slice(1)) : COMPONENT_CONTAINER_ID;
|
225
210
|
if (!this.webApp || !this.displayInfo) {
|
226
211
|
return;
|
227
212
|
}
|
228
|
-
var cashier = document.getElementById(
|
229
|
-
if (
|
213
|
+
var cashier = document.getElementById(COMPONENT_CONTAINER_ID);
|
214
|
+
if ((data === null || data === void 0 ? void 0 : data.height) <= 1 || data.height === parseInt(cashier.style.height)) return;
|
230
215
|
cashier.style.height = "".concat(data.height, "px");
|
231
216
|
this.webApp.style.opacity = '1';
|
232
217
|
if (this.displayInfo.type === DisplayTypeEnum.popup) {
|
233
218
|
if (this.displayInfo.platform === 'desktop') {
|
234
219
|
if (data.width) cashier.style.width = "".concat(data.width, "px");
|
235
|
-
cashier.classList.add("".concat(
|
220
|
+
cashier.classList.add("".concat(COMPONENT_CONTAINER_ID, "-").concat(this.displayInfo.platform, "-animation"));
|
236
221
|
this.webApp.style.height = "".concat(data.height, "px");
|
237
222
|
}
|
238
223
|
if (this.displayInfo.platform === 'mobile') {
|
239
|
-
cashier.classList.add("".concat(
|
240
|
-
var animationStyleId = "".concat(
|
224
|
+
cashier.classList.add("".concat(COMPONENT_CONTAINER_ID, "-").concat(this.displayInfo.platform, "-animation"));
|
225
|
+
var animationStyleId = "".concat(COMPONENT_CONTAINER_ID, "-").concat(this.displayInfo.platform, "-animation-style");
|
241
226
|
var animationStyle = document.getElementById(animationStyleId);
|
242
227
|
if (animationStyle) animationStyle === null || animationStyle === void 0 || animationStyle.remove();
|
243
228
|
|
@@ -313,11 +298,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
313
298
|
closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
|
314
299
|
}
|
315
300
|
}
|
316
|
-
}, {
|
317
|
-
key: "getWebApp",
|
318
|
-
value: function getWebApp() {
|
319
|
-
return this.webApp;
|
320
|
-
}
|
321
301
|
}]);
|
322
302
|
return ContainerService;
|
323
303
|
}();
|
@@ -109,7 +109,6 @@ export var EventCenter = /*#__PURE__*/function () {
|
|
109
109
|
var isJson = isJsonString(e.data);
|
110
110
|
if (isJson) {
|
111
111
|
var _eventPayload = JSON.parse(e.data);
|
112
|
-
if (_eventPayload.context.event && _eventPayload.context.event !== 'onLog') {}
|
113
112
|
if (!this.checkEventCompliant(_eventPayload)) {
|
114
113
|
return;
|
115
114
|
}
|
package/esm/index.js
CHANGED
@@ -27,7 +27,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
27
27
|
import { ADDRESSElementAppVersion, AMSAutoDebitAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
|
28
28
|
import { AddressComponent } from "./core/component/address";
|
29
29
|
import { ElementComponent } from "./core/component/element";
|
30
|
-
// import { ElementComponent } from './core/component/oldElement';
|
31
30
|
import { AMSComponent } from "./core/component/index";
|
32
31
|
import { ComponentSignEnum, DisplayTypeEnum, PaymentMethodCategoryTypeEnum } from "./types";
|
33
32
|
import { ProductSceneEnum } from "./types/index";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ComponentSignEnum,
|
1
|
+
import { ComponentSignEnum, Ianalytics, DisplayTypeEnum } from '../../types';
|
2
2
|
export declare const getAppPath: (environment: string, appVersion: string, componentSign: ComponentSignEnum, productScene: string, productSceneVersion: string, extendInfo: string, mid: string, sendLog?: boolean, elementLink?: string) => any;
|
3
3
|
export declare const getAppDomain: (domainParams: {
|
4
4
|
environment: string;
|
@@ -20,10 +20,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
20
20
|
import { v4 as uuid } from 'uuid';
|
21
21
|
import { sdkVersion } from "../../config";
|
22
22
|
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
23
|
import { queryPaymentInfo, submitPayInfo } from "../../service";
|
25
24
|
import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, TargetEnum } from "../../types";
|
26
25
|
import { getType, isJsonString, isPC } from "../../util";
|
26
|
+
import { ElementPaymentMethod } from "../../core/component/element/type";
|
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 { type IElementOptions, ElementType, ThemeType, PaymentElementLayout } from '../core/component/
|
10
|
+
export { type IElementOptions, ElementType, ThemeType, PaymentElementLayout } from '../core/component/element/type';
|
11
11
|
interface onCnageResult {
|
12
12
|
complete: boolean;
|
13
13
|
addressValue: AddressItem[];
|
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, ThemeType, PaymentElementLayout } from "../core/component/
|
11
|
+
export { ElementType, ThemeType, PaymentElementLayout } from "../core/component/element/type";
|
12
12
|
|
13
13
|
/**
|
14
14
|
* SDK options
|
package/package.json
CHANGED
@@ -1,30 +0,0 @@
|
|
1
|
-
import BaseElementProcessor from '../elementProcessor/baseElementProcessor';
|
2
|
-
import { ContainerService } from './../../../../foundation/service/container';
|
3
|
-
import { EventCenter } from './../../../../foundation/service/event-center';
|
4
|
-
export declare enum IContainerStatus {
|
5
|
-
UNINIT = "UNINIT",
|
6
|
-
INITING = "INITING",
|
7
|
-
READY = "READY",
|
8
|
-
IN_BIZ_FLOW = "IN_BIZ_FLOW",
|
9
|
-
DESTROYED = "DESTROYED"
|
10
|
-
}
|
11
|
-
export declare class ContainerController {
|
12
|
-
private containerStatus;
|
13
|
-
private instanceId;
|
14
|
-
private containerService;
|
15
|
-
private eventService;
|
16
|
-
private _globalData?;
|
17
|
-
constructor({ type, instanceId, selector, processor, options, }: {
|
18
|
-
type: string;
|
19
|
-
instanceId: string;
|
20
|
-
selector: string;
|
21
|
-
processor: BaseElementProcessor;
|
22
|
-
options: any;
|
23
|
-
});
|
24
|
-
private addEventListener;
|
25
|
-
createWebLaunchPromise(): Promise<unknown>;
|
26
|
-
switchContainerStatus(status: IContainerStatus): void;
|
27
|
-
getContainerStatus(): IContainerStatus;
|
28
|
-
getEventService(): EventCenter;
|
29
|
-
getContainerService(): ContainerService;
|
30
|
-
}
|