@alipay/ams-checkout 0.0.1755253657-dev.2 → 0.0.1755258862-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/channel.d.ts +1 -3
- package/esm/component/channel.js +62 -26
- package/esm/component/component.inline.style.js +2 -2
- package/esm/component/popupWindow.style.d.ts +1 -4
- package/esm/component/popupWindow.style.js +2 -37
- package/esm/config/index.d.ts +8 -8
- package/esm/config/index.js +8 -8
- package/esm/constant/index.d.ts +2 -41
- package/esm/constant/index.js +5 -43
- package/esm/core/component/ckp/index.d.ts +0 -2
- package/esm/core/component/ckp/index.js +5 -41
- package/esm/core/component/element/index.d.ts +46 -7
- package/esm/core/component/element/index.js +923 -31
- package/esm/core/component/element/mock.d.ts +0 -4
- package/esm/core/component/element/mock.js +1 -365
- package/esm/core/component/element/type.d.ts +34 -74
- package/esm/core/component/element/type.js +12 -20
- package/esm/core/component/index.d.ts +1 -5
- package/esm/core/component/index.js +2 -1
- package/esm/core/instance/index.d.ts +1 -1
- package/esm/core/instance/index.js +1 -1
- package/esm/foundation/core/index.d.ts +1 -9
- package/esm/foundation/core/index.js +49 -153
- package/esm/foundation/index.d.ts +0 -20
- package/esm/foundation/index.js +2 -13
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +1 -3
- package/esm/foundation/product-processor/easysafepay/deps.js +1 -3
- package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -5
- package/esm/foundation/product-processor/easysafepay/index.js +137 -313
- package/esm/foundation/service/container/index.d.ts +3 -14
- package/esm/foundation/service/container/index.js +25 -178
- package/esm/foundation/service/container/popup.d.ts +7 -10
- package/esm/foundation/service/container/popup.js +1 -3
- package/esm/foundation/service/event-center.js +0 -1
- package/esm/foundation/service/log/keys.js +1 -3
- package/esm/foundation/service/log/types.d.ts +0 -1
- package/esm/foundation/service/requester/requester.js +6 -7
- package/esm/foundation/utils/preload_helper.d.ts +2 -2
- package/esm/foundation/utils/preload_helper.js +4 -8
- package/esm/foundation/utils/redirect_utils.js +18 -34
- package/esm/foundation/utils/web_app_url_utils.d.ts +1 -71
- package/esm/foundation/utils/web_app_url_utils.js +8 -219
- package/esm/index.d.ts +4 -7
- package/esm/index.js +48 -98
- package/esm/plugin/component/cashierApp.d.ts +1 -1
- package/esm/plugin/component/cashierApp.js +5 -5
- package/esm/plugin/component/channel.d.ts +1 -3
- package/esm/plugin/component/channel.js +12 -10
- package/esm/plugin/component/index.js +44 -47
- package/esm/plugin/type.d.ts +1 -1
- package/esm/request/index.js +2 -2
- package/esm/types/index.d.ts +3 -37
- package/esm/types/index.js +2 -10
- package/esm/util/index.d.ts +1 -8
- package/esm/util/index.js +3 -31
- package/esm/util/spm-map.d.ts +4 -18
- package/esm/util/spm-map.js +6 -20
- package/package.json +4 -27
- package/esm/constant/easysafepay.d.ts +0 -16
- package/esm/constant/easysafepay.js +0 -19
- package/esm/core/component/element/elementContainerService/containerService.d.ts +0 -33
- package/esm/core/component/element/elementContainerService/containerService.js +0 -123
- 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 -27
- package/esm/core/component/element/elementController/index.js +0 -493
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/addressProcessor.js +0 -160
- 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 -41
- package/esm/core/component/element/elementProcessor/baseElementProcessor.js +0 -96
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +0 -380
- package/esm/core/component/element/util.d.ts +0 -69
- package/esm/core/component/element/util.js +0 -477
- package/esm/core/component/oldElement/index.d.ts +0 -59
- package/esm/core/component/oldElement/index.js +0 -956
- package/esm/core/component/oldElement/mock.d.ts +0 -6
- package/esm/core/component/oldElement/mock.js +0 -567
- package/esm/core/component/oldElement/type.d.ts +0 -354
- package/esm/core/component/oldElement/type.js +0 -81
- package/esm/foundation/product-processor/autoDebit/deps.d.ts +0 -14
- package/esm/foundation/product-processor/autoDebit/deps.js +0 -12
- package/esm/foundation/product-processor/autoDebit/index.d.ts +0 -48
- package/esm/foundation/product-processor/autoDebit/index.js +0 -466
- package/esm/foundation/product-processor/element/index.d.ts +0 -7
- package/esm/foundation/product-processor/element/index.js +0 -24
- package/esm/util/redirect.d.ts +0 -6
- package/esm/util/redirect.js +0 -54
- /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
package/esm/index.js
CHANGED
@@ -1,7 +1,4 @@
|
|
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 _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
|
-
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
|
-
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
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
6
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
7
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
@@ -27,22 +24,19 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
27
24
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
28
25
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
29
26
|
*/
|
30
|
-
import { ADDRESSElementAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
|
27
|
+
import { ADDRESSElementAppVersion, AMSAutoDebitAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
|
31
28
|
import { AddressComponent } from "./core/component/address";
|
32
29
|
import { ElementComponent } from "./core/component/element";
|
33
|
-
// import { ElementComponent } from './core/component/oldElement';
|
34
30
|
import { AMSComponent } from "./core/component/index";
|
35
|
-
import
|
36
|
-
import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, PaymentMethodCategoryTypeEnum } from "./types";
|
31
|
+
import { ComponentSignEnum, DisplayTypeEnum, PaymentMethodCategoryTypeEnum } from "./types";
|
37
32
|
import { ProductSceneEnum } from "./types/index";
|
38
33
|
import { LogConfig, Logger } from "./util/logger";
|
34
|
+
import PreloadHelper from "./foundation/utils/preload_helper";
|
39
35
|
var logger = new Logger(LogConfig, true);
|
40
36
|
export { AMSCheckoutPage } from "./core/component/ckp";
|
41
37
|
export * from "./types";
|
42
38
|
import { AntomSDKCore } from "./foundation/core";
|
43
|
-
import { AutoDebitProcessor } from "./foundation/product-processor/autoDebit";
|
44
39
|
import { EasySafePayProcessor } from "./foundation/product-processor/easysafepay";
|
45
|
-
import { EVENT } from "./constant";
|
46
40
|
export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
47
41
|
_inherits(AMSCheckout, _AMSComponent);
|
48
42
|
var _super = _createSuper(AMSCheckout);
|
@@ -58,15 +52,39 @@ export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
|
58
52
|
}
|
59
53
|
return _createClass(AMSCheckout);
|
60
54
|
}(AMSComponent);
|
61
|
-
export var
|
62
|
-
_inherits(
|
63
|
-
var _super2 = _createSuper(
|
55
|
+
export var AMSAutoDebit = /*#__PURE__*/function (_AMSCheckout) {
|
56
|
+
_inherits(AMSAutoDebit, _AMSCheckout);
|
57
|
+
var _super2 = _createSuper(AMSAutoDebit);
|
58
|
+
function AMSAutoDebit(options) {
|
59
|
+
_classCallCheck(this, AMSAutoDebit);
|
60
|
+
var _options = Object.assign({}, options, {
|
61
|
+
product: ProductSceneEnum.AUTO_DEBIT,
|
62
|
+
appVersion: AMSAutoDebitAppVersion
|
63
|
+
});
|
64
|
+
return _super2.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_WALLET]);
|
65
|
+
}
|
66
|
+
_createClass(AMSAutoDebit, null, [{
|
67
|
+
key: "preload",
|
68
|
+
value: function preload() {
|
69
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
70
|
+
securityRegion: 'SG',
|
71
|
+
environment: 'prod'
|
72
|
+
};
|
73
|
+
PreloadHelper.preloadWebApp(ProductSceneEnum.AUTO_DEBIT, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
|
74
|
+
PreloadHelper.preloadSecuritySDK(ProductSceneEnum.AUTO_DEBIT, options.securityRegion);
|
75
|
+
}
|
76
|
+
}]);
|
77
|
+
return AMSAutoDebit;
|
78
|
+
}(AMSCheckout);
|
79
|
+
export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout2) {
|
80
|
+
_inherits(AMSAutoDebitPay, _AMSCheckout2);
|
81
|
+
var _super3 = _createSuper(AMSAutoDebitPay);
|
64
82
|
function AMSAutoDebitPay(options) {
|
65
83
|
_classCallCheck(this, AMSAutoDebitPay);
|
66
84
|
var _options = Object.assign({}, options, {
|
67
85
|
product: ProductSceneEnum.AUTO_DEBIT_PAY
|
68
86
|
});
|
69
|
-
return
|
87
|
+
return _super3.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_PAY_WALLET]);
|
70
88
|
}
|
71
89
|
_createClass(AMSAutoDebitPay, null, [{
|
72
90
|
key: "preload",
|
@@ -81,9 +99,9 @@ export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout) {
|
|
81
99
|
}]);
|
82
100
|
return AMSAutoDebitPay;
|
83
101
|
}(AMSCheckout);
|
84
|
-
export var AMSCashierPayment = /*#__PURE__*/function (
|
85
|
-
_inherits(AMSCashierPayment,
|
86
|
-
var
|
102
|
+
export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
|
103
|
+
_inherits(AMSCashierPayment, _AMSCheckout3);
|
104
|
+
var _super4 = _createSuper(AMSCashierPayment);
|
87
105
|
function AMSCashierPayment(options) {
|
88
106
|
_classCallCheck(this, AMSCashierPayment);
|
89
107
|
var _options = Object.assign({}, options, {
|
@@ -109,7 +127,7 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout2) {
|
|
109
127
|
errorMessage: error
|
110
128
|
});
|
111
129
|
}
|
112
|
-
return
|
130
|
+
return _super4.call(this, _options, currentChannelType);
|
113
131
|
}
|
114
132
|
_createClass(AMSCashierPayment, null, [{
|
115
133
|
key: "preload",
|
@@ -154,16 +172,16 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout2) {
|
|
154
172
|
}]);
|
155
173
|
return AMSCashierPayment;
|
156
174
|
}(AMSCheckout);
|
157
|
-
export var AMSVaulting = /*#__PURE__*/function (
|
158
|
-
_inherits(AMSVaulting,
|
159
|
-
var
|
175
|
+
export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout4) {
|
176
|
+
_inherits(AMSVaulting, _AMSCheckout4);
|
177
|
+
var _super5 = _createSuper(AMSVaulting);
|
160
178
|
function AMSVaulting(options) {
|
161
179
|
_classCallCheck(this, AMSVaulting);
|
162
180
|
var _options = Object.assign({}, options, {
|
163
181
|
product: ProductSceneEnum.VAULTING,
|
164
182
|
appVersion: AMSVaultingAppVersion
|
165
183
|
});
|
166
|
-
return
|
184
|
+
return _super5.call(this, _options, [ComponentSignEnum.CASHIER_PAYMENT_CARD]);
|
167
185
|
}
|
168
186
|
_createClass(AMSVaulting, null, [{
|
169
187
|
key: "preload",
|
@@ -178,42 +196,42 @@ export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout3) {
|
|
178
196
|
}]);
|
179
197
|
return AMSVaulting;
|
180
198
|
}(AMSCheckout);
|
181
|
-
export var AntomElement = /*#__PURE__*/function (
|
182
|
-
_inherits(AntomElement,
|
183
|
-
var
|
199
|
+
export var AntomElement = /*#__PURE__*/function (_AMSCheckout5) {
|
200
|
+
_inherits(AntomElement, _AMSCheckout5);
|
201
|
+
var _super6 = _createSuper(AntomElement);
|
184
202
|
function AntomElement(options) {
|
185
203
|
_classCallCheck(this, AntomElement);
|
186
204
|
var _options = Object.assign({}, options, {
|
187
205
|
product: ProductSceneEnum.ELEMENT_PAYMENT,
|
188
206
|
appVersion: AMSPaymentElementAppVersion
|
189
207
|
});
|
190
|
-
return
|
208
|
+
return _super6.call(this, _options, [ComponentSignEnum.ELEMENT_PAYMENT]);
|
191
209
|
}
|
192
210
|
return _createClass(AntomElement);
|
193
211
|
}(AMSCheckout);
|
194
212
|
export var AddressElement = /*#__PURE__*/function (_AddressComponent) {
|
195
213
|
_inherits(AddressElement, _AddressComponent);
|
196
|
-
var
|
214
|
+
var _super7 = _createSuper(AddressElement);
|
197
215
|
function AddressElement(options) {
|
198
216
|
_classCallCheck(this, AddressElement);
|
199
217
|
var _options = Object.assign({}, options, {
|
200
218
|
product: ProductSceneEnum.ELEMENT_ADDRESS,
|
201
219
|
appVersion: ADDRESSElementAppVersion
|
202
220
|
});
|
203
|
-
return
|
221
|
+
return _super7.call(this, _options);
|
204
222
|
}
|
205
223
|
return _createClass(AddressElement);
|
206
224
|
}(AddressComponent);
|
207
225
|
export var Element = /*#__PURE__*/function (_ElementComponent) {
|
208
226
|
_inherits(Element, _ElementComponent);
|
209
|
-
var
|
227
|
+
var _super8 = _createSuper(Element);
|
210
228
|
function Element(options) {
|
211
229
|
_classCallCheck(this, Element);
|
212
230
|
var _options = Object.assign({}, options, {
|
213
231
|
product: ProductSceneEnum.ELEMENT_PAYMENT,
|
214
232
|
environment: options.environment
|
215
233
|
});
|
216
|
-
return
|
234
|
+
return _super8.call(this, _options);
|
217
235
|
}
|
218
236
|
return _createClass(Element);
|
219
237
|
}(ElementComponent);
|
@@ -252,77 +270,9 @@ export var AMSEasyPay = /*#__PURE__*/function () {
|
|
252
270
|
securityRegion: 'SG',
|
253
271
|
environment: 'prod'
|
254
272
|
};
|
255
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment
|
273
|
+
PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
|
256
274
|
}
|
257
275
|
}]);
|
258
276
|
return AMSEasyPay;
|
259
277
|
}();
|
260
|
-
export var AMSAutoDebit = /*#__PURE__*/function () {
|
261
|
-
function AMSAutoDebit(options) {
|
262
|
-
_classCallCheck(this, AMSAutoDebit);
|
263
|
-
_defineProperty(this, "core", void 0);
|
264
|
-
this.core = new AntomSDKCore();
|
265
|
-
this.core.registerProcessor(ProductSceneEnum.AUTO_DEBIT, '', new AutoDebitProcessor());
|
266
|
-
this.core.init(options, ProductSceneEnum.AUTO_DEBIT);
|
267
|
-
}
|
268
|
-
_createClass(AMSAutoDebit, [{
|
269
|
-
key: "createComponent",
|
270
|
-
value: function () {
|
271
|
-
var _createComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
272
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
273
|
-
while (1) switch (_context.prev = _context.next) {
|
274
|
-
case 0:
|
275
|
-
_context.prev = 0;
|
276
|
-
_context.next = 3;
|
277
|
-
return this.core.startBizFlow({
|
278
|
-
submitPayRequestExtra: {
|
279
|
-
notRedirectAfterComplete: params.notRedirectAfterComplete,
|
280
|
-
merchantAppointParam: params.merchantAppointParam
|
281
|
-
},
|
282
|
-
paymentSession: params.sessionData || params.paymentSessionData,
|
283
|
-
displayInfo: {
|
284
|
-
type: DisplayTypeEnum.popup
|
285
|
-
},
|
286
|
-
isAppWebview: params.isAppWebview
|
287
|
-
});
|
288
|
-
case 3:
|
289
|
-
_context.next = 9;
|
290
|
-
break;
|
291
|
-
case 5:
|
292
|
-
_context.prev = 5;
|
293
|
-
_context.t0 = _context["catch"](0);
|
294
|
-
this.core.getServiceProvider().getService('EventCenter').emit(EVENT.eventCallback.name, {
|
295
|
-
code: eventCodeEnum.SDK_CREATEPAYMENT_PARAMETER_ERROR,
|
296
|
-
message: (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || 'Initialization parameter exception.'
|
297
|
-
});
|
298
|
-
this.core.destroy();
|
299
|
-
case 9:
|
300
|
-
case "end":
|
301
|
-
return _context.stop();
|
302
|
-
}
|
303
|
-
}, _callee, this, [[0, 5]]);
|
304
|
-
}));
|
305
|
-
function createComponent(_x) {
|
306
|
-
return _createComponent.apply(this, arguments);
|
307
|
-
}
|
308
|
-
return createComponent;
|
309
|
-
}()
|
310
|
-
}, {
|
311
|
-
key: "unmount",
|
312
|
-
value: function unmount() {
|
313
|
-
this.core.destroy();
|
314
|
-
}
|
315
|
-
}], [{
|
316
|
-
key: "preload",
|
317
|
-
value: function preload() {
|
318
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
319
|
-
securityRegion: 'SG',
|
320
|
-
environment: 'prod'
|
321
|
-
};
|
322
|
-
PreloadHelper.preloadWebApp(ProductSceneEnum.AUTO_DEBIT, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
|
323
|
-
PreloadHelper.preloadSecuritySDK(ProductSceneEnum.AUTO_DEBIT, options.securityRegion);
|
324
|
-
}
|
325
|
-
}]);
|
326
|
-
return AMSAutoDebit;
|
327
|
-
}();
|
328
278
|
export default AMSCheckout;
|
@@ -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;
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
15
15
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
16
16
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
17
17
|
*/
|
18
|
-
import { marmotMap, sdkVersion
|
18
|
+
import { elementAppMarmotMap, marmotMap, sdkVersion } from "../../config/index";
|
19
19
|
import { ComponentSignEnum, ComponentSignEnumV2 } from "../../types";
|
20
20
|
import { isDebugLog } from "../../util/debug";
|
21
21
|
import { queryParse, serialize } from "../../util/index";
|
@@ -59,7 +59,7 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
|
59
59
|
};
|
60
60
|
var getFinalProductSceneVersion = function getFinalProductSceneVersion(componentSign, productSceneVersion) {
|
61
61
|
var _signSupportMap;
|
62
|
-
var signSupportMap = (_signSupportMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_signSupportMap, ComponentSignEnum.NONE, ['']), ComponentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), ComponentSignEnum.AUTO_DEBIT_PAY_WALLET, ['']), ComponentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), ComponentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), ComponentSignEnum.CASHIER_PAYMENT_APM, ['1.0']), ComponentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), ComponentSignEnum.EASY_PAY_APM, ['2.0']), ComponentSignEnum.VAULTING_CARD, ['1.0']), ComponentSignEnum.ELEMENT_PAYMENT, ['1.0']), _defineProperty(_defineProperty(
|
62
|
+
var signSupportMap = (_signSupportMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_signSupportMap, ComponentSignEnum.NONE, ['']), ComponentSignEnum.AUTO_DEBIT_WALLET, ['1.0']), ComponentSignEnum.AUTO_DEBIT_PAY_WALLET, ['']), ComponentSignEnum.CASHIER_PAYMENT_BANK, ['1.0']), ComponentSignEnum.CASHIER_PAYMENT_CARD, ['1.0']), ComponentSignEnum.CASHIER_PAYMENT_APM, ['1.0']), ComponentSignEnum.EASY_PAY_WALLET, ['1.0', '2.0']), ComponentSignEnum.EASY_PAY_APM, ['2.0']), ComponentSignEnum.VAULTING_CARD, ['1.0']), ComponentSignEnum.ELEMENT_PAYMENT, ['1.0']), _defineProperty(_defineProperty(_signSupportMap, ComponentSignEnum.ELEMENT_ADDRESS, ['1.0']), ComponentSignEnum.CHECKOUT_PAYMENT, ['1.0.0']));
|
63
63
|
var supportProductSceneVersion = signSupportMap[componentSign] || [];
|
64
64
|
// 从左到右,从旧到新
|
65
65
|
var isSupport = supportProductSceneVersion.find(function (it) {
|
@@ -103,7 +103,7 @@ export var getAppPath = function getAppPath() {
|
|
103
103
|
}
|
104
104
|
// 地址应用特殊处理
|
105
105
|
if (componentSign === ComponentSignEnum.ELEMENT_ADDRESS) {
|
106
|
-
return "".concat(
|
106
|
+
return "".concat(elementAppMarmotMap[environment], "/element-address/").concat(finalAppVersion, "/pages/address/index.html");
|
107
107
|
}
|
108
108
|
// element应用特殊处理
|
109
109
|
if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign)) {
|
@@ -117,9 +117,9 @@ export var getAppPath = function getAppPath() {
|
|
117
117
|
}
|
118
118
|
if (isExpressCheckout) {
|
119
119
|
// express_checkout模式走单独映射
|
120
|
-
return "".concat(
|
120
|
+
return "".concat(elementAppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/express_checkout/index.html");
|
121
121
|
} else {
|
122
|
-
return "".concat(
|
122
|
+
return "".concat(elementAppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/").concat(productScene.toLowerCase(), "/index.html");
|
123
123
|
}
|
124
124
|
}
|
125
125
|
return "".concat(marmotMap[environment], "/").concat(componentSign, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
|
@@ -11,14 +11,12 @@ export type IChannelBehavior = {
|
|
11
11
|
type GetDoubleFaParams = {
|
12
12
|
instanceId: string;
|
13
13
|
paymentSessionData: string;
|
14
|
-
paymentSessionObj: IPaymentSessionMetaData;
|
15
14
|
locale: string;
|
16
15
|
paymentMethodType: string;
|
17
16
|
env: string;
|
18
17
|
sdkVersion: string;
|
19
|
-
notRedirectAfterComplete: boolean;
|
20
18
|
};
|
21
|
-
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData
|
19
|
+
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
|
22
20
|
export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
|
23
21
|
export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
|
24
22
|
export declare class ApplePaySdk {
|
@@ -14,8 +14,6 @@ import { getApplePayPaymentSession, submitPayInfo } from "../../service";
|
|
14
14
|
import { EnvironmentEnum } from "../../types";
|
15
15
|
import { device, isEmpty } from "../../util";
|
16
16
|
import { APPLE_PAY_RECURRING_VERSION, APPLE_PAY_VERSION } from "../applepay/interface";
|
17
|
-
import { getDoubleFaUrlFromSession } from "../../foundation/utils/web_app_url_utils";
|
18
|
-
import { MODE } from "../../constant/easysafepay";
|
19
17
|
var APPLEPAYERRORENUM = /*#__PURE__*/function (APPLEPAYERRORENUM) {
|
20
18
|
APPLEPAYERRORENUM["APPLE_PAY_MISSING_DATA"] = "APPLE_PAY_MISSING_DATA";
|
21
19
|
APPLEPAYERRORENUM["APPLE_PAY_NOT_SUPPORTED"] = "APPLE_PAY_NOT_SUPPORTED";
|
@@ -29,7 +27,7 @@ var PAYMENT_STATUS = /*#__PURE__*/function (PAYMENT_STATUS) {
|
|
29
27
|
PAYMENT_STATUS["NORMAL"] = "NORMAL";
|
30
28
|
return PAYMENT_STATUS;
|
31
29
|
}(PAYMENT_STATUS || {});
|
32
|
-
export function getChannelBehavior(paymentSessionMetaData
|
30
|
+
export function getChannelBehavior(paymentSessionMetaData) {
|
33
31
|
var _paymentSessionMetaDa, _paymentSessionMetaDa2, _paymentSessionMetaDa3, _paymentSessionMetaDa4, _paymentSessionMetaDa5, _paymentSessionMetaDa6, _paymentSessionMetaDa7, _paymentSessionMetaDa8;
|
34
32
|
// TOSS EASYPAY 2.0
|
35
33
|
if ('BANKTRANSFER_QUICKPAY' === (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa === void 0 ? void 0 : _paymentSessionMetaDa.paymentMethodType) && (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa2 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa2 === void 0 ? void 0 : _paymentSessionMetaDa2.productScene) === 'EASY_PAY' && (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa3 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa3 === void 0 ? void 0 : _paymentSessionMetaDa3.paymentMethodCategoryType) === 'APM' && (paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa4 = paymentSessionMetaData.paymentSessionConfig) === null || _paymentSessionMetaDa4 === void 0 ? void 0 : _paymentSessionMetaDa4.productSceneVersion) === '2.0') {
|
@@ -42,8 +40,7 @@ export function getChannelBehavior(paymentSessionMetaData, notRedirectAfterCompl
|
|
42
40
|
buildSubmitPayExtParams: function buildSubmitPayExtParams(params) {
|
43
41
|
var callBackUrl = getDoubleFaUrl(params);
|
44
42
|
return {
|
45
|
-
callBackUrl: callBackUrl
|
46
|
-
notRedirectAfterComplete: notRedirectAfterComplete === true
|
43
|
+
callBackUrl: callBackUrl
|
47
44
|
};
|
48
45
|
}
|
49
46
|
};
|
@@ -68,15 +65,20 @@ export function getDoubleFaUrl(params) {
|
|
68
65
|
var instanceId = params.instanceId,
|
69
66
|
paymentMethodType = params.paymentMethodType,
|
70
67
|
paymentSessionData = params.paymentSessionData,
|
71
|
-
paymentSessionObj = params.paymentSessionObj,
|
72
68
|
locale = params.locale,
|
73
69
|
env = params.env,
|
74
|
-
sdkVersion = params.sdkVersion
|
75
|
-
notRedirectAfterComplete = params.notRedirectAfterComplete;
|
70
|
+
sdkVersion = params.sdkVersion;
|
76
71
|
var isLandscapeOrientation = false; // Web 不含横屏
|
77
72
|
|
78
|
-
var
|
79
|
-
|
73
|
+
var DOUBLE_FA_URL_MAPPING = {
|
74
|
+
local: "http://page.alipay.net/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
75
|
+
dev: "http://page.alipay.net/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
76
|
+
sit: "http://page.test.alipay.net/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
77
|
+
pre: "https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html"),
|
78
|
+
prod: "https://ac.alipay.com/page/antom-web-checkout/src/component-app/doubleFA/index.".concat(sdkVersion, ".html")
|
79
|
+
};
|
80
|
+
var doubleFaBaseUrl = DOUBLE_FA_URL_MAPPING[env] || DOUBLE_FA_URL_MAPPING.prod;
|
81
|
+
return "".concat(doubleFaBaseUrl, "?scene=cashierResultPage&instanceId=").concat(instanceId, "&paymentSessionData=").concat(encodeURIComponent(paymentSessionData), "&isLandscape=").concat(isLandscapeOrientation ? 'true' : '', "&pmt=").concat(paymentMethodType, "&locale=").concat(locale, "&sdkVersion=").concat(sdkVersion);
|
80
82
|
}
|
81
83
|
export var handleGooglePay = function handleGooglePay(data) {
|
82
84
|
return new Promise(function (resolve, reject) {
|