@alipay/ams-checkout 0.0.1755258862-dev.0 → 0.0.1755681537-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.
Files changed (99) hide show
  1. package/dist/umd/ams-checkout.min.js +1 -1
  2. package/esm/component/channel.d.ts +3 -1
  3. package/esm/component/channel.js +26 -62
  4. package/esm/component/component.inline.style.js +2 -2
  5. package/esm/component/popupWindow.style.d.ts +4 -1
  6. package/esm/component/popupWindow.style.js +37 -2
  7. package/esm/config/index.d.ts +8 -8
  8. package/esm/config/index.js +8 -8
  9. package/esm/constant/easysafepay.d.ts +16 -0
  10. package/esm/constant/easysafepay.js +19 -0
  11. package/esm/constant/index.d.ts +41 -2
  12. package/esm/constant/index.js +43 -5
  13. package/esm/core/component/ckp/index.d.ts +2 -0
  14. package/esm/core/component/ckp/index.js +41 -5
  15. package/esm/core/component/element/elementContainerService/containerService.d.ts +33 -0
  16. package/esm/core/component/element/elementContainerService/containerService.js +123 -0
  17. package/esm/core/component/element/elementContainerService/index.d.ts +20 -0
  18. package/esm/core/component/element/elementContainerService/index.js +63 -0
  19. package/esm/core/component/element/elementController/index.d.ts +27 -0
  20. package/esm/core/component/element/elementController/index.js +493 -0
  21. package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
  22. package/esm/core/component/element/elementProcessor/addressProcessor.js +160 -0
  23. package/esm/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
  24. package/esm/core/component/element/elementProcessor/authProcessor.js +125 -0
  25. package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +41 -0
  26. package/esm/core/component/element/elementProcessor/baseElementProcessor.js +96 -0
  27. package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +20 -0
  28. package/esm/core/component/element/elementProcessor/paymentProcessor.js +380 -0
  29. package/esm/core/component/element/index.d.ts +7 -46
  30. package/esm/core/component/element/index.js +31 -923
  31. package/esm/core/component/element/mock.d.ts +4 -0
  32. package/esm/core/component/element/mock.js +365 -1
  33. package/esm/core/component/element/type.d.ts +74 -34
  34. package/esm/core/component/element/type.js +20 -12
  35. package/esm/core/component/element/util.d.ts +69 -0
  36. package/esm/core/component/element/util.js +477 -0
  37. package/esm/core/component/index.d.ts +5 -1
  38. package/esm/core/component/index.js +1 -2
  39. package/esm/core/component/oldElement/index.d.ts +59 -0
  40. package/esm/core/component/oldElement/index.js +956 -0
  41. package/esm/core/component/oldElement/mock.d.ts +6 -0
  42. package/esm/core/component/oldElement/mock.js +567 -0
  43. package/esm/core/component/oldElement/type.d.ts +354 -0
  44. package/esm/core/component/oldElement/type.js +81 -0
  45. package/esm/core/instance/index.d.ts +1 -1
  46. package/esm/core/instance/index.js +1 -1
  47. package/esm/foundation/core/index.d.ts +9 -1
  48. package/esm/foundation/core/index.js +153 -49
  49. package/esm/foundation/index.d.ts +20 -0
  50. package/esm/foundation/index.js +13 -2
  51. package/esm/foundation/product-processor/autoDebit/deps.d.ts +14 -0
  52. package/esm/foundation/product-processor/autoDebit/deps.js +12 -0
  53. package/esm/foundation/product-processor/autoDebit/index.d.ts +48 -0
  54. package/esm/foundation/product-processor/autoDebit/index.js +466 -0
  55. package/esm/foundation/product-processor/easysafepay/deps.d.ts +3 -1
  56. package/esm/foundation/product-processor/easysafepay/deps.js +3 -1
  57. package/esm/foundation/product-processor/easysafepay/index.d.ts +5 -0
  58. package/esm/foundation/product-processor/easysafepay/index.js +266 -138
  59. package/esm/foundation/product-processor/element/index.d.ts +7 -0
  60. package/esm/foundation/product-processor/element/index.js +24 -0
  61. package/esm/foundation/service/container/index.d.ts +14 -3
  62. package/esm/foundation/service/container/index.js +178 -25
  63. package/esm/foundation/service/container/popup.d.ts +10 -7
  64. package/esm/foundation/service/container/popup.js +3 -1
  65. package/esm/foundation/service/event-center.js +1 -0
  66. package/esm/foundation/service/log/keys.js +3 -1
  67. package/esm/foundation/service/log/types.d.ts +1 -0
  68. package/esm/foundation/service/requester/requester.js +17 -37
  69. package/esm/foundation/utils/preload_helper.d.ts +2 -2
  70. package/esm/foundation/utils/preload_helper.js +8 -4
  71. package/esm/foundation/utils/redirect_utils.js +34 -18
  72. package/esm/foundation/utils/web_app_url_utils.d.ts +71 -1
  73. package/esm/foundation/utils/web_app_url_utils.js +219 -8
  74. package/esm/index.d.ts +8 -5
  75. package/esm/index.js +103 -53
  76. package/esm/plugin/component/cashierApp.d.ts +1 -1
  77. package/esm/plugin/component/cashierApp.js +5 -5
  78. package/esm/plugin/component/channel.d.ts +3 -1
  79. package/esm/plugin/component/channel.js +10 -12
  80. package/esm/plugin/component/index.js +47 -44
  81. package/esm/plugin/type.d.ts +1 -1
  82. package/esm/request/index.js +2 -2
  83. package/esm/types/index.d.ts +37 -3
  84. package/esm/types/index.js +10 -2
  85. package/esm/util/index.d.ts +12 -1
  86. package/esm/util/index.js +39 -3
  87. package/esm/util/redirect.d.ts +6 -0
  88. package/esm/util/redirect.js +54 -0
  89. package/esm/util/spm-map.d.ts +18 -4
  90. package/esm/util/spm-map.js +20 -6
  91. package/package.json +27 -4
  92. /package/esm/core/component/{element → oldElement}/components/address.d.ts +0 -0
  93. /package/esm/core/component/{element → oldElement}/components/address.js +0 -0
  94. /package/esm/core/component/{element → oldElement}/components/auth.d.ts +0 -0
  95. /package/esm/core/component/{element → oldElement}/components/auth.js +0 -0
  96. /package/esm/core/component/{element → oldElement}/components/payment.d.ts +0 -0
  97. /package/esm/core/component/{element → oldElement}/components/payment.js +0 -0
  98. /package/esm/core/component/{element → oldElement}/utils.d.ts +0 -0
  99. /package/esm/core/component/{element → oldElement}/utils.js +0 -0
package/esm/index.js CHANGED
@@ -1,4 +1,7 @@
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); }); }; }
2
5
  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; } } }; }
3
6
  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); }
4
7
  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; }
@@ -24,18 +27,21 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
24
27
  * 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
25
28
  * 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.
26
29
  */
27
- import { ADDRESSElementAppVersion, AMSAutoDebitAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
30
+ import { ADDRESSElementAppVersion, AMSCashierPaymentAppVersion, AMSCheckoutAppVersion, AMSPaymentElementAppVersion, AMSVaultingAppVersion } from "./config/index";
28
31
  import { AddressComponent } from "./core/component/address";
29
32
  import { ElementComponent } from "./core/component/element";
33
+ // import { ElementComponent } from './core/component/oldElement';
30
34
  import { AMSComponent } from "./core/component/index";
31
- import { ComponentSignEnum, DisplayTypeEnum, PaymentMethodCategoryTypeEnum } from "./types";
35
+ import PreloadHelper from "./foundation/utils/preload_helper";
36
+ import { ComponentSignEnum, DisplayTypeEnum, eventCodeEnum, PaymentMethodCategoryTypeEnum } from "./types";
32
37
  import { ProductSceneEnum } from "./types/index";
33
38
  import { LogConfig, Logger } from "./util/logger";
34
- import PreloadHelper from "./foundation/utils/preload_helper";
35
39
  var logger = new Logger(LogConfig, true);
36
40
  export { AMSCheckoutPage } from "./core/component/ckp";
37
41
  export * from "./types";
42
+ import { EVENT } from "./constant";
38
43
  import { AntomSDKCore } from "./foundation/core";
44
+ import { AutoDebitProcessor } from "./foundation/product-processor/autoDebit";
39
45
  import { EasySafePayProcessor } from "./foundation/product-processor/easysafepay";
40
46
  export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
41
47
  _inherits(AMSCheckout, _AMSComponent);
@@ -52,39 +58,15 @@ export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
52
58
  }
53
59
  return _createClass(AMSCheckout);
54
60
  }(AMSComponent);
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);
61
+ export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout) {
62
+ _inherits(AMSAutoDebitPay, _AMSCheckout);
63
+ var _super2 = _createSuper(AMSAutoDebitPay);
82
64
  function AMSAutoDebitPay(options) {
83
65
  _classCallCheck(this, AMSAutoDebitPay);
84
66
  var _options = Object.assign({}, options, {
85
67
  product: ProductSceneEnum.AUTO_DEBIT_PAY
86
68
  });
87
- return _super3.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_PAY_WALLET]);
69
+ return _super2.call(this, _options, [ComponentSignEnum.AUTO_DEBIT_PAY_WALLET]);
88
70
  }
89
71
  _createClass(AMSAutoDebitPay, null, [{
90
72
  key: "preload",
@@ -99,9 +81,9 @@ export var AMSAutoDebitPay = /*#__PURE__*/function (_AMSCheckout2) {
99
81
  }]);
100
82
  return AMSAutoDebitPay;
101
83
  }(AMSCheckout);
102
- export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
103
- _inherits(AMSCashierPayment, _AMSCheckout3);
104
- var _super4 = _createSuper(AMSCashierPayment);
84
+ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout2) {
85
+ _inherits(AMSCashierPayment, _AMSCheckout2);
86
+ var _super3 = _createSuper(AMSCashierPayment);
105
87
  function AMSCashierPayment(options) {
106
88
  _classCallCheck(this, AMSCashierPayment);
107
89
  var _options = Object.assign({}, options, {
@@ -127,7 +109,7 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
127
109
  errorMessage: error
128
110
  });
129
111
  }
130
- return _super4.call(this, _options, currentChannelType);
112
+ return _super3.call(this, _options, currentChannelType);
131
113
  }
132
114
  _createClass(AMSCashierPayment, null, [{
133
115
  key: "preload",
@@ -172,16 +154,16 @@ export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
172
154
  }]);
173
155
  return AMSCashierPayment;
174
156
  }(AMSCheckout);
175
- export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout4) {
176
- _inherits(AMSVaulting, _AMSCheckout4);
177
- var _super5 = _createSuper(AMSVaulting);
157
+ export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout3) {
158
+ _inherits(AMSVaulting, _AMSCheckout3);
159
+ var _super4 = _createSuper(AMSVaulting);
178
160
  function AMSVaulting(options) {
179
161
  _classCallCheck(this, AMSVaulting);
180
162
  var _options = Object.assign({}, options, {
181
163
  product: ProductSceneEnum.VAULTING,
182
164
  appVersion: AMSVaultingAppVersion
183
165
  });
184
- return _super5.call(this, _options, [ComponentSignEnum.CASHIER_PAYMENT_CARD]);
166
+ return _super4.call(this, _options, [ComponentSignEnum.CASHIER_PAYMENT_CARD]);
185
167
  }
186
168
  _createClass(AMSVaulting, null, [{
187
169
  key: "preload",
@@ -196,44 +178,44 @@ export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout4) {
196
178
  }]);
197
179
  return AMSVaulting;
198
180
  }(AMSCheckout);
199
- export var AntomElement = /*#__PURE__*/function (_AMSCheckout5) {
200
- _inherits(AntomElement, _AMSCheckout5);
201
- var _super6 = _createSuper(AntomElement);
181
+ export var AntomElement = /*#__PURE__*/function (_AMSCheckout4) {
182
+ _inherits(AntomElement, _AMSCheckout4);
183
+ var _super5 = _createSuper(AntomElement);
202
184
  function AntomElement(options) {
203
185
  _classCallCheck(this, AntomElement);
204
186
  var _options = Object.assign({}, options, {
205
187
  product: ProductSceneEnum.ELEMENT_PAYMENT,
206
188
  appVersion: AMSPaymentElementAppVersion
207
189
  });
208
- return _super6.call(this, _options, [ComponentSignEnum.ELEMENT_PAYMENT]);
190
+ return _super5.call(this, _options, [ComponentSignEnum.ELEMENT_PAYMENT]);
209
191
  }
210
192
  return _createClass(AntomElement);
211
193
  }(AMSCheckout);
212
194
  export var AddressElement = /*#__PURE__*/function (_AddressComponent) {
213
195
  _inherits(AddressElement, _AddressComponent);
214
- var _super7 = _createSuper(AddressElement);
196
+ var _super6 = _createSuper(AddressElement);
215
197
  function AddressElement(options) {
216
198
  _classCallCheck(this, AddressElement);
217
199
  var _options = Object.assign({}, options, {
218
200
  product: ProductSceneEnum.ELEMENT_ADDRESS,
219
201
  appVersion: ADDRESSElementAppVersion
220
202
  });
221
- return _super7.call(this, _options);
203
+ return _super6.call(this, _options);
222
204
  }
223
205
  return _createClass(AddressElement);
224
206
  }(AddressComponent);
225
- export var Element = /*#__PURE__*/function (_ElementComponent) {
226
- _inherits(Element, _ElementComponent);
227
- var _super8 = _createSuper(Element);
228
- function Element(options) {
229
- _classCallCheck(this, Element);
207
+ export var AMSElement = /*#__PURE__*/function (_ElementComponent) {
208
+ _inherits(AMSElement, _ElementComponent);
209
+ var _super7 = _createSuper(AMSElement);
210
+ function AMSElement(options) {
211
+ _classCallCheck(this, AMSElement);
230
212
  var _options = Object.assign({}, options, {
231
213
  product: ProductSceneEnum.ELEMENT_PAYMENT,
232
214
  environment: options.environment
233
215
  });
234
- return _super8.call(this, _options);
216
+ return _super7.call(this, _options);
235
217
  }
236
- return _createClass(Element);
218
+ return _createClass(AMSElement);
237
219
  }(ElementComponent);
238
220
  export var AMSEasyPay = /*#__PURE__*/function () {
239
221
  function AMSEasyPay(options) {
@@ -270,9 +252,77 @@ export var AMSEasyPay = /*#__PURE__*/function () {
270
252
  securityRegion: 'SG',
271
253
  environment: 'prod'
272
254
  };
273
- PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment);
255
+ PreloadHelper.preloadWebApp(ProductSceneEnum.EASY_PAY, PaymentMethodCategoryTypeEnum.WALLET, options.environment, true);
274
256
  }
275
257
  }]);
276
258
  return AMSEasyPay;
277
259
  }();
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
+ }();
278
328
  export default AMSCheckout;
@@ -1,4 +1,4 @@
1
- import { ComponentSignEnum, Ianalytics, DisplayTypeEnum } from '../../types';
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;
@@ -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 { elementAppMarmotMap, marmotMap, sdkVersion } from "../../config/index";
18
+ import { marmotMap, sdkVersion, v2AppMarmotMap } 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(_signSupportMap, ComponentSignEnum.ELEMENT_ADDRESS, ['1.0']), ComponentSignEnum.CHECKOUT_PAYMENT, ['1.0.0']));
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(_defineProperty(_signSupportMap, ComponentSignEnum.ELEMENT_ADDRESS, ['1.0']), ComponentSignEnum.CHECKOUT_PAYMENT, ['1.0.0']), ComponentSignEnum.AUTO_DEBIT_APM, ['1.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(elementAppMarmotMap[environment], "/element-address/").concat(finalAppVersion, "/pages/address/index.html");
106
+ return "".concat(v2AppMarmotMap[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(elementAppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/express_checkout/index.html");
120
+ return "".concat(v2AppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/express_checkout/index.html");
121
121
  } else {
122
- return "".concat(elementAppMarmotMap[environment], "/elements/").concat(finalAppVersion, "/pages/").concat(productScene.toLowerCase(), "/index.html");
122
+ return "".concat(v2AppMarmotMap[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,12 +11,14 @@ export type IChannelBehavior = {
11
11
  type GetDoubleFaParams = {
12
12
  instanceId: string;
13
13
  paymentSessionData: string;
14
+ paymentSessionObj: IPaymentSessionMetaData;
14
15
  locale: string;
15
16
  paymentMethodType: string;
16
17
  env: string;
17
18
  sdkVersion: string;
19
+ notRedirectAfterComplete: boolean;
18
20
  };
19
- export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
21
+ export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData, notRedirectAfterComplete?: boolean): IChannelBehavior | undefined;
20
22
  export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
21
23
  export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
22
24
  export declare class ApplePaySdk {
@@ -14,6 +14,8 @@ 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";
17
19
  var APPLEPAYERRORENUM = /*#__PURE__*/function (APPLEPAYERRORENUM) {
18
20
  APPLEPAYERRORENUM["APPLE_PAY_MISSING_DATA"] = "APPLE_PAY_MISSING_DATA";
19
21
  APPLEPAYERRORENUM["APPLE_PAY_NOT_SUPPORTED"] = "APPLE_PAY_NOT_SUPPORTED";
@@ -27,7 +29,7 @@ var PAYMENT_STATUS = /*#__PURE__*/function (PAYMENT_STATUS) {
27
29
  PAYMENT_STATUS["NORMAL"] = "NORMAL";
28
30
  return PAYMENT_STATUS;
29
31
  }(PAYMENT_STATUS || {});
30
- export function getChannelBehavior(paymentSessionMetaData) {
32
+ export function getChannelBehavior(paymentSessionMetaData, notRedirectAfterComplete) {
31
33
  var _paymentSessionMetaDa, _paymentSessionMetaDa2, _paymentSessionMetaDa3, _paymentSessionMetaDa4, _paymentSessionMetaDa5, _paymentSessionMetaDa6, _paymentSessionMetaDa7, _paymentSessionMetaDa8;
32
34
  // TOSS EASYPAY 2.0
33
35
  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') {
@@ -40,7 +42,8 @@ export function getChannelBehavior(paymentSessionMetaData) {
40
42
  buildSubmitPayExtParams: function buildSubmitPayExtParams(params) {
41
43
  var callBackUrl = getDoubleFaUrl(params);
42
44
  return {
43
- callBackUrl: callBackUrl
45
+ callBackUrl: callBackUrl,
46
+ notRedirectAfterComplete: notRedirectAfterComplete === true
44
47
  };
45
48
  }
46
49
  };
@@ -65,20 +68,15 @@ export function getDoubleFaUrl(params) {
65
68
  var instanceId = params.instanceId,
66
69
  paymentMethodType = params.paymentMethodType,
67
70
  paymentSessionData = params.paymentSessionData,
71
+ paymentSessionObj = params.paymentSessionObj,
68
72
  locale = params.locale,
69
73
  env = params.env,
70
- sdkVersion = params.sdkVersion;
74
+ sdkVersion = params.sdkVersion,
75
+ notRedirectAfterComplete = params.notRedirectAfterComplete;
71
76
  var isLandscapeOrientation = false; // Web 不含横屏
72
77
 
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);
78
+ var baseDoubleFaUrl = getDoubleFaUrlFromSession(paymentSessionObj, env);
79
+ return "".concat(baseDoubleFaUrl) + '?' + "scene=cashierResultPage" + '&' + "instanceId=".concat(instanceId) + '&' + "paymentSessionData=".concat(encodeURIComponent(paymentSessionData)) + '&' + "isLandscape=".concat(isLandscapeOrientation ? 'true' : '') + '&' + "pmt=".concat(paymentMethodType) + '&' + "locale=".concat(locale) + '&' + "mode=".concat(MODE.SDK) + '&' + "sdkVersion=".concat(sdkVersion) + '&' + "&notRedirectAfterComplete=".concat(notRedirectAfterComplete);
82
80
  }
83
81
  export var handleGooglePay = function handleGooglePay(data) {
84
82
  return new Promise(function (resolve, reject) {