@alipay/ams-checkout 0.0.1745390310-dev.5 → 0.0.1745390310-dev.6
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 +4 -1
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +9 -0
- package/esm/constant/index.js +9 -0
- package/esm/core/component/element/elementContainerService/containerService.d.ts +33 -0
- package/esm/core/component/element/elementContainerService/containerService.js +123 -0
- package/esm/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/core/component/element/elementContainerService/index.js +63 -0
- package/esm/core/component/element/elementController/index.d.ts +27 -0
- package/esm/core/component/element/elementController/index.js +478 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.js +160 -0
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/authProcessor.js +125 -0
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +38 -0
- package/esm/core/component/element/elementProcessor/baseElementProcessor.js +85 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +373 -0
- package/esm/core/component/element/index.d.ts +8 -46
- package/esm/core/component/element/index.js +28 -922
- package/esm/core/component/element/mock.d.ts +4 -0
- package/esm/core/component/element/mock.js +365 -1
- package/esm/core/component/element/type.d.ts +42 -1
- package/esm/core/component/element/util.d.ts +60 -0
- package/esm/core/component/element/util.js +451 -0
- package/esm/core/component/index.d.ts +5 -1
- package/esm/core/component/index.js +1 -2
- package/esm/core/component/oldElement/index.d.ts +59 -0
- package/esm/core/component/oldElement/index.js +956 -0
- package/esm/core/component/oldElement/mock.d.ts +6 -0
- package/esm/core/component/oldElement/mock.js +567 -0
- package/esm/core/component/oldElement/type.d.ts +351 -0
- package/esm/core/component/oldElement/type.js +81 -0
- package/esm/foundation/core/index.d.ts +6 -1
- package/esm/foundation/core/index.js +70 -35
- package/esm/foundation/index.d.ts +14 -0
- package/esm/foundation/index.js +13 -2
- package/esm/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/foundation/product-processor/element/index.js +24 -0
- package/esm/foundation/service/container/index.d.ts +6 -3
- package/esm/foundation/service/container/index.js +45 -15
- package/esm/foundation/service/container/popup.d.ts +1 -1
- package/esm/foundation/service/event-center.js +1 -0
- package/esm/foundation/service/log/keys.js +3 -1
- package/esm/index.js +1 -0
- 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 → oldElement}/components/address.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/address.js +0 -0
- /package/esm/core/component/{element → oldElement}/components/auth.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/auth.js +0 -0
- /package/esm/core/component/{element → oldElement}/components/payment.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/payment.js +0 -0
- /package/esm/core/component/{element → oldElement}/utils.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/utils.js +0 -0
@@ -1,27 +1,28 @@
|
|
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; }
|
4
2
|
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; }
|
5
3
|
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); } }
|
6
4
|
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 { DisplayTypeEnum, eventCodeEnum } from "../../types";
|
14
|
-
import { DisplayInfo } from "../index";
|
15
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
|
+
import { DisplayTypeEnum, eventCodeEnum } from "../../types";
|
19
|
+
import { DisplayInfo, IElementStatus } from "../index";
|
16
20
|
import { ServiceProvider } from "../service";
|
17
|
-
import { convertPaymentSession, getWebAppVersion, saveWebAppVersion } from "../utils/payment_context_utils";
|
18
21
|
import { getGrayscaleId } from "../utils/gray_scale_utils";
|
19
|
-
import {
|
20
|
-
import { parseWebAppMatchConfig } from "../utils/web_app_url_utils";
|
22
|
+
import { convertPaymentSession, getWebAppVersion, saveWebAppVersion } from "../utils/payment_context_utils";
|
21
23
|
import { redirect } from "../utils/redirect_utils";
|
22
|
-
import {
|
23
|
-
|
24
|
-
import { COMPONENT_CLOSE_MASK_BLOCK_ID, EVENT, LOADING_ID } from "../../constant";
|
24
|
+
import { parseWebAppMatchConfig } from "../utils/web_app_url_utils";
|
25
|
+
|
25
26
|
/**
|
26
27
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
27
28
|
* @date 2024/9/17
|
@@ -36,8 +37,34 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
36
37
|
_defineProperty(this, "sdkMetaData", void 0);
|
37
38
|
_defineProperty(this, "productProcessors", {});
|
38
39
|
_defineProperty(this, "enablePopWindowEventCallback", false);
|
40
|
+
_defineProperty(this, "status", IElementStatus.UNINIT);
|
41
|
+
this.status = IElementStatus.INITING;
|
39
42
|
}
|
40
43
|
_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
|
+
}, {
|
41
68
|
key: "registerProcessor",
|
42
69
|
value: function registerProcessor(productScene) {
|
43
70
|
var paymentMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
@@ -152,6 +179,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
152
179
|
};
|
153
180
|
}());
|
154
181
|
eventCenter.listen(EVENT.destroy.name, function (data) {
|
182
|
+
_this.setStatus(IElementStatus.READY);
|
155
183
|
_this.destroy();
|
156
184
|
});
|
157
185
|
eventCenter.listen(EVENT.closeCallback.name, function () {
|
@@ -182,7 +210,7 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
182
210
|
value: function () {
|
183
211
|
var _startBizFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(options) {
|
184
212
|
var _this$paymentContext$, _this$paymentContext$2, _this$paymentContext$3;
|
185
|
-
var paymentSession, displayInfo,
|
213
|
+
var paymentSession, displayInfo, _convertPaymentSessio2, paymentSessionId, paymentSessionMetaData, mid, webAppMatchConfig, webAppVersion, productScene, paymentMethod, _this$bizFlowStartBeh, payload;
|
186
214
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
187
215
|
while (1) switch (_context3.prev = _context3.next) {
|
188
216
|
case 0:
|
@@ -192,8 +220,9 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
192
220
|
}
|
193
221
|
throw new Error('paymentSession is empty');
|
194
222
|
case 2:
|
223
|
+
this.setStatus(IElementStatus.IN_BIZ_FLOW);
|
195
224
|
paymentSession = options.paymentSession, displayInfo = options.displayInfo;
|
196
|
-
|
225
|
+
_convertPaymentSessio2 = convertPaymentSession(paymentSession), paymentSessionId = _convertPaymentSessio2.id, paymentSessionMetaData = _convertPaymentSessio2.data;
|
197
226
|
this.paymentContext = {
|
198
227
|
initOptions: this.initOptions,
|
199
228
|
startBizFlowOptions: options,
|
@@ -216,59 +245,59 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
216
245
|
// Invoke processor
|
217
246
|
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;
|
218
247
|
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;
|
219
|
-
_context3.prev =
|
248
|
+
_context3.prev = 14;
|
220
249
|
if (!this.productProcessors["".concat(productScene, "|").concat(paymentMethod)]) {
|
221
|
-
_context3.next =
|
250
|
+
_context3.next = 21;
|
222
251
|
break;
|
223
252
|
}
|
224
|
-
_context3.next =
|
253
|
+
_context3.next = 18;
|
225
254
|
return this.productProcessors["".concat(productScene, "|").concat(paymentMethod)].startBizFlow(this.paymentContext);
|
226
|
-
case
|
255
|
+
case 18:
|
227
256
|
this.bizFlowStartBehavior = _context3.sent;
|
228
|
-
_context3.next =
|
257
|
+
_context3.next = 25;
|
229
258
|
break;
|
230
|
-
case
|
259
|
+
case 21:
|
231
260
|
if (!this.productProcessors["".concat(productScene)]) {
|
232
|
-
_context3.next =
|
261
|
+
_context3.next = 25;
|
233
262
|
break;
|
234
263
|
}
|
235
|
-
_context3.next =
|
264
|
+
_context3.next = 24;
|
236
265
|
return this.productProcessors["".concat(productScene)].startBizFlow(this.paymentContext);
|
237
|
-
case 23:
|
238
|
-
this.bizFlowStartBehavior = _context3.sent;
|
239
266
|
case 24:
|
240
|
-
|
267
|
+
this.bizFlowStartBehavior = _context3.sent;
|
268
|
+
case 25:
|
269
|
+
_context3.next = 30;
|
241
270
|
break;
|
242
|
-
case
|
243
|
-
_context3.prev =
|
244
|
-
_context3.t0 = _context3["catch"](
|
271
|
+
case 27:
|
272
|
+
_context3.prev = 27;
|
273
|
+
_context3.t0 = _context3["catch"](14);
|
245
274
|
console.error('Invoke processor failed', _context3.t0);
|
246
|
-
case
|
275
|
+
case 30:
|
247
276
|
if (!(!this.bizFlowStartBehavior || this.bizFlowStartBehavior.behaviorType === 'NONE' || !this.bizFlowStartBehavior.payload)) {
|
248
|
-
_context3.next =
|
277
|
+
_context3.next = 32;
|
249
278
|
break;
|
250
279
|
}
|
251
280
|
return _context3.abrupt("return");
|
252
|
-
case
|
281
|
+
case 32:
|
253
282
|
if (!(this.bizFlowStartBehavior.behaviorType === 'RENDER')) {
|
254
|
-
_context3.next =
|
283
|
+
_context3.next = 35;
|
255
284
|
break;
|
256
285
|
}
|
257
286
|
this.handleBehaviorRender();
|
258
287
|
return _context3.abrupt("return");
|
259
|
-
case
|
288
|
+
case 35:
|
260
289
|
if (!(this.bizFlowStartBehavior.behaviorType === 'REDIRECT')) {
|
261
|
-
_context3.next =
|
290
|
+
_context3.next = 39;
|
262
291
|
break;
|
263
292
|
}
|
264
293
|
payload = (_this$bizFlowStartBeh = this.bizFlowStartBehavior) === null || _this$bizFlowStartBeh === void 0 ? void 0 : _this$bizFlowStartBeh.payload;
|
265
294
|
redirect(payload, this.instanceId);
|
266
295
|
return _context3.abrupt("return");
|
267
|
-
case
|
296
|
+
case 39:
|
268
297
|
case "end":
|
269
298
|
return _context3.stop();
|
270
299
|
}
|
271
|
-
}, _callee3, this, [[
|
300
|
+
}, _callee3, this, [[14, 27]]);
|
272
301
|
}));
|
273
302
|
function startBizFlow(_x5) {
|
274
303
|
return _startBizFlow.apply(this, arguments);
|
@@ -377,7 +406,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
377
406
|
var immediately = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
378
407
|
var containerService = ServiceProvider.getInstance(this.instanceId).getService('Container');
|
379
408
|
var cleanElement = function cleanElement() {
|
380
|
-
|
409
|
+
var _this3$paymentContext;
|
410
|
+
containerService.cleanContainer((_this3$paymentContext = _this3.paymentContext) === null || _this3$paymentContext === void 0 ? void 0 : _this3$paymentContext.displayInfo);
|
381
411
|
cleanMockup();
|
382
412
|
removeRetentionPopup();
|
383
413
|
// TODO @/component this.removeEventListener();
|
@@ -394,6 +424,11 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
394
424
|
cleanElement();
|
395
425
|
}, 300);
|
396
426
|
}
|
427
|
+
}, {
|
428
|
+
key: "getInstanceId",
|
429
|
+
value: function getInstanceId() {
|
430
|
+
return this.instanceId;
|
431
|
+
}
|
397
432
|
}]);
|
398
433
|
return AntomSDKCore;
|
399
434
|
}();
|
@@ -28,6 +28,13 @@ 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;
|
31
38
|
constructor();
|
32
39
|
}
|
33
40
|
/**
|
@@ -73,3 +80,10 @@ export interface InitContext {
|
|
73
80
|
initOptions: IoptionsParams;
|
74
81
|
sdkMetaData: SDKMetaData;
|
75
82
|
}
|
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,7 +7,6 @@ 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
|
-
|
11
10
|
/**
|
12
11
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
13
12
|
* @date 2024/9/17
|
@@ -27,6 +26,9 @@ export var DisplayInfo = /*#__PURE__*/_createClass(function DisplayInfo() {
|
|
27
26
|
_defineProperty(this, "appearance", void 0);
|
28
27
|
// append selector name to containerId
|
29
28
|
_defineProperty(this, "appendAliasContainerId", void 0);
|
29
|
+
_defineProperty(this, "merchantAppointParam", void 0);
|
30
|
+
_defineProperty(this, "iframeStyle", void 0);
|
31
|
+
_defineProperty(this, "notRedirectAfterComplete", void 0);
|
30
32
|
this.platform = isPC() ? PlatformEnum.desktop : PlatformEnum.mobile;
|
31
33
|
this.isRetention = true;
|
32
34
|
this.type = DisplayTypeEnum.popup;
|
@@ -39,4 +41,13 @@ export var DisplayInfo = /*#__PURE__*/_createClass(function DisplayInfo() {
|
|
39
41
|
|
40
42
|
/**
|
41
43
|
* Provide some capability, such as MonitorService, EventBusService, SecurityService
|
42
|
-
*/
|
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
|
+
}({});
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { BizFlowStartBehavior, ProductProcessor } from "../..";
|
2
|
+
declare class ElementProcessor implements ProductProcessor {
|
3
|
+
constructor();
|
4
|
+
init(config: any, instanceId: string): any;
|
5
|
+
startBizFlow(): Promise<BizFlowStartBehavior>;
|
6
|
+
}
|
7
|
+
export { ElementProcessor };
|
@@ -0,0 +1,24 @@
|
|
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 _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
|
+
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); }
|
7
|
+
var ElementProcessor = /*#__PURE__*/function () {
|
8
|
+
function ElementProcessor() {
|
9
|
+
_classCallCheck(this, ElementProcessor);
|
10
|
+
}
|
11
|
+
_createClass(ElementProcessor, [{
|
12
|
+
key: "init",
|
13
|
+
value: function init(config, instanceId) {
|
14
|
+
return null;
|
15
|
+
}
|
16
|
+
}, {
|
17
|
+
key: "startBizFlow",
|
18
|
+
value: function startBizFlow() {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
}]);
|
22
|
+
return ElementProcessor;
|
23
|
+
}();
|
24
|
+
export { ElementProcessor };
|
@@ -1,10 +1,12 @@
|
|
1
|
-
import { DisplayInfo, SDKMetaData, Service } from '../../index';
|
2
1
|
import { IoptionsParams } from '../../../types';
|
2
|
+
import { DisplayInfo, SDKMetaData, Service } from '../../index';
|
3
|
+
import { PopupManager } from './popup';
|
3
4
|
export declare class ContainerService implements Service {
|
4
5
|
private instanceId;
|
5
6
|
private sdkMetaData;
|
7
|
+
private initMessageEvent;
|
6
8
|
private clearTimerIdMapping;
|
7
|
-
|
9
|
+
popupManager: PopupManager;
|
8
10
|
private eventCenter;
|
9
11
|
private logService;
|
10
12
|
private displayInfo;
|
@@ -14,7 +16,7 @@ export declare class ContainerService implements Service {
|
|
14
16
|
destroy(): void;
|
15
17
|
init(initOptions: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
|
16
18
|
update(): void;
|
17
|
-
load(displayInfo: DisplayInfo, url: string, closeBtnFunc
|
19
|
+
load(displayInfo: DisplayInfo, url: string, closeBtnFunc?: () => void): HTMLDivElement;
|
18
20
|
cleanContainer(displayInfo: DisplayInfo): void;
|
19
21
|
showLoading(container: HTMLDivElement, displayInfo: DisplayInfo): void;
|
20
22
|
dismissLoading(isKeepMockup?: boolean): void;
|
@@ -27,4 +29,5 @@ export declare class ContainerService implements Service {
|
|
27
29
|
private handleAppHeartBeat;
|
28
30
|
private changeCloseBtnVisibility;
|
29
31
|
private handleMaskCloseBtnShow;
|
32
|
+
getWebApp(): HTMLIFrameElement;
|
30
33
|
}
|
@@ -7,14 +7,16 @@ 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 {
|
11
|
-
import { createIframe, startSizeChangeAnim } from "./utils";
|
10
|
+
import { isEmpty } from "../../../util";
|
12
11
|
import { addInlineLoading, createInlineBaseElement } from "../../../component/component.inline.style";
|
13
12
|
import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
|
14
|
-
import {
|
13
|
+
import { insertStyleSheet } from "../../../component/popupWindow.style";
|
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, ProductSceneEnum } from "../../../types";
|
15
16
|
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
|
+
|
18
20
|
/**
|
19
21
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
20
22
|
* @date 2024/9/17
|
@@ -25,6 +27,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
25
27
|
_classCallCheck(this, ContainerService);
|
26
28
|
_defineProperty(this, "instanceId", void 0);
|
27
29
|
_defineProperty(this, "sdkMetaData", void 0);
|
30
|
+
_defineProperty(this, "initMessageEvent", void 0);
|
28
31
|
_defineProperty(this, "clearTimerIdMapping", {});
|
29
32
|
_defineProperty(this, "popupManager", void 0);
|
30
33
|
_defineProperty(this, "eventCenter", void 0);
|
@@ -46,7 +49,11 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
46
49
|
this.eventCenter = ServiceProvider.getInstance(instanceId).getService('EventCenter');
|
47
50
|
this.logService = ServiceProvider.getInstance(instanceId).getService('Log');
|
48
51
|
this.popupManager = new PopupManager();
|
49
|
-
|
52
|
+
// element因涉及多组件联动,消息接受处理在产品层进行
|
53
|
+
var notAddEventCenter = Boolean(Object.keys(initOptions).length) && sdkMetaData.productScene === ProductSceneEnum.ELEMENT_PAYMENT;
|
54
|
+
if (!notAddEventCenter) {
|
55
|
+
this.addCapabilityToEventCenter();
|
56
|
+
}
|
50
57
|
this.addCapabilityToApiBusManager();
|
51
58
|
}
|
52
59
|
}, {
|
@@ -55,10 +62,21 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
55
62
|
}, {
|
56
63
|
key: "load",
|
57
64
|
value: function load(displayInfo, url, closeBtnFunc) {
|
58
|
-
var
|
65
|
+
var appendAliasContainerId = displayInfo.appendAliasContainerId,
|
66
|
+
selector = displayInfo.selector,
|
67
|
+
type = displayInfo.type,
|
68
|
+
platform = displayInfo.platform;
|
69
|
+
var webApp = createIframe('antom-sdk-web-app' + (displayInfo.appendAliasContainerId ? "-".concat(selector) : ''));
|
70
|
+
if (!isEmpty(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.iframeStyle)) {
|
71
|
+
Object.keys(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.iframeStyle).forEach(function (key) {
|
72
|
+
var _displayInfo$iframeSt;
|
73
|
+
webApp.style[key] = displayInfo === null || displayInfo === void 0 || (_displayInfo$iframeSt = displayInfo.iframeStyle) === null || _displayInfo$iframeSt === void 0 ? void 0 : _displayInfo$iframeSt[key];
|
74
|
+
});
|
75
|
+
}
|
59
76
|
this.webApp = webApp;
|
60
77
|
this.displayInfo = displayInfo;
|
61
78
|
webApp.src = url;
|
79
|
+
webApp.allow = 'payment';
|
62
80
|
this.eventCenter.addIFrame(webApp);
|
63
81
|
if (webApp.src.includes('?')) {
|
64
82
|
this.popupManager.setPopupUrlQuery(webApp.src.split('?')[1]);
|
@@ -66,7 +84,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
66
84
|
// TODO call ApiBusManager to add listener to iframe, componentApp line 979
|
67
85
|
|
68
86
|
// create container and append web app
|
69
|
-
var container =
|
87
|
+
var container = type === DisplayTypeEnum.inline ? createInlineBaseElement(selector, appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat((selector === null || selector === void 0 ? void 0 : selector.indexOf('#')) === -1 ? selector : selector.slice(1)) : '') : createBaseElement(platform, closeBtnFunc);
|
70
88
|
container.appendChild(webApp);
|
71
89
|
return container;
|
72
90
|
}
|
@@ -75,7 +93,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
75
93
|
value: function cleanContainer(displayInfo) {
|
76
94
|
var _document$getElementB;
|
77
95
|
// selector and container
|
78
|
-
var selector = displayInfo.type === DisplayTypeEnum.inline ? displayInfo.selector : COMPONENT_CONTAINER_ID;
|
96
|
+
var selector = (displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.type) === DisplayTypeEnum.inline ? displayInfo.selector : COMPONENT_CONTAINER_ID;
|
79
97
|
var selectorDom = document.querySelector(selector);
|
80
98
|
if (selectorDom) {
|
81
99
|
selectorDom.innerHTML = '';
|
@@ -86,7 +104,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
86
104
|
this.eventCenter.cleanIFrames();
|
87
105
|
|
88
106
|
// animation
|
89
|
-
(_document$getElementB = document.getElementById("".concat(COMPONENT_CONTAINER_ID, "-").concat(displayInfo.platform, "-animation-style"))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
107
|
+
(_document$getElementB = document.getElementById("".concat(COMPONENT_CONTAINER_ID, "-").concat(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.platform, "-animation-style"))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
90
108
|
}
|
91
109
|
}, {
|
92
110
|
key: "showLoading",
|
@@ -158,9 +176,12 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
158
176
|
this.eventCenter.listen(EVENT.popupWindow.name, function (data) {
|
159
177
|
var _this$displayInfo2;
|
160
178
|
if (data.paymentElementOldModel) return;
|
179
|
+
insertStyleSheet();
|
161
180
|
_this.popupManager.popup(_objectSpread({
|
162
181
|
platform: (_this$displayInfo2 = _this.displayInfo) === null || _this$displayInfo2 === void 0 ? void 0 : _this$displayInfo2.platform
|
163
|
-
}, data)).
|
182
|
+
}, data)).then(function () {
|
183
|
+
_this.eventCenter.addIFrame(_this.popupManager.popupApp);
|
184
|
+
}).catch(function (error) {
|
164
185
|
_this.logService.logError({
|
165
186
|
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
166
187
|
}, error);
|
@@ -207,22 +228,26 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
207
228
|
}, {
|
208
229
|
key: "handleSizeChanged",
|
209
230
|
value: function handleSizeChanged(data) {
|
231
|
+
var _this$displayInfo3 = this.displayInfo,
|
232
|
+
appendAliasContainerId = _this$displayInfo3.appendAliasContainerId,
|
233
|
+
selector = _this$displayInfo3.selector;
|
234
|
+
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;
|
210
235
|
if (!this.webApp || !this.displayInfo) {
|
211
236
|
return;
|
212
237
|
}
|
213
|
-
var cashier = document.getElementById(
|
214
|
-
if ((data === null || data === void 0 ? void 0 : data.height) <= 1 || data.height === parseInt(cashier.style.height)) return;
|
238
|
+
var cashier = document.getElementById(cashierId);
|
239
|
+
if (!cashier || (data === null || data === void 0 ? void 0 : data.height) <= 1 || data.height === parseInt(cashier.style.height)) return;
|
215
240
|
cashier.style.height = "".concat(data.height, "px");
|
216
241
|
this.webApp.style.opacity = '1';
|
217
242
|
if (this.displayInfo.type === DisplayTypeEnum.popup) {
|
218
243
|
if (this.displayInfo.platform === 'desktop') {
|
219
244
|
if (data.width) cashier.style.width = "".concat(data.width, "px");
|
220
|
-
cashier.classList.add("".concat(
|
245
|
+
cashier.classList.add("".concat(cashierId, "-").concat(this.displayInfo.platform, "-animation"));
|
221
246
|
this.webApp.style.height = "".concat(data.height, "px");
|
222
247
|
}
|
223
248
|
if (this.displayInfo.platform === 'mobile') {
|
224
|
-
cashier.classList.add("".concat(
|
225
|
-
var animationStyleId = "".concat(
|
249
|
+
cashier.classList.add("".concat(cashierId, "-").concat(this.displayInfo.platform, "-animation"));
|
250
|
+
var animationStyleId = "".concat(cashierId, "-").concat(this.displayInfo.platform, "-animation-style");
|
226
251
|
var animationStyle = document.getElementById(animationStyleId);
|
227
252
|
if (animationStyle) animationStyle === null || animationStyle === void 0 || animationStyle.remove();
|
228
253
|
|
@@ -298,6 +323,11 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
298
323
|
closeBlock === null || closeBlock === void 0 || closeBlock.classList.add("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-hidden"));
|
299
324
|
}
|
300
325
|
}
|
326
|
+
}, {
|
327
|
+
key: "getWebApp",
|
328
|
+
value: function getWebApp() {
|
329
|
+
return this.webApp;
|
330
|
+
}
|
301
331
|
}]);
|
302
332
|
return ContainerService;
|
303
333
|
}();
|
@@ -109,6 +109,7 @@ 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') {}
|
112
113
|
if (!this.checkEventCompliant(_eventPayload)) {
|
113
114
|
return;
|
114
115
|
}
|
@@ -89,7 +89,9 @@ _defineProperty(LogComplianceExtendKeys, "complianceExtParams", {
|
|
89
89
|
// M 数字类型
|
90
90
|
timeCost: 'M',
|
91
91
|
pageLoadProgress: 'M',
|
92
|
-
fsDuration: 'M'
|
92
|
+
fsDuration: 'M',
|
93
|
+
// 由于部分logerror参数是msg
|
94
|
+
msg: 'C'
|
93
95
|
});
|
94
96
|
export var KEYS = {
|
95
97
|
EVENT_SDK_ON_ABNORMAL_EVENT_NAME: {
|
package/esm/index.js
CHANGED
@@ -27,6 +27,7 @@ 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';
|
30
31
|
import { AMSComponent } from "./core/component/index";
|
31
32
|
import { ComponentSignEnum, DisplayTypeEnum, PaymentMethodCategoryTypeEnum } from "./types";
|
32
33
|
import { ProductSceneEnum } from "./types/index";
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ComponentSignEnum,
|
1
|
+
import { ComponentSignEnum, DisplayTypeEnum, Ianalytics } 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";
|
23
24
|
import { queryPaymentInfo, submitPayInfo } from "../../service";
|
24
25
|
import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, MessageName, PlatformEnum, ProductSceneEnum, RedirectType, TargetEnum } from "../../types";
|
25
26
|
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/oldElement/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/oldElement/type";
|
12
12
|
|
13
13
|
/**
|
14
14
|
* SDK options
|
package/package.json
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|