@alipay/ams-checkout 1.3.0 → 1.3.1-dev
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/esm/core/component/index.js +7 -26
- package/dist/esm/plugin/component/cashierApp.d.ts +24 -0
- package/dist/esm/plugin/component/{appPath.js → cashierApp.js} +74 -9
- package/dist/esm/plugin/component/index.d.ts +5 -12
- package/dist/esm/plugin/component/index.js +56 -109
- package/dist/esm/service/index.d.ts +2 -2
- package/dist/esm/types/index.d.ts +17 -10
- package/dist/umd/ams-checkout.min.js +1 -1
- package/package.json +54 -1
- package/dist/esm/plugin/component/appPath.d.ts +0 -2
@@ -1,13 +1,13 @@
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
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
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
6
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
7
5
|
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); }
|
8
6
|
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; }
|
9
7
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
10
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
9
|
+
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); } }
|
10
|
+
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); }); }; }
|
11
11
|
/**
|
12
12
|
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
13
13
|
*
|
@@ -19,7 +19,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
19
|
import { COMPONENTPLUGINID, ERRORMESSAGE } from "../../constant";
|
20
20
|
import ComponentApp from "../../plugin/component";
|
21
21
|
import { componentNameEnum, mode, networkMode, paymentMethodCategoryTypeEnum, productSceneEnum } from "../../types";
|
22
|
-
import { isPC } from "../../util";
|
23
22
|
import { createIframeNode } from "../../util/createIframeNode";
|
24
23
|
var getComponentSign = function getComponentSign(params) {
|
25
24
|
var _ref = params || {},
|
@@ -44,24 +43,6 @@ var parsePaymentSessionData = function parsePaymentSessionData(paymentSessionDat
|
|
44
43
|
return [{}, paymentSessionData];
|
45
44
|
}
|
46
45
|
};
|
47
|
-
|
48
|
-
// pc easy-pay execute 1.0 Process
|
49
|
-
var resetEasyPaySceneVersion = function resetEasyPaySceneVersion(parseData) {
|
50
|
-
if (isPC() && parseData !== null && parseData !== void 0 && parseData.paymentSessionConfig) {
|
51
|
-
var productScene = parseData.paymentSessionConfig.productScene;
|
52
|
-
if (productScene === productSceneEnum.EASY_PAY) {
|
53
|
-
parseData.paymentSessionConfig.productSceneVersion = '1.0';
|
54
|
-
}
|
55
|
-
}
|
56
|
-
};
|
57
|
-
var handlePaymentSessionData = function handlePaymentSessionData(originPaymentSessionData) {
|
58
|
-
var _parsePaymentSessionD = parsePaymentSessionData(originPaymentSessionData),
|
59
|
-
_parsePaymentSessionD2 = _slicedToArray(_parsePaymentSessionD, 2),
|
60
|
-
parseData = _parsePaymentSessionD2[0],
|
61
|
-
paymentSessionData = _parsePaymentSessionD2[1];
|
62
|
-
resetEasyPaySceneVersion(parseData);
|
63
|
-
return [parseData, paymentSessionData];
|
64
|
-
};
|
65
46
|
export var mixinComponentConstructor = function mixinComponentConstructor(options, context) {
|
66
47
|
// Instantiate the plug-in and set render
|
67
48
|
var ComponentPlugin = new ComponentApp();
|
@@ -113,10 +94,10 @@ export var createComponent = /*#__PURE__*/function () {
|
|
113
94
|
return _context.abrupt("return", Promise.reject(ERRORMESSAGE.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT));
|
114
95
|
case 16:
|
115
96
|
return _context.abrupt("return", new Promise(function (resolve, reject) {
|
116
|
-
var
|
117
|
-
|
118
|
-
parseData =
|
119
|
-
paymentSessionData =
|
97
|
+
var _parsePaymentSessionD = parsePaymentSessionData(_params.paymentSessionData),
|
98
|
+
_parsePaymentSessionD2 = _slicedToArray(_parsePaymentSessionD, 2),
|
99
|
+
parseData = _parsePaymentSessionD2[0],
|
100
|
+
paymentSessionData = _parsePaymentSessionD2[1];
|
120
101
|
var componentName = typeof componentNameOrParams === 'string' ? componentNameOrParams : getComponentSign(parseData);
|
121
102
|
if (componentName === '') {
|
122
103
|
// eslint-disable-next-line prefer-promise-reject-errors
|
@@ -140,7 +121,7 @@ export var createComponent = /*#__PURE__*/function () {
|
|
140
121
|
}
|
141
122
|
}, _callee, this);
|
142
123
|
}));
|
143
|
-
return function createComponent(
|
124
|
+
return function createComponent(_x, _x2) {
|
144
125
|
return _ref2.apply(this, arguments);
|
145
126
|
};
|
146
127
|
}();
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Ianalytics } from '../../types';
|
2
|
+
export declare const getAppPath: (environment: string | undefined, appVersion: string, componentName: string, productSceneVersion: string, extendInfo: string) => any;
|
3
|
+
export declare const getAppDomain: (domainParams: {
|
4
|
+
environment: string;
|
5
|
+
appVersion: string;
|
6
|
+
componentName: string;
|
7
|
+
productSceneVersion: string;
|
8
|
+
extendInfo: string;
|
9
|
+
}) => string;
|
10
|
+
export declare const getIframeUrl: (iframeParams: {
|
11
|
+
componentName: string;
|
12
|
+
appearance: Record<string, string>;
|
13
|
+
analytics?: Ianalytics;
|
14
|
+
productSceneVersion: string;
|
15
|
+
environment: string;
|
16
|
+
appVersion: string;
|
17
|
+
extendInfo: string;
|
18
|
+
locale: string;
|
19
|
+
instanceId: string;
|
20
|
+
}) => string;
|
21
|
+
/**
|
22
|
+
* @description Create iframe
|
23
|
+
*/
|
24
|
+
export declare const createIframe: (UIMode: string) => HTMLIFrameElement;
|
@@ -11,10 +11,10 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
11
11
|
*/
|
12
12
|
import json from "../../../package.json";
|
13
13
|
import { componentNameEnum } from "../../types";
|
14
|
-
import { queryParse } from "../../util/index";
|
14
|
+
import { getViewPort, queryParse, serialize } from "../../util/index";
|
15
15
|
export var getAppPath = function getAppPath() {
|
16
16
|
var _componentMap;
|
17
|
-
var
|
17
|
+
var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'prod';
|
18
18
|
var appVersion = arguments.length > 1 ? arguments[1] : undefined;
|
19
19
|
var componentName = arguments.length > 2 ? arguments[2] : undefined;
|
20
20
|
var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
|
@@ -27,7 +27,7 @@ export var getAppPath = function getAppPath() {
|
|
27
27
|
var getAppVersion = function getAppVersion(_extendInfo) {
|
28
28
|
try {
|
29
29
|
// Configure the specified version number
|
30
|
-
if (_appVersion && !['sandbox', 'light_sandbox', 'prod'].includes(
|
30
|
+
if (_appVersion && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) return _appVersion;
|
31
31
|
var info = JSON.parse(_extendInfo);
|
32
32
|
return info.versionMap.web[json.version].targetWebVerison || appVersion;
|
33
33
|
} catch (error) {
|
@@ -53,23 +53,88 @@ export var getAppPath = function getAppPath() {
|
|
53
53
|
return finalProductSceneVersion;
|
54
54
|
};
|
55
55
|
var componentMap = (_componentMap = {}, _defineProperty(_componentMap, componentNameEnum.card, function () {
|
56
|
-
host = "".concat(marmptMap[
|
56
|
+
host = "".concat(marmptMap[environment], "/").concat(componentNameEnum.card, "/index.").concat(finalAppVersion, ".html");
|
57
57
|
}), _defineProperty(_componentMap, componentNameEnum.easyPay, function () {
|
58
58
|
var finalProductSceneVersion = getFinalProductSceneVersion(['1.0', '2.0']);
|
59
|
-
host = "".concat(marmptMap[
|
59
|
+
host = "".concat(marmptMap[environment], "/").concat(componentNameEnum.easyPay, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
|
60
60
|
}), _defineProperty(_componentMap, componentNameEnum.autoDebit, function () {
|
61
61
|
var finalProductSceneVersion = getFinalProductSceneVersion(['1.0']);
|
62
|
-
host = "".concat(marmptMap[
|
62
|
+
host = "".concat(marmptMap[environment], "/").concat(componentNameEnum.autoDebit, "/").concat(finalProductSceneVersion, "/index.").concat(finalAppVersion, ".html");
|
63
63
|
}), _componentMap);
|
64
64
|
if (componentMap[componentName]) componentMap[componentName]();
|
65
65
|
// only for test while testurl?host=https://xxxxx.test.html
|
66
|
-
if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(
|
66
|
+
if (urlTestHost && !['sandbox', 'light_sandbox', 'prod'].includes(environment)) {
|
67
67
|
return urlTestHost;
|
68
68
|
}
|
69
69
|
return host;
|
70
70
|
};
|
71
|
-
export var getAppDomain = function getAppDomain(
|
71
|
+
export var getAppDomain = function getAppDomain(domainParams) {
|
72
|
+
var environment = domainParams.environment,
|
73
|
+
appVersion = domainParams.appVersion,
|
74
|
+
componentName = domainParams.componentName,
|
75
|
+
productSceneVersion = domainParams.productSceneVersion,
|
76
|
+
extendInfo = domainParams.extendInfo;
|
72
77
|
var reg = /^https?:\/\/([^/<>\s]+\.?)*/;
|
73
|
-
var macth = reg.exec(getAppPath(
|
78
|
+
var macth = reg.exec(getAppPath(environment, appVersion, componentName, productSceneVersion, extendInfo));
|
74
79
|
return macth && macth[0] || '';
|
80
|
+
};
|
81
|
+
export var getIframeUrl = function getIframeUrl(iframeParams) {
|
82
|
+
var componentName = iframeParams.componentName,
|
83
|
+
appearance = iframeParams.appearance,
|
84
|
+
_iframeParams$analyti = iframeParams.analytics,
|
85
|
+
analytics = _iframeParams$analyti === void 0 ? {
|
86
|
+
enabled: true
|
87
|
+
} : _iframeParams$analyti,
|
88
|
+
productSceneVersion = iframeParams.productSceneVersion,
|
89
|
+
environment = iframeParams.environment,
|
90
|
+
appVersion = iframeParams.appVersion,
|
91
|
+
extendInfo = iframeParams.extendInfo,
|
92
|
+
locale = iframeParams.locale,
|
93
|
+
instanceId = iframeParams.instanceId;
|
94
|
+
var path = getAppPath(environment, appVersion, componentName, productSceneVersion, extendInfo || '');
|
95
|
+
var scale = getViewPort('initial-scale') || 1;
|
96
|
+
var _queryParse = queryParse(),
|
97
|
+
_sandbox = _queryParse._sandbox,
|
98
|
+
_light_sandbox = _queryParse._light_sandbox,
|
99
|
+
_queryParse$requestHo = _queryParse.requestHost,
|
100
|
+
requestHost = _queryParse$requestHo === void 0 ? '' : _queryParse$requestHo,
|
101
|
+
_queryParse$groupId = _queryParse.groupId,
|
102
|
+
groupId = _queryParse$groupId === void 0 ? '' : _queryParse$groupId,
|
103
|
+
LOCAL_MOCK = _queryParse.LOCAL_MOCK;
|
104
|
+
var urlParams = Object.assign({
|
105
|
+
locale: locale,
|
106
|
+
scale: scale,
|
107
|
+
instanceId: instanceId,
|
108
|
+
sandbox: environment === 'light_sandbox' || _light_sandbox === 'true' ? 'true' : 'false',
|
109
|
+
analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
|
110
|
+
sdkVersion: json.version,
|
111
|
+
refUrl: window.location.href,
|
112
|
+
shadow: environment === 'sandbox' || _sandbox === 'true' ? 'true' : 'false',
|
113
|
+
requestHost: requestHost,
|
114
|
+
groupId: groupId,
|
115
|
+
LOCAL_MOCK: LOCAL_MOCK
|
116
|
+
}, appearance);
|
117
|
+
var locationSearch = serialize(urlParams);
|
118
|
+
return "".concat(path, "?").concat(locationSearch);
|
119
|
+
};
|
120
|
+
var getIframeId = function getIframeId(UIMode) {
|
121
|
+
var IdMap = {
|
122
|
+
dropin: 'checkout-dropin',
|
123
|
+
component: 'checkout-component'
|
124
|
+
};
|
125
|
+
return IdMap[UIMode] || 'checkout-component';
|
126
|
+
};
|
127
|
+
|
128
|
+
/**
|
129
|
+
* @description Create iframe
|
130
|
+
*/
|
131
|
+
export var createIframe = function createIframe(UIMode) {
|
132
|
+
var iframe = document.createElement('iframe');
|
133
|
+
var iframeId = getIframeId(UIMode);
|
134
|
+
iframe.id = iframeId;
|
135
|
+
iframe.style.height = '0px';
|
136
|
+
iframe.style.width = '100%';
|
137
|
+
iframe.style.border = '0';
|
138
|
+
iframe.style.overflow = 'hidden';
|
139
|
+
return iframe;
|
75
140
|
};
|
@@ -3,7 +3,6 @@ import type { IappendIframeNodesParams, IcreateComponent } from '../../types';
|
|
3
3
|
import { componentNameEnum } from '../../types';
|
4
4
|
export default class ComponentApp {
|
5
5
|
app: any;
|
6
|
-
paymentMethodsResult: any;
|
7
6
|
appDomain: string;
|
8
7
|
AMSSDK: AMSCheckout;
|
9
8
|
platform: 'desktop' | 'mobile';
|
@@ -34,22 +33,16 @@ export default class ComponentApp {
|
|
34
33
|
* @description render iframe content
|
35
34
|
*/
|
36
35
|
appendIframeNodes(componentName: componentNameEnum, renderParams: IappendIframeNodesParams): Promise<void | [void, any]>;
|
37
|
-
|
36
|
+
/**
|
37
|
+
* @description Interface request
|
38
|
+
*/
|
39
|
+
private createActionQueryPromise;
|
38
40
|
private cleanApp;
|
39
41
|
/**
|
40
42
|
* @description Create app
|
41
43
|
*/
|
42
44
|
private createApp;
|
43
|
-
private
|
44
|
-
/**
|
45
|
-
* @description Create iframe
|
46
|
-
*/
|
47
|
-
private createIframe;
|
48
|
-
/**
|
49
|
-
* @description Get iftame id
|
50
|
-
*/
|
51
|
-
private _getIframeId;
|
52
|
-
private _listener;
|
45
|
+
private listener;
|
53
46
|
/**
|
54
47
|
* @description Initialize subscription iframe message
|
55
48
|
*/
|
@@ -17,13 +17,12 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
17
17
|
* 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.
|
18
18
|
*/
|
19
19
|
/* eslint-disable no-console */
|
20
|
-
import json from "../../../package.json";
|
21
20
|
import { COMPONENTPLUGINID, ERRORMESSAGE, EVENT } from "../../constant";
|
22
21
|
import { queryPaymentInfo } from "../../service";
|
23
22
|
import { componentNameEnum, messageName, Target } from "../../types";
|
24
|
-
import { getDesignFontSize,
|
23
|
+
import { getDesignFontSize, getType, isJsonString, isPC } from "../../util";
|
25
24
|
import { isLocalMock } from "../../util/mock";
|
26
|
-
import { getAppDomain,
|
25
|
+
import { createIframe, getAppDomain, getIframeUrl } from "./cashierApp";
|
27
26
|
import { componentAddCSS } from "./component.style";
|
28
27
|
var amsSetSize = function amsSetSize(event, dom) {
|
29
28
|
try {
|
@@ -48,7 +47,6 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
48
47
|
function ComponentApp() {
|
49
48
|
_classCallCheck(this, ComponentApp);
|
50
49
|
_defineProperty(this, "app", void 0);
|
51
|
-
_defineProperty(this, "paymentMethodsResult", void 0);
|
52
50
|
_defineProperty(this, "appDomain", void 0);
|
53
51
|
_defineProperty(this, "AMSSDK", void 0);
|
54
52
|
_defineProperty(this, "platform", void 0);
|
@@ -62,7 +60,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
62
60
|
_defineProperty(this, "_performanceData", []);
|
63
61
|
_defineProperty(this, "_isInitComponent", void 0);
|
64
62
|
_defineProperty(this, "_clickEventName", void 0);
|
65
|
-
this._appVersion = '1.3.
|
63
|
+
this._appVersion = '1.3.1';
|
66
64
|
this._isInitComponent = false;
|
67
65
|
this._selector = '#ams-component-section';
|
68
66
|
this.createIframeNode = function () {
|
@@ -117,6 +115,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
117
115
|
_this = this;
|
118
116
|
if (this._isInitComponent) return Promise.reject(ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
|
119
117
|
this._isInitComponent = true;
|
118
|
+
this._renderParams = renderParams;
|
119
|
+
this._componentName = componentName;
|
120
120
|
this._performanceData.push({
|
121
121
|
key: 'sdk_create_component',
|
122
122
|
value: Date.now()
|
@@ -131,19 +131,20 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
131
131
|
this.showLoading();
|
132
132
|
}
|
133
133
|
this.showCashier();
|
134
|
-
this._renderParams = renderParams;
|
135
|
-
this._componentName = componentName;
|
136
134
|
this.createApp(renderParams);
|
137
|
-
this.
|
135
|
+
this.createActionQueryPromise();
|
138
136
|
return Promise.all([this.createIframeNode(this, _objectSpread(_objectSpread({}, renderParams), {}, {
|
139
137
|
selector: this._selector
|
140
138
|
})), this._actionQueryPromise]).catch(function () {
|
141
139
|
_this._isInitComponent = false;
|
142
140
|
});
|
143
141
|
}
|
142
|
+
/**
|
143
|
+
* @description Interface request
|
144
|
+
*/
|
144
145
|
}, {
|
145
|
-
key: "
|
146
|
-
value: function
|
146
|
+
key: "createActionQueryPromise",
|
147
|
+
value: function createActionQueryPromise() {
|
147
148
|
var _this2 = this;
|
148
149
|
this._performanceData.push({
|
149
150
|
key: 'sdk_action_query_start',
|
@@ -152,28 +153,25 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
152
153
|
this._actionQueryPromise = new Promise(function (resolve, reject) {
|
153
154
|
var _this2$_renderParams, _this2$_renderParams2, _this2$_renderParams3;
|
154
155
|
var params = {
|
155
|
-
paymentSessionData: _this2._renderParams && ((_this2$_renderParams = _this2._renderParams) === null || _this2$_renderParams === void 0 ? void 0 : _this2$_renderParams.paymentSessionData),
|
156
|
-
paymentSessionConfig: (
|
156
|
+
paymentSessionData: _this2._renderParams && ((_this2$_renderParams = _this2._renderParams) === null || _this2$_renderParams === void 0 ? void 0 : _this2$_renderParams.paymentSessionData) || '',
|
157
|
+
paymentSessionConfig: (_this2$_renderParams2 = _this2._renderParams) === null || _this2$_renderParams2 === void 0 ? void 0 : (_this2$_renderParams3 = _this2$_renderParams2.paymentSessionMetaData) === null || _this2$_renderParams3 === void 0 ? void 0 : _this2$_renderParams3.paymentSessionConfig
|
157
158
|
};
|
158
159
|
if (componentNameEnum.card === _this2._componentName) {
|
159
|
-
var _this2$_renderParams4, _this2$_renderParams5;
|
160
160
|
params.paymentMethodType = 'CARD';
|
161
|
-
params.paymentSessionConfig = ((_this2$_renderParams4 = _this2._renderParams) === null || _this2$_renderParams4 === void 0 ? void 0 : (_this2$_renderParams5 = _this2$_renderParams4.paymentSessionMetaData) === null || _this2$_renderParams5 === void 0 ? void 0 : _this2$_renderParams5.paymentSessionConfig) || {};
|
162
161
|
}
|
163
162
|
if (componentNameEnum.easyPay === _this2._componentName) {
|
164
|
-
var _this2$
|
165
|
-
params.paymentSessionConfig = ((_this2$_renderParams6 = _this2._renderParams) === null || _this2$_renderParams6 === void 0 ? void 0 : (_this2$_renderParams7 = _this2$_renderParams6.paymentSessionMetaData) === null || _this2$_renderParams7 === void 0 ? void 0 : _this2$_renderParams7.paymentSessionConfig) || {};
|
163
|
+
var _this2$_renderParams4;
|
166
164
|
// if EASY_PAY 2.0 , no need to query payment request
|
167
|
-
var
|
168
|
-
|
169
|
-
productSceneVersion =
|
170
|
-
|
171
|
-
productScene =
|
172
|
-
var
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
autoDebitWithToken =
|
165
|
+
var _ref = params.paymentSessionConfig || {},
|
166
|
+
_ref$productSceneVers = _ref.productSceneVersion,
|
167
|
+
productSceneVersion = _ref$productSceneVers === void 0 ? '' : _ref$productSceneVers,
|
168
|
+
_ref$productScene = _ref.productScene,
|
169
|
+
productScene = _ref$productScene === void 0 ? '' : _ref$productScene;
|
170
|
+
var _ref2 = ((_this2$_renderParams4 = _this2._renderParams) === null || _this2$_renderParams4 === void 0 ? void 0 : _this2$_renderParams4.paymentSessionMetaData) || {},
|
171
|
+
_ref2$action = _ref2.action,
|
172
|
+
_ref2$action2 = _ref2$action === void 0 ? {} : _ref2$action,
|
173
|
+
_ref2$action2$autoDeb = _ref2$action2.autoDebitWithToken,
|
174
|
+
autoDebitWithToken = _ref2$action2$autoDeb === void 0 ? false : _ref2$action2$autoDeb;
|
177
175
|
if (productScene === 'EASY_PAY' && productSceneVersion === '2.0' && !autoDebitWithToken) {
|
178
176
|
// make queryResult no data we setAppStateData in antom-web-checkout app,
|
179
177
|
// eslint-disable-next-line no-promise-executor-return
|
@@ -187,8 +185,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
187
185
|
* @description 代扣逻辑处理
|
188
186
|
*/
|
189
187
|
if (componentNameEnum.autoDebit === _this2._componentName) {
|
190
|
-
var _this2$
|
191
|
-
var action = ((_this2$
|
188
|
+
var _this2$_renderParams5, _this2$_renderParams6, _action$web, _action$wap;
|
189
|
+
var action = ((_this2$_renderParams5 = _this2._renderParams) === null || _this2$_renderParams5 === void 0 ? void 0 : (_this2$_renderParams6 = _this2$_renderParams5.paymentSessionMetaData) === null || _this2$_renderParams6 === void 0 ? void 0 : _this2$_renderParams6.action) || {};
|
192
190
|
var signType = (isPC() ? action === null || action === void 0 ? void 0 : (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 ? void 0 : (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType) || '';
|
193
191
|
if (signType === 'SMS') {
|
194
192
|
return resolve({
|
@@ -201,7 +199,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
201
199
|
}
|
202
200
|
}
|
203
201
|
|
204
|
-
//
|
202
|
+
// mock
|
205
203
|
if (isLocalMock()) {
|
206
204
|
return resolve({
|
207
205
|
message: 'sdk no need to make query request'
|
@@ -259,9 +257,26 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
259
257
|
var _renderParams$payment, _renderParams$payment2, _renderParams$payment3;
|
260
258
|
var productSceneVersion = (renderParams === null || renderParams === void 0 ? void 0 : (_renderParams$payment = renderParams.paymentSessionMetaData) === null || _renderParams$payment === void 0 ? void 0 : (_renderParams$payment2 = _renderParams$payment.paymentSessionConfig) === null || _renderParams$payment2 === void 0 ? void 0 : _renderParams$payment2.productSceneVersion) || '';
|
261
259
|
var extendInfo = (renderParams === null || renderParams === void 0 ? void 0 : (_renderParams$payment3 = renderParams.paymentSessionMetaData) === null || _renderParams$payment3 === void 0 ? void 0 : _renderParams$payment3.extendInfo) || '';
|
262
|
-
|
263
|
-
this.
|
264
|
-
|
260
|
+
var environment = this.AMSSDK.options.env.environment;
|
261
|
+
this.appDomain = getAppDomain({
|
262
|
+
environment: environment,
|
263
|
+
appVersion: this._appVersion,
|
264
|
+
componentName: this._componentName,
|
265
|
+
productSceneVersion: productSceneVersion,
|
266
|
+
extendInfo: extendInfo
|
267
|
+
});
|
268
|
+
this.app = createIframe(this.AMSSDK.options.mode);
|
269
|
+
this.app.src = getIframeUrl({
|
270
|
+
componentName: this._componentName,
|
271
|
+
appearance: (renderParams === null || renderParams === void 0 ? void 0 : renderParams.appearance) || {},
|
272
|
+
analytics: this.AMSSDK.options.analytics,
|
273
|
+
productSceneVersion: productSceneVersion,
|
274
|
+
environment: environment,
|
275
|
+
appVersion: this._appVersion,
|
276
|
+
extendInfo: extendInfo,
|
277
|
+
locale: this.AMSSDK.options.locale,
|
278
|
+
instanceId: this.AMSSDK._instanceId
|
279
|
+
});
|
265
280
|
|
266
281
|
// Subscribe to messages from iframe
|
267
282
|
this._addEventListener();
|
@@ -272,76 +287,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
272
287
|
}
|
273
288
|
}
|
274
289
|
}, {
|
275
|
-
key: "
|
276
|
-
value: function
|
277
|
-
var _this$_renderParams, _this$_renderParams$p;
|
278
|
-
var analytics = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
279
|
-
var productSceneVersion = arguments.length > 3 ? arguments[3] : undefined;
|
280
|
-
var path = getAppPath(this.AMSSDK.options.env.environment, this._appVersion, componentName, productSceneVersion, ((_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 ? void 0 : (_this$_renderParams$p = _this$_renderParams.paymentSessionMetaData) === null || _this$_renderParams$p === void 0 ? void 0 : _this$_renderParams$p.extendInfo) || '');
|
281
|
-
var scale = getViewPort('initial-scale') || 1;
|
282
|
-
var _queryParse = queryParse(),
|
283
|
-
_sandbox = _queryParse._sandbox,
|
284
|
-
_light_sandbox = _queryParse._light_sandbox,
|
285
|
-
_queryParse$requestHo = _queryParse.requestHost,
|
286
|
-
requestHost = _queryParse$requestHo === void 0 ? '' : _queryParse$requestHo,
|
287
|
-
_queryParse$groupId = _queryParse.groupId,
|
288
|
-
groupId = _queryParse$groupId === void 0 ? '' : _queryParse$groupId,
|
289
|
-
LOCAL_MOCK = _queryParse.LOCAL_MOCK;
|
290
|
-
var urlParams = Object.assign({
|
291
|
-
locale: this.AMSSDK.options.locale,
|
292
|
-
scale: scale,
|
293
|
-
merchantDomain: window.btoa(getOrigin()),
|
294
|
-
instanceId: this.AMSSDK._instanceId,
|
295
|
-
sandbox: this.AMSSDK.options.env.environment === 'light_sandbox' || _light_sandbox === 'true' ? 'true' : 'false',
|
296
|
-
analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
|
297
|
-
sdkVersion: json.version,
|
298
|
-
refUrl: window.location.href,
|
299
|
-
shadow: this.AMSSDK.options.env.environment === 'sandbox' || _sandbox === 'true' ? 'true' : 'false',
|
300
|
-
requestHost: requestHost,
|
301
|
-
groupId: groupId,
|
302
|
-
LOCAL_MOCK: LOCAL_MOCK
|
303
|
-
}, appearance);
|
304
|
-
var locationSearch = serialize(urlParams);
|
305
|
-
return "".concat(path, "?").concat(locationSearch);
|
306
|
-
}
|
307
|
-
|
308
|
-
/**
|
309
|
-
* @description Create iframe
|
310
|
-
*/
|
311
|
-
}, {
|
312
|
-
key: "createIframe",
|
313
|
-
value: function createIframe() {
|
314
|
-
var iframe = document.createElement('iframe');
|
315
|
-
var iframeId = this._getIframeId(this.AMSSDK.options.mode);
|
316
|
-
iframe.id = iframeId;
|
317
|
-
iframe.style.height = '0px';
|
318
|
-
iframe.style.width = '100%';
|
319
|
-
iframe.style.border = '0';
|
320
|
-
iframe.style.overflow = 'hidden';
|
321
|
-
return iframe;
|
322
|
-
}
|
323
|
-
|
324
|
-
/**
|
325
|
-
* @description Get iftame id
|
326
|
-
*/
|
327
|
-
}, {
|
328
|
-
key: "_getIframeId",
|
329
|
-
value: function _getIframeId(UIMode) {
|
330
|
-
var id = 'checkout-dropin';
|
331
|
-
// eslint-disable-next-line default-case
|
332
|
-
switch (UIMode) {
|
333
|
-
case 'dropin':
|
334
|
-
id = 'checkout-dropin';
|
335
|
-
break;
|
336
|
-
case 'component':
|
337
|
-
id = 'checkout-component';
|
338
|
-
break;
|
339
|
-
}
|
340
|
-
return id;
|
341
|
-
}
|
342
|
-
}, {
|
343
|
-
key: "_listener",
|
344
|
-
value: function _listener(e) {
|
290
|
+
key: "listener",
|
291
|
+
value: function listener(e) {
|
345
292
|
if (e.origin !== this.appDomain) {
|
346
293
|
return;
|
347
294
|
}
|
@@ -364,7 +311,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
364
311
|
}, {
|
365
312
|
key: "_addEventListener",
|
366
313
|
value: function _addEventListener() {
|
367
|
-
window["_ams_sdk_component_listener_".concat(this.AMSSDK._instanceId)] = this.
|
314
|
+
window["_ams_sdk_component_listener_".concat(this.AMSSDK._instanceId)] = this.listener.bind(this);
|
368
315
|
this._removeEventListener();
|
369
316
|
window.addEventListener('message', window["_ams_sdk_component_listener_".concat(this.AMSSDK._instanceId)]);
|
370
317
|
}
|
@@ -537,9 +484,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
537
484
|
}
|
538
485
|
}, {
|
539
486
|
key: "handleDeclareInfo",
|
540
|
-
value: function handleDeclareInfo(
|
541
|
-
var
|
542
|
-
closeDialogData =
|
487
|
+
value: function handleDeclareInfo(_ref3) {
|
488
|
+
var _ref3$closeDialogData = _ref3.closeDialogData,
|
489
|
+
closeDialogData = _ref3$closeDialogData === void 0 ? {} : _ref3$closeDialogData;
|
543
490
|
try {
|
544
491
|
if (closeDialogData) {
|
545
492
|
var retentionTitle = document.getElementById('ams-component-retention-title');
|
@@ -638,7 +585,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
638
585
|
key: "sendRenderEvent",
|
639
586
|
value: function () {
|
640
587
|
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
641
|
-
var _this$
|
588
|
+
var _this$_renderParams, _this$_renderParams2, res;
|
642
589
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
643
590
|
while (1) switch (_context.prev = _context.next) {
|
644
591
|
case 0:
|
@@ -666,8 +613,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
666
613
|
event: 'renderComponent',
|
667
614
|
data: {
|
668
615
|
queryResult: res,
|
669
|
-
sessionResult: (_this$
|
670
|
-
paymentSessionData: (_this$
|
616
|
+
sessionResult: (_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 ? void 0 : _this$_renderParams.paymentSessionMetaData,
|
617
|
+
paymentSessionData: (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.paymentSessionData,
|
671
618
|
heightOfVisible: Math.max(innerHeight, window.innerHeight),
|
672
619
|
envInfo: {
|
673
620
|
screenHeight: screen.height,
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { RequestConfig } from '../types';
|
2
|
-
export declare function queryPaymentInfo(params?:
|
1
|
+
import { CashierSdkActionQueryRequest, RequestConfig } from '../types';
|
2
|
+
export declare function queryPaymentInfo(params?: CashierSdkActionQueryRequest, options?: RequestConfig): Promise<any>;
|
@@ -55,12 +55,13 @@ export interface IcreateComponent {
|
|
55
55
|
export interface IappendIframeNodesParams extends IcreateComponent {
|
56
56
|
paymentSessionMetaData?: IpaymentSessionMetaData;
|
57
57
|
}
|
58
|
+
interface IpaymentSessionConfig {
|
59
|
+
productScene: productSceneEnum;
|
60
|
+
paymentMethodCategoryType: paymentMethodCategoryTypeEnum;
|
61
|
+
productSceneVersion: string;
|
62
|
+
}
|
58
63
|
export interface IpaymentSessionMetaData {
|
59
|
-
paymentSessionConfig?:
|
60
|
-
productScene: productSceneEnum;
|
61
|
-
paymentMethodCategoryType: paymentMethodCategoryTypeEnum;
|
62
|
-
productSceneVersion?: string;
|
63
|
-
};
|
64
|
+
paymentSessionConfig?: IpaymentSessionConfig;
|
64
65
|
moneyView?: any;
|
65
66
|
extendInfo?: string;
|
66
67
|
paymentMethodInfoView?: any;
|
@@ -107,19 +108,19 @@ export interface env {
|
|
107
108
|
terminalType: terminalType;
|
108
109
|
environment: string;
|
109
110
|
}
|
110
|
-
export type callOnError = (state: {
|
111
|
+
export declare type callOnError = (state: {
|
111
112
|
errorMessage: string;
|
112
113
|
errorCode: string;
|
113
114
|
stack?: any;
|
114
115
|
}) => void;
|
115
|
-
export type callonPaymentMethodSelected = (state: {
|
116
|
+
export declare type callonPaymentMethodSelected = (state: {
|
116
117
|
paymentMethodType: string;
|
117
118
|
}) => void;
|
118
|
-
export type callOnSizeChanged = (state: {
|
119
|
+
export declare type callOnSizeChanged = (state: {
|
119
120
|
width: string;
|
120
121
|
height: string;
|
121
122
|
}) => void;
|
122
|
-
export type callOnLog = (msg: string) => void;
|
123
|
+
export declare type callOnLog = (msg: string) => void;
|
123
124
|
export declare enum messageName {
|
124
125
|
SDK_TO_APP = "SDK_TO_APP",
|
125
126
|
APP_TO_SDK = "APP_TO_SDK",
|
@@ -142,7 +143,7 @@ export interface AMSCheckoutOptions {
|
|
142
143
|
mode: string;
|
143
144
|
analytics?: Ianalytics;
|
144
145
|
}
|
145
|
-
interface Ianalytics {
|
146
|
+
export interface Ianalytics {
|
146
147
|
enabled: boolean;
|
147
148
|
}
|
148
149
|
export declare enum ERROR {
|
@@ -175,6 +176,12 @@ export interface RequestConfig {
|
|
175
176
|
locale?: string;
|
176
177
|
hostSign?: string;
|
177
178
|
}
|
179
|
+
export interface CashierSdkActionQueryRequest {
|
180
|
+
paymentSessionData: string;
|
181
|
+
paymentSessionConfig?: IpaymentSessionConfig;
|
182
|
+
paymentMethodType?: string;
|
183
|
+
extParams?: any;
|
184
|
+
}
|
178
185
|
declare global {
|
179
186
|
interface Window {
|
180
187
|
[key: string]: any;
|