@alipay/ams-checkout 0.0.1744283958-dev.9 → 0.0.1745390310-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 -9
- package/esm/constant/index.js +0 -9
- package/esm/core/component/ckp/index.d.ts +26 -6
- package/esm/core/component/ckp/index.js +357 -25
- package/esm/core/component/ckp/interface.d.ts +540 -0
- package/esm/core/component/ckp/interface.js +233 -0
- package/esm/core/component/element/index.d.ts +46 -8
- package/esm/core/component/element/index.js +922 -28
- package/esm/core/component/element/mock.d.ts +0 -2
- package/esm/core/component/element/mock.js +0 -360
- package/esm/core/component/element/type.d.ts +1 -42
- 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 +35 -70
- package/esm/foundation/index.d.ts +0 -14
- package/esm/foundation/index.js +2 -13
- package/esm/foundation/service/container/index.d.ts +3 -6
- package/esm/foundation/service/container/index.js +16 -43
- 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 -33
- package/esm/core/component/element/elementContainerService/containerService.js +0 -122
- package/esm/core/component/element/elementContainerService/index.d.ts +0 -20
- package/esm/core/component/element/elementContainerService/index.js +0 -63
- package/esm/core/component/element/elementController/index.d.ts +0 -25
- package/esm/core/component/element/elementController/index.js +0 -448
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/addressProcessor.js +0 -145
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/authProcessor.js +0 -125
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +0 -38
- package/esm/core/component/element/elementProcessor/baseElementProcessor.js +0 -85
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +0 -372
- package/esm/core/component/element/util.d.ts +0 -60
- package/esm/core/component/element/util.js +0 -451
- 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 -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}/utils.d.ts +0 -0
- /package/esm/core/component/{oldElement → element}/utils.js +0 -0
@@ -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);
|
@@ -406,8 +377,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
406
377
|
var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
407
378
|
var containerService = ServiceProvider.getInstance(this.instanceId).getService('Container');
|
408
379
|
var cleanElement = function cleanElement() {
|
409
|
-
|
410
|
-
containerService.cleanContainer((_this3$paymentContext = _this3.paymentContext) === null || _this3$paymentContext === void 0 ? void 0 : _this3$paymentContext.displayInfo);
|
380
|
+
containerService.cleanContainer(_this3.paymentContext.displayInfo);
|
411
381
|
cleanMockup();
|
412
382
|
removeRetentionPopup();
|
413
383
|
// TODO @/component this.removeEventListener();
|
@@ -424,11 +394,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
424
394
|
cleanElement();
|
425
395
|
}, 300);
|
426
396
|
}
|
427
|
-
}, {
|
428
|
-
key: "getInstanceId",
|
429
|
-
value: function getInstanceId() {
|
430
|
-
return this.instanceId;
|
431
|
-
}
|
432
397
|
}]);
|
433
398
|
return AntomSDKCore;
|
434
399
|
}();
|
@@ -28,13 +28,6 @@ export declare class DisplayInfo {
|
|
28
28
|
selector: string;
|
29
29
|
appearance?: Record<string, any>;
|
30
30
|
appendAliasContainerId?: boolean;
|
31
|
-
merchantAppointParam?: {
|
32
|
-
storedCard: {
|
33
|
-
needCVV: boolean;
|
34
|
-
};
|
35
|
-
};
|
36
|
-
iframeStyle?: Partial<CSSStyleDeclaration>;
|
37
|
-
notRedirectAfterComplete?: boolean;
|
38
31
|
constructor();
|
39
32
|
}
|
40
33
|
/**
|
@@ -80,10 +73,3 @@ export interface InitContext {
|
|
80
73
|
initOptions: IoptionsParams;
|
81
74
|
sdkMetaData: SDKMetaData;
|
82
75
|
}
|
83
|
-
export declare enum IElementStatus {
|
84
|
-
UNINIT = "UNINIT",
|
85
|
-
INITING = "INITING",
|
86
|
-
READY = "READY",
|
87
|
-
IN_BIZ_FLOW = "IN_BIZ_FLOW",
|
88
|
-
DESTROYED = "DESTROYED"
|
89
|
-
}
|
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
|
@@ -26,9 +27,6 @@ export var DisplayInfo = /*#__PURE__*/_createClass(function DisplayInfo() {
|
|
26
27
|
_defineProperty(this, "appearance", void 0);
|
27
28
|
// append selector name to containerId
|
28
29
|
_defineProperty(this, "appendAliasContainerId", void 0);
|
29
|
-
_defineProperty(this, "merchantAppointParam", void 0);
|
30
|
-
_defineProperty(this, "iframeStyle", void 0);
|
31
|
-
_defineProperty(this, "notRedirectAfterComplete", void 0);
|
32
30
|
this.platform = isPC() ? PlatformEnum.desktop : PlatformEnum.mobile;
|
33
31
|
this.isRetention = true;
|
34
32
|
this.type = DisplayTypeEnum.popup;
|
@@ -41,13 +39,4 @@ export var DisplayInfo = /*#__PURE__*/_createClass(function DisplayInfo() {
|
|
41
39
|
|
42
40
|
/**
|
43
41
|
* Provide some capability, such as MonitorService, EventBusService, SecurityService
|
44
|
-
*/
|
45
|
-
|
46
|
-
export var IElementStatus = /*#__PURE__*/function (IElementStatus) {
|
47
|
-
IElementStatus["UNINIT"] = "UNINIT";
|
48
|
-
IElementStatus["INITING"] = "INITING";
|
49
|
-
IElementStatus["READY"] = "READY";
|
50
|
-
IElementStatus["IN_BIZ_FLOW"] = "IN_BIZ_FLOW";
|
51
|
-
IElementStatus["DESTROYED"] = "DESTROYED";
|
52
|
-
return IElementStatus;
|
53
|
-
}({});
|
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,16 +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 {
|
10
|
+
import { DisplayTypeEnum } from "../../../types";
|
11
|
+
import { createIframe, startSizeChangeAnim } from "./utils";
|
11
12
|
import { addInlineLoading, createInlineBaseElement } from "../../../component/component.inline.style";
|
12
13
|
import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
|
13
|
-
import {
|
14
|
-
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";
|
15
|
-
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";
|
16
15
|
import { ServiceProvider } from "../index";
|
16
|
+
import { EVENT, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT } from "../../../constant";
|
17
17
|
import { PopupManager } from "./popup";
|
18
|
-
import { createIframe, startSizeChangeAnim } from "./utils";
|
19
|
-
|
20
18
|
/**
|
21
19
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
22
20
|
* @date 2024/9/17
|
@@ -27,7 +25,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
27
25
|
_classCallCheck(this, ContainerService);
|
28
26
|
_defineProperty(this, "instanceId", void 0);
|
29
27
|
_defineProperty(this, "sdkMetaData", void 0);
|
30
|
-
_defineProperty(this, "initMessageEvent", void 0);
|
31
28
|
_defineProperty(this, "clearTimerIdMapping", {});
|
32
29
|
_defineProperty(this, "popupManager", void 0);
|
33
30
|
_defineProperty(this, "eventCenter", void 0);
|
@@ -49,9 +46,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
49
46
|
this.eventCenter = ServiceProvider.getInstance(instanceId).getService('EventCenter');
|
50
47
|
this.logService = ServiceProvider.getInstance(instanceId).getService('Log');
|
51
48
|
this.popupManager = new PopupManager();
|
52
|
-
|
53
|
-
this.addCapabilityToEventCenter();
|
54
|
-
}
|
49
|
+
this.addCapabilityToEventCenter();
|
55
50
|
this.addCapabilityToApiBusManager();
|
56
51
|
}
|
57
52
|
}, {
|
@@ -60,17 +55,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
60
55
|
}, {
|
61
56
|
key: "load",
|
62
57
|
value: function load(displayInfo, url, closeBtnFunc) {
|
63
|
-
var
|
64
|
-
selector = displayInfo.selector,
|
65
|
-
type = displayInfo.type,
|
66
|
-
platform = displayInfo.platform;
|
67
|
-
var webApp = createIframe('antom-sdk-web-app' + (displayInfo.appendAliasContainerId ? "-".concat(selector) : ''));
|
68
|
-
if (!isEmpty(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.iframeStyle)) {
|
69
|
-
Object.keys(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.iframeStyle).forEach(function (key) {
|
70
|
-
var _displayInfo$iframeSt;
|
71
|
-
webApp.style[key] = displayInfo === null || displayInfo === void 0 || (_displayInfo$iframeSt = displayInfo.iframeStyle) === null || _displayInfo$iframeSt === void 0 ? void 0 : _displayInfo$iframeSt[key];
|
72
|
-
});
|
73
|
-
}
|
58
|
+
var webApp = createIframe('antom-sdk-web-app' + (displayInfo.appendAliasContainerId ? "-".concat(displayInfo.selector) : ''));
|
74
59
|
this.webApp = webApp;
|
75
60
|
this.displayInfo = displayInfo;
|
76
61
|
webApp.src = url;
|
@@ -81,7 +66,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
81
66
|
// TODO call ApiBusManager to add listener to iframe, componentApp line 979
|
82
67
|
|
83
68
|
// create container and append web app
|
84
|
-
var container = type === DisplayTypeEnum.inline ? createInlineBaseElement(
|
69
|
+
var container = displayInfo.type === DisplayTypeEnum.inline ? createInlineBaseElement(displayInfo.selector) : createBaseElement(displayInfo.platform, closeBtnFunc);
|
85
70
|
container.appendChild(webApp);
|
86
71
|
return container;
|
87
72
|
}
|
@@ -90,7 +75,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
90
75
|
value: function cleanContainer(displayInfo) {
|
91
76
|
var _document$getElementB;
|
92
77
|
// selector and container
|
93
|
-
var selector =
|
78
|
+
var selector = displayInfo.type === DisplayTypeEnum.inline ? displayInfo.selector : COMPONENT_CONTAINER_ID;
|
94
79
|
var selectorDom = document.querySelector(selector);
|
95
80
|
if (selectorDom) {
|
96
81
|
selectorDom.innerHTML = '';
|
@@ -101,7 +86,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
101
86
|
this.eventCenter.cleanIFrames();
|
102
87
|
|
103
88
|
// animation
|
104
|
-
(_document$getElementB = document.getElementById("".concat(COMPONENT_CONTAINER_ID, "-").concat(displayInfo
|
89
|
+
(_document$getElementB = document.getElementById("".concat(COMPONENT_CONTAINER_ID, "-").concat(displayInfo.platform, "-animation-style"))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
105
90
|
}
|
106
91
|
}, {
|
107
92
|
key: "showLoading",
|
@@ -172,13 +157,10 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
172
157
|
});
|
173
158
|
this.eventCenter.listen(EVENT.popupWindow.name, function (data) {
|
174
159
|
var _this$displayInfo2;
|
175
|
-
|
176
|
-
insertStyleSheet();
|
160
|
+
if (data.paymentElementOldModel) return;
|
177
161
|
_this.popupManager.popup(_objectSpread({
|
178
162
|
platform: (_this$displayInfo2 = _this.displayInfo) === null || _this$displayInfo2 === void 0 ? void 0 : _this$displayInfo2.platform
|
179
|
-
}, data)).
|
180
|
-
_this.eventCenter.addIFrame(_this.popupManager.popupApp);
|
181
|
-
}).catch(function (error) {
|
163
|
+
}, data)).catch(function (error) {
|
182
164
|
_this.logService.logError({
|
183
165
|
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
184
166
|
}, error);
|
@@ -225,26 +207,22 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
225
207
|
}, {
|
226
208
|
key: "handleSizeChanged",
|
227
209
|
value: function handleSizeChanged(data) {
|
228
|
-
var _this$displayInfo3 = this.displayInfo,
|
229
|
-
appendAliasContainerId = _this$displayInfo3.appendAliasContainerId,
|
230
|
-
selector = _this$displayInfo3.selector;
|
231
|
-
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;
|
232
210
|
if (!this.webApp || !this.displayInfo) {
|
233
211
|
return;
|
234
212
|
}
|
235
|
-
var cashier = document.getElementById(
|
236
|
-
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;
|
237
215
|
cashier.style.height = "".concat(data.height, "px");
|
238
216
|
this.webApp.style.opacity = '1';
|
239
217
|
if (this.displayInfo.type === DisplayTypeEnum.popup) {
|
240
218
|
if (this.displayInfo.platform === 'desktop') {
|
241
219
|
if (data.width) cashier.style.width = "".concat(data.width, "px");
|
242
|
-
cashier.classList.add("".concat(
|
220
|
+
cashier.classList.add("".concat(COMPONENT_CONTAINER_ID, "-").concat(this.displayInfo.platform, "-animation"));
|
243
221
|
this.webApp.style.height = "".concat(data.height, "px");
|
244
222
|
}
|
245
223
|
if (this.displayInfo.platform === 'mobile') {
|
246
|
-
cashier.classList.add("".concat(
|
247
|
-
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");
|
248
226
|
var animationStyle = document.getElementById(animationStyleId);
|
249
227
|
if (animationStyle) animationStyle === null || animationStyle === void 0 || animationStyle.remove();
|
250
228
|
|
@@ -320,11 +298,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
320
298
|
closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
|
321
299
|
}
|
322
300
|
}
|
323
|
-
}, {
|
324
|
-
key: "getWebApp",
|
325
|
-
value: function getWebApp() {
|
326
|
-
return this.webApp;
|
327
|
-
}
|
328
301
|
}]);
|
329
302
|
return ContainerService;
|
330
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,33 +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 containerElement;
|
17
|
-
private _globalData?;
|
18
|
-
constructor({ type, instanceId, selector, processor, options, }: {
|
19
|
-
type: string;
|
20
|
-
instanceId: string;
|
21
|
-
selector: string;
|
22
|
-
processor: BaseElementProcessor;
|
23
|
-
options: any;
|
24
|
-
});
|
25
|
-
private addEventListener;
|
26
|
-
getContainerElement(): HTMLDivElement;
|
27
|
-
createWebLaunchPromise(): Promise<unknown>;
|
28
|
-
switchContainerStatus(status: IContainerStatus): void;
|
29
|
-
getContainerStatus(): IContainerStatus;
|
30
|
-
getEventService(): EventCenter;
|
31
|
-
destroy(): void;
|
32
|
-
getContainerService(): ContainerService;
|
33
|
-
}
|