@alipay/ams-checkout 0.0.1762138227-dev.4 → 0.0.1762310209-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/config/index.d.ts +8 -8
- package/esm/config/index.js +8 -8
- package/esm/constant/index.d.ts +0 -3
- package/esm/constant/index.js +0 -3
- package/esm/core/component/element/elementProcessor/addressProcessor.js +3 -2
- package/esm/core/component/element/elementProcessor/authProcessor.js +3 -2
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +1 -1
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +28 -30
- package/esm/foundation/core/index.js +0 -27
- package/esm/foundation/service/container/index.d.ts +0 -1
- package/esm/foundation/service/container/index.js +2 -33
- package/esm/foundation/utils/web_app_url_utils.d.ts +2 -0
- package/esm/foundation/utils/web_app_url_utils.js +15 -10
- package/esm/index.d.ts +52 -13
- package/esm/index.js +339 -19
- package/esm/plugin/component/cashierApp.js +4 -5
- package/esm/util/logger.d.ts +0 -2
- package/esm/util/logger.js +1 -1
- package/package.json +1 -6
- package/esm/constant/auto-debit.d.ts +0 -12
- package/esm/constant/auto-debit.js +0 -15
- package/esm/constant/element.d.ts +0 -26
- package/esm/constant/element.js +0 -30
- package/esm/loader/Proxy.d.ts +0 -5
- package/esm/loader/Proxy.js +0 -345
- package/esm/loader/constant.d.ts +0 -36
- package/esm/loader/constant.js +0 -36
- package/esm/loader/index.d.ts +0 -20
- package/esm/loader/index.js +0 -23
- package/esm/loader/utils/common.d.ts +0 -13
- package/esm/loader/utils/common.js +0 -63
- package/esm/loader/utils/debugger.d.ts +0 -7
- package/esm/loader/utils/debugger.js +0 -15
- package/esm/loader/utils/loadSDK.d.ts +0 -3
- package/esm/loader/utils/loadSDK.js +0 -75
- package/esm/loader/utils/logger.d.ts +0 -10
- package/esm/loader/utils/logger.js +0 -59
- package/esm/main.d.ts +0 -45
- package/esm/main.js +0 -329
- package/esm/util/integrationType.d.ts +0 -21
- package/esm/util/integrationType.js +0 -51
package/esm/config/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export declare const sdkVersion: string;
|
|
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
7
7
|
* TODO 这里考虑直接换成packagejson.version
|
|
8
8
|
*/
|
|
9
|
-
export declare const AMSCheckoutAppVersion = "1.46.
|
|
10
|
-
export declare const AMSAutoDebitAppVersion = "1.46.
|
|
11
|
-
export declare const AMSEasyPayAppVersion = "1.46.
|
|
12
|
-
export declare const AMSCashierPaymentAppVersion = "1.46.
|
|
13
|
-
export declare const AMSVaultingAppVersion = "1.46.
|
|
14
|
-
export declare const AMSPaymentElementAppVersion = "1.46.
|
|
15
|
-
export declare const ADDRESSElementAppVersion = "1.46.
|
|
16
|
-
export declare const AUTHElementAppVersion = "1.46.
|
|
9
|
+
export declare const AMSCheckoutAppVersion = "1.46.1";
|
|
10
|
+
export declare const AMSAutoDebitAppVersion = "1.46.1";
|
|
11
|
+
export declare const AMSEasyPayAppVersion = "1.46.1";
|
|
12
|
+
export declare const AMSCashierPaymentAppVersion = "1.46.1";
|
|
13
|
+
export declare const AMSVaultingAppVersion = "1.46.1";
|
|
14
|
+
export declare const AMSPaymentElementAppVersion = "1.46.1";
|
|
15
|
+
export declare const ADDRESSElementAppVersion = "1.46.1";
|
|
16
|
+
export declare const AUTHElementAppVersion = "1.46.1";
|
package/esm/config/index.js
CHANGED
|
@@ -36,11 +36,11 @@ export var sdkVersion = json.version;
|
|
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
|
37
37
|
* TODO 这里考虑直接换成packagejson.version
|
|
38
38
|
*/
|
|
39
|
-
export var AMSCheckoutAppVersion = '1.46.
|
|
40
|
-
export var AMSAutoDebitAppVersion = '1.46.
|
|
41
|
-
export var AMSEasyPayAppVersion = '1.46.
|
|
42
|
-
export var AMSCashierPaymentAppVersion = '1.46.
|
|
43
|
-
export var AMSVaultingAppVersion = '1.46.
|
|
44
|
-
export var AMSPaymentElementAppVersion = '1.46.
|
|
45
|
-
export var ADDRESSElementAppVersion = '1.46.
|
|
46
|
-
export var AUTHElementAppVersion = '1.46.
|
|
39
|
+
export var AMSCheckoutAppVersion = '1.46.1'; // 兜底版本号
|
|
40
|
+
export var AMSAutoDebitAppVersion = '1.46.1'; // 代扣
|
|
41
|
+
export var AMSEasyPayAppVersion = '1.46.1'; // easypay
|
|
42
|
+
export var AMSCashierPaymentAppVersion = '1.46.1'; // 收银台(卡、apm)
|
|
43
|
+
export var AMSVaultingAppVersion = '1.46.1'; // 绑卡
|
|
44
|
+
export var AMSPaymentElementAppVersion = '1.46.1'; // payment element
|
|
45
|
+
export var ADDRESSElementAppVersion = '1.46.1'; // address element
|
|
46
|
+
export var AUTHElementAppVersion = '1.46.1'; // auth element
|
package/esm/constant/index.d.ts
CHANGED
package/esm/constant/index.js
CHANGED
|
@@ -20,8 +20,8 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
20
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21
21
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
22
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
|
-
import { ELEMENT_PAGE_URL } from "../../../../constant/element";
|
|
24
23
|
import { parseSessionData } from "../..";
|
|
24
|
+
import { ADDRESSElementAppVersion } from "../../../../config";
|
|
25
25
|
import { ProductSceneEnum } from "../../../../types";
|
|
26
26
|
import { generateIframeSrc as _generateIframeSrc } from "../util";
|
|
27
27
|
import BaseElementProcessor from "./baseElementProcessor";
|
|
@@ -95,6 +95,7 @@ var AddressProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
95
95
|
environment = _this$options.env.environment,
|
|
96
96
|
analytics = _this$options.analytics,
|
|
97
97
|
locale = _this$options.locale;
|
|
98
|
+
var pageUrl = "/element-address/".concat(ADDRESSElementAppVersion, "/pages/address/index.html");
|
|
98
99
|
return _generateIframeSrc({
|
|
99
100
|
paymentSession: paymentSession,
|
|
100
101
|
paymentSessionObj: paymentSessionObj,
|
|
@@ -103,7 +104,7 @@ var AddressProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
103
104
|
locale: locale,
|
|
104
105
|
link: link,
|
|
105
106
|
appVersion: sdkMetaData === null || sdkMetaData === void 0 ? void 0 : sdkMetaData.webAppVersion,
|
|
106
|
-
pageUrl:
|
|
107
|
+
pageUrl: pageUrl,
|
|
107
108
|
instanceId: instanceId
|
|
108
109
|
});
|
|
109
110
|
}
|
|
@@ -17,7 +17,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
17
17
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
19
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
-
import {
|
|
20
|
+
import { AUTHElementAppVersion } from "../../../../config";
|
|
21
21
|
import { parseSessionData } from "../../index";
|
|
22
22
|
import { generateIframeSrc as _generateIframeSrc } from "../util";
|
|
23
23
|
import BaseElementProcessor from "./baseElementProcessor";
|
|
@@ -69,6 +69,7 @@ var AuthProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
69
69
|
environment = _this$options.env.environment,
|
|
70
70
|
analytics = _this$options.analytics,
|
|
71
71
|
locale = _this$options.locale;
|
|
72
|
+
var pageUrl = "/auth-element/".concat(AUTHElementAppVersion, "/pages/element_auth/index.html");
|
|
72
73
|
return _generateIframeSrc({
|
|
73
74
|
paymentSession: paymentSession,
|
|
74
75
|
paymentSessionObj: paymentSessionObj,
|
|
@@ -77,7 +78,7 @@ var AuthProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
77
78
|
locale: locale,
|
|
78
79
|
link: link,
|
|
79
80
|
appVersion: sdkMetaData === null || sdkMetaData === void 0 ? void 0 : sdkMetaData.webAppVersion,
|
|
80
|
-
pageUrl:
|
|
81
|
+
pageUrl: pageUrl,
|
|
81
82
|
instanceId: instanceId
|
|
82
83
|
});
|
|
83
84
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogService } from
|
|
1
|
+
import { LogService } from "../../../../foundation/service/log";
|
|
2
2
|
import BaseElementProcessor from './baseElementProcessor';
|
|
3
3
|
declare class PaymentProcessor extends BaseElementProcessor {
|
|
4
4
|
private ApplePayService;
|
|
@@ -23,7 +23,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
23
23
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
25
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
-
import { ELEMENT_PAGE_URL } from "../../../../constant/element";
|
|
27
26
|
import { EVENT } from "../../../../constant";
|
|
28
27
|
import { ServiceProvider } from "../../../../foundation/service";
|
|
29
28
|
import { ApplePaySdk, handleGooglePay, isSkipRenderPaymentMethod } from "../../../../plugin/component/channel";
|
|
@@ -33,16 +32,8 @@ import { parseSessionData } from "../../index";
|
|
|
33
32
|
import { oneAccount, sdkAction } from "../mock";
|
|
34
33
|
import { generateIframeSrc as _generateIframeSrc, isElementPad, isElementPC, safeStringify } from "../util";
|
|
35
34
|
import BaseElementProcessor from "./baseElementProcessor";
|
|
35
|
+
import { AMSPaymentElementAppVersion } from "../../../../config";
|
|
36
36
|
var logger = new Logger(LogConfig, true);
|
|
37
|
-
var isExpressCheckout = function isExpressCheckout(extendInfo) {
|
|
38
|
-
try {
|
|
39
|
-
var _JSON$parse;
|
|
40
|
-
var expressCheckout = JSON.parse((_JSON$parse = JSON.parse(extendInfo)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.expressCheckout);
|
|
41
|
-
return !!expressCheckout;
|
|
42
|
-
} catch (_) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
37
|
var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
47
38
|
_inherits(PaymentProcessor, _BaseElementProcessor);
|
|
48
39
|
var _super = _createSuper(PaymentProcessor);
|
|
@@ -128,7 +119,6 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
128
119
|
});
|
|
129
120
|
});
|
|
130
121
|
});
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
132
122
|
this.eventCenter.listen(EVENT.getApplePayToken.name, function (data) {
|
|
133
123
|
var _this2$elementContain = _this2.elementContainer.getPaymentContext(),
|
|
134
124
|
paymentSessionId = _this2$elementContain.paymentSessionId,
|
|
@@ -161,12 +151,12 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
161
151
|
key: "initApplePaySdk",
|
|
162
152
|
value: function () {
|
|
163
153
|
var _initApplePaySdk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
164
|
-
var _this$
|
|
165
|
-
var
|
|
154
|
+
var _this$elementContaine7;
|
|
155
|
+
var _this$elementContaine6, paymentSessionObj, paymentSessionId;
|
|
166
156
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
167
157
|
while (1) switch (_context.prev = _context.next) {
|
|
168
158
|
case 0:
|
|
169
|
-
|
|
159
|
+
_this$elementContaine6 = (_this$elementContaine7 = this.elementContainer) === null || _this$elementContaine7 === void 0 ? void 0 : _this$elementContaine7.getPaymentContext(), paymentSessionObj = _this$elementContaine6.paymentSessionObj, paymentSessionId = _this$elementContaine6.paymentSessionId;
|
|
170
160
|
if (!isSkipRenderPaymentMethod(paymentSessionObj)) {
|
|
171
161
|
_context.next = 13;
|
|
172
162
|
break;
|
|
@@ -219,20 +209,28 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
219
209
|
}
|
|
220
210
|
}, {
|
|
221
211
|
key: "generateIframeSrc",
|
|
222
|
-
value: function generateIframeSrc(
|
|
223
|
-
var link =
|
|
224
|
-
instanceId =
|
|
212
|
+
value: function generateIframeSrc(_ref) {
|
|
213
|
+
var link = _ref.link,
|
|
214
|
+
instanceId = _ref.instanceId;
|
|
225
215
|
this.instanceId = instanceId;
|
|
226
|
-
var
|
|
227
|
-
paymentSession =
|
|
228
|
-
paymentSessionObj =
|
|
229
|
-
sdkMetaData =
|
|
216
|
+
var _ref2 = this.elementContainer.getPaymentContext() || {},
|
|
217
|
+
paymentSession = _ref2.paymentSession,
|
|
218
|
+
paymentSessionObj = _ref2.paymentSessionObj,
|
|
219
|
+
sdkMetaData = _ref2.sdkMetaData;
|
|
230
220
|
var _this$options = this.options,
|
|
231
221
|
environment = _this$options.env.environment,
|
|
232
222
|
analytics = _this$options.analytics,
|
|
233
223
|
locale = _this$options.locale;
|
|
234
|
-
var
|
|
235
|
-
extendInfo =
|
|
224
|
+
var _ref3 = paymentSessionObj || {},
|
|
225
|
+
extendInfo = _ref3.extendInfo;
|
|
226
|
+
var pageUrl = "/elements/".concat(AMSPaymentElementAppVersion, "/pages/element_payment/index.html");
|
|
227
|
+
try {
|
|
228
|
+
var _JSON$parse;
|
|
229
|
+
var expressCheckout = JSON.parse((_JSON$parse = JSON.parse(extendInfo)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.expressCheckout);
|
|
230
|
+
if (expressCheckout) {
|
|
231
|
+
pageUrl = "/elements/".concat(AMSPaymentElementAppVersion, "/pages/express_checkout/index.html");
|
|
232
|
+
}
|
|
233
|
+
} catch (error) {}
|
|
236
234
|
var url = _generateIframeSrc({
|
|
237
235
|
paymentSession: paymentSession,
|
|
238
236
|
paymentSessionObj: paymentSessionObj,
|
|
@@ -241,7 +239,7 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
241
239
|
locale: locale,
|
|
242
240
|
link: link,
|
|
243
241
|
appVersion: sdkMetaData === null || sdkMetaData === void 0 ? void 0 : sdkMetaData.webAppVersion,
|
|
244
|
-
pageUrl:
|
|
242
|
+
pageUrl: pageUrl,
|
|
245
243
|
instanceId: instanceId
|
|
246
244
|
});
|
|
247
245
|
this.setElementUrl(url);
|
|
@@ -253,16 +251,16 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
253
251
|
var _obtainData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
254
252
|
var _paymentSessionObj$co,
|
|
255
253
|
_this3 = this;
|
|
256
|
-
var requestService, _this$
|
|
254
|
+
var requestService, _this$elementContaine8, paymentSession, paymentSessionObj, displayInfo, _displayInfo, debugProps, _this$options2, environment, locale, _ref4, paymentSessionConfig, hostSign, isConnect, LOCAL_MOCK, _queryParse, appType, terminalType, generateActionQueryPromise, generateOneAccountQueryPromise, _yield$Promise$all, _yield$Promise$all2, originActionQueryResult, originOneAccountQueryResult;
|
|
257
255
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
258
256
|
while (1) switch (_context2.prev = _context2.next) {
|
|
259
257
|
case 0:
|
|
260
258
|
requestService = ServiceProvider.getInstance(this.instanceId).getService('Requester');
|
|
261
|
-
_this$
|
|
259
|
+
_this$elementContaine8 = this.elementContainer.getPaymentContext(), paymentSession = _this$elementContaine8.paymentSession, paymentSessionObj = _this$elementContaine8.paymentSessionObj, displayInfo = _this$elementContaine8.displayInfo;
|
|
262
260
|
_displayInfo = displayInfo;
|
|
263
261
|
debugProps = _displayInfo.debugProps;
|
|
264
262
|
_this$options2 = this.options, environment = _this$options2.env.environment, locale = _this$options2.locale;
|
|
265
|
-
|
|
263
|
+
_ref4 = paymentSessionObj || {}, paymentSessionConfig = _ref4.paymentSessionConfig;
|
|
266
264
|
hostSign = paymentSession.split('&&')[1] || '';
|
|
267
265
|
isConnect = paymentSessionObj === null || paymentSessionObj === void 0 || (_paymentSessionObj$co = paymentSessionObj.connectFactor) === null || _paymentSessionObj$co === void 0 ? void 0 : _paymentSessionObj$co.enableConnect;
|
|
268
266
|
LOCAL_MOCK = (debugProps === null || debugProps === void 0 ? void 0 : debugProps.isDebug) && (debugProps === null || debugProps === void 0 ? void 0 : debugProps.local_mock);
|
|
@@ -394,9 +392,9 @@ var PaymentProcessor = /*#__PURE__*/function (_BaseElementProcessor) {
|
|
|
394
392
|
}
|
|
395
393
|
}, {
|
|
396
394
|
key: "update",
|
|
397
|
-
value: function update(
|
|
398
|
-
var data =
|
|
399
|
-
paymentSessionData =
|
|
395
|
+
value: function update(_ref5) {
|
|
396
|
+
var data = _ref5.data,
|
|
397
|
+
paymentSessionData = _ref5.paymentSessionData;
|
|
400
398
|
var _parseSessionData = parseSessionData(paymentSessionData),
|
|
401
399
|
_parseSessionData2 = _slicedToArray(_parseSessionData, 2),
|
|
402
400
|
parseData = _parseSessionData2[0],
|
|
@@ -22,7 +22,6 @@ import { getGrayscaleId } from "../utils/gray_scale_utils";
|
|
|
22
22
|
import { convertPaymentSession, getWebAppVersion, saveWebAppVersion } from "../utils/payment_context_utils";
|
|
23
23
|
import { redirect } from "../utils/redirect_utils";
|
|
24
24
|
import { parseWebAppMatchConfig } from "../utils/web_app_url_utils";
|
|
25
|
-
|
|
26
25
|
/**
|
|
27
26
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
|
28
27
|
* @date 2024/9/17
|
|
@@ -232,32 +231,6 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
|
232
231
|
_this.eventLogging = data.popWindowEventInfo.eventLogging;
|
|
233
232
|
}
|
|
234
233
|
});
|
|
235
|
-
eventCenter.listen(EVENT.canIUse.name, function (data, payload) {
|
|
236
|
-
var _payload$context5;
|
|
237
|
-
// 前置校验
|
|
238
|
-
var funcName = data === null || data === void 0 ? void 0 : data.funcName;
|
|
239
|
-
if (!funcName || typeof funcName !== 'string') {
|
|
240
|
-
var _payload$context4;
|
|
241
|
-
eventCenter.dispatchToApp({
|
|
242
|
-
event: 'appEventCallback',
|
|
243
|
-
eventCallbackId: (_payload$context4 = payload.context) === null || _payload$context4 === void 0 ? void 0 : _payload$context4.eventCallbackId,
|
|
244
|
-
data: {
|
|
245
|
-
exist: false,
|
|
246
|
-
success: false
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
var exist = eventCenter.isExist(funcName);
|
|
252
|
-
eventCenter.dispatchToApp({
|
|
253
|
-
event: 'appEventCallback',
|
|
254
|
-
eventCallbackId: (_payload$context5 = payload.context) === null || _payload$context5 === void 0 ? void 0 : _payload$context5.eventCallbackId,
|
|
255
|
-
data: {
|
|
256
|
-
exist: exist,
|
|
257
|
-
success: true
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
234
|
|
|
262
235
|
// execute additional logic from specified product
|
|
263
236
|
if (this.productProcessors[sdkMetaData.productScene]) {
|
|
@@ -7,12 +7,12 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
7
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
import { isEmpty } from "../../../util";
|
|
10
11
|
import { addInlineLoading, createInlineBaseElement } from "../../../component/component.inline.style";
|
|
11
12
|
import { addPopupLoading, createBaseElement } from "../../../component/component.popup.style";
|
|
12
13
|
import { insertStyleSheet } from "../../../component/popupWindow.style";
|
|
13
|
-
import {
|
|
14
|
+
import { COMPONENT_CLOSE_BLOCK_ID, COMPONENT_CLOSE_MASK_BLOCK_ID, COMPONENT_CONTAINER_ID, ERRORMESSAGE, EVENT, LOADING_ID, MOCKUP_ID, TIMEOUT_WEB_APP_HEART_BEAT, TIME_DELAY_SEND_HEART_BEAT, closeImg, closeImgLight } from "../../../constant";
|
|
14
15
|
import { DisplayTypeEnum, ProductSceneEnum } from "../../../types";
|
|
15
|
-
import { isEmpty } from "../../../util";
|
|
16
16
|
import { ServiceProvider } from "../index";
|
|
17
17
|
import { PopupManager } from "./popup";
|
|
18
18
|
import { createIframe, startSizeChangeAnim } from "./utils";
|
|
@@ -217,9 +217,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
|
217
217
|
this.eventCenter.listen(EVENT.appHeartBeat.name, function () {
|
|
218
218
|
_this.handleAppHeartBeat();
|
|
219
219
|
});
|
|
220
|
-
this.eventCenter.listen(EVENT.canIUse.name, function (data, payload) {
|
|
221
|
-
_this.handleCanIUse(data, payload);
|
|
222
|
-
});
|
|
223
220
|
/**
|
|
224
221
|
* 目前仅用于ESP V2的 web sdk
|
|
225
222
|
* 原因: 在账户输入页和OTP页面的h5场景下键盘弹起页面会有问题,iframe有固定高度,键盘弹起时应用层不会触发大小变化
|
|
@@ -449,34 +446,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
|
449
446
|
data: data
|
|
450
447
|
});
|
|
451
448
|
}
|
|
452
|
-
}, {
|
|
453
|
-
key: "handleCanIUse",
|
|
454
|
-
value: function handleCanIUse(data, payload) {
|
|
455
|
-
var _payload$context3;
|
|
456
|
-
// 前置校验
|
|
457
|
-
var funcName = data === null || data === void 0 ? void 0 : data.funcName;
|
|
458
|
-
if (!funcName || typeof funcName !== 'string') {
|
|
459
|
-
var _payload$context2;
|
|
460
|
-
this.eventCenter.dispatchToApp({
|
|
461
|
-
event: 'appEventCallback',
|
|
462
|
-
eventCallbackId: (_payload$context2 = payload.context) === null || _payload$context2 === void 0 ? void 0 : _payload$context2.eventCallbackId,
|
|
463
|
-
data: {
|
|
464
|
-
exist: false,
|
|
465
|
-
success: false
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
var exist = this.eventCenter.isExist(funcName);
|
|
471
|
-
this.eventCenter.dispatchToApp({
|
|
472
|
-
event: 'appEventCallback',
|
|
473
|
-
eventCallbackId: (_payload$context3 = payload.context) === null || _payload$context3 === void 0 ? void 0 : _payload$context3.eventCallbackId,
|
|
474
|
-
data: {
|
|
475
|
-
exist: exist,
|
|
476
|
-
success: true
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
449
|
}, {
|
|
481
450
|
key: "getWebApp",
|
|
482
451
|
value: function getWebApp() {
|
|
@@ -108,6 +108,8 @@ export declare const getLocalCheckoutUrl: (productScene: ProductSceneEnum, envir
|
|
|
108
108
|
export declare const defaultCheckoutUrl: (productScene: ProductSceneEnum, environment?: string) => string;
|
|
109
109
|
/**
|
|
110
110
|
* V2应用EasySafePay 热更新兜底URL构建规则
|
|
111
|
+
* 1. 兜底URL版本与sdk版本保持一致
|
|
112
|
+
* 2. DEV环境下html新增版本前缀
|
|
111
113
|
**/
|
|
112
114
|
export declare const getDefaultEasySafePayPageUrl: (pageName: ESP_PAGE_NAME, env: string) => string;
|
|
113
115
|
/**通过sessionData获取doubleFa,于createComponent时传递给WEB应用*/
|
|
@@ -5,7 +5,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { marmotMap, sdkVersion, v2AppMarmotMap } from "../../config";
|
|
8
|
-
import { AUTO_DEBIT_PAGE_URL } from "../../constant/auto-debit";
|
|
9
8
|
import { ESP_PAGE_NAME } from "../../constant/easysafepay";
|
|
10
9
|
import { ComponentSignEnum, ProductSceneEnum } from "../../types";
|
|
11
10
|
import { queryParse, serialize } from "../../util";
|
|
@@ -72,8 +71,11 @@ export var getWebAppUrlInfo = function getWebAppUrlInfo(params) {
|
|
|
72
71
|
export var getWebAppV2Url = function getWebAppV2Url(params) {
|
|
73
72
|
var productScene = params.productScene,
|
|
74
73
|
isPreload = params.isPreload,
|
|
74
|
+
mid = params.mid,
|
|
75
|
+
extendInfo = params.extendInfo,
|
|
75
76
|
environment = params.environment;
|
|
76
|
-
var
|
|
77
|
+
var webAppUrlMatchConfig = parseWebAppUrlMatchConfig(extendInfo);
|
|
78
|
+
var v2Url = isPreload ? getLocalCheckoutUrl(productScene, environment) : getMatchedWebAppV2Url(productScene, mid, webAppUrlMatchConfig, environment);
|
|
77
79
|
var info = getWebAppUrlInfo(_objectSpread(_objectSpread({}, params), {}, {
|
|
78
80
|
v2Url: v2Url
|
|
79
81
|
}));
|
|
@@ -115,14 +117,15 @@ var getAppPath = function getAppPath() {
|
|
|
115
117
|
}
|
|
116
118
|
var validProductSceneVersion = getValidProductSceneVersion(sdkMetaData.productScene, productSceneVersion, paymentMethodCategoryType);
|
|
117
119
|
var productSceneWithPaymentMethodCategoryType = "".concat(sdkMetaData.productScene, "_").concat(paymentMethodCategoryType);
|
|
120
|
+
var webAppVersion = sdkMetaData.webAppVersion;
|
|
118
121
|
if (productSceneWithPaymentMethodCategoryType === ComponentSignEnum.AUTO_DEBIT_APM) {
|
|
119
|
-
return "".concat(v2AppMarmotMap[environment]).concat(
|
|
122
|
+
return "".concat(v2AppMarmotMap[environment], "/auto-debit/").concat(webAppVersion, "/pages/trustly/index.html");
|
|
120
123
|
}
|
|
121
124
|
switch (productScene) {
|
|
122
125
|
case ProductSceneEnum.EASY_PAY:
|
|
123
126
|
return v2Url !== null && v2Url !== void 0 ? v2Url : defaultCheckoutUrl(productScene, environment);
|
|
124
127
|
default:
|
|
125
|
-
return "".concat(marmotMap[environment], "/").concat(productSceneWithPaymentMethodCategoryType, "/").concat(validProductSceneVersion, "/index.html");
|
|
128
|
+
return "".concat(marmotMap[environment], "/").concat(productSceneWithPaymentMethodCategoryType, "/").concat(validProductSceneVersion, "/index.").concat(webAppVersion, ".html");
|
|
126
129
|
}
|
|
127
130
|
};
|
|
128
131
|
export var parseWebAppMatchConfig = function parseWebAppMatchConfig(extendInfo) {
|
|
@@ -287,18 +290,20 @@ export var defaultCheckoutUrl = function defaultCheckoutUrl(productScene) {
|
|
|
287
290
|
|
|
288
291
|
/**
|
|
289
292
|
* V2应用EasySafePay 热更新兜底URL构建规则
|
|
293
|
+
* 1. 兜底URL版本与sdk版本保持一致
|
|
294
|
+
* 2. DEV环境下html新增版本前缀
|
|
290
295
|
**/
|
|
291
296
|
export var getDefaultEasySafePayPageUrl = function getDefaultEasySafePayPageUrl(pageName, env) {
|
|
292
297
|
// 生成的URL EXAMPLE:
|
|
293
298
|
// const DEFAULT_DOUBLE_FA_URL_MAPPING = {
|
|
294
|
-
// local: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index.html',
|
|
295
|
-
// dev: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index.html',
|
|
296
|
-
// sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index.html',
|
|
297
|
-
// pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index.html',
|
|
298
|
-
// prod: 'https://checkout.antom.com/easysafepay/pages/double-fa/index.html',
|
|
299
|
+
// local: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index-1.36.0.html',
|
|
300
|
+
// dev: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index-1.36.0.html',
|
|
301
|
+
// sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index.html',
|
|
302
|
+
// pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index.html',
|
|
303
|
+
// prod: 'https://checkout.antom.com/easysafepay/1.36.0/pages/double-fa/index.html',
|
|
299
304
|
// };
|
|
300
305
|
var environment = env || 'prod';
|
|
301
|
-
return "".concat(v2AppMarmotMap[environment], "/easysafepay/pages/").concat(pageName, "/index.html");
|
|
306
|
+
if (environment === 'dev') return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(sdkVersion, "/pages/").concat(pageName, "/index-").concat(sdkVersion, ".html");else return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(sdkVersion, "/pages/").concat(pageName, "/index.html");
|
|
302
307
|
};
|
|
303
308
|
|
|
304
309
|
/**通过sessionData获取doubleFa,于createComponent时传递给WEB应用*/
|
package/esm/index.d.ts
CHANGED
|
@@ -1,15 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* 通过UMD方式集成SDK, 各产品基类直接导出
|
|
7
|
-
*
|
|
8
|
-
* 详见: https://yuque.antfin.com/antom-sdk/dg6hge/lbun86wg2h3f7es7
|
|
9
|
-
*
|
|
10
|
-
* **/
|
|
11
|
-
import { AMSCheckout } from './main';
|
|
12
|
-
export { AMSEasyPayWrapper as AMSEasyPay, AMSElementWrapper as AMSElement } from './loader/index';
|
|
13
|
-
export { AddressElement, AMSAutoDebit, AMSAutoDebitPay, AMSCashierPayment, AMSCheckout, AMSCheckoutPage, AMSVaulting, AntomElement, } from './main';
|
|
1
|
+
import { AddressComponent } from './core/component/address';
|
|
2
|
+
import { ElementComponent } from './core/component/element';
|
|
3
|
+
import { AMSComponent } from './core/component/index';
|
|
4
|
+
import { ComponentSignEnum, IcreateComponent, IElementOptions, IoptionsAddressParams, IoptionsParams, IPreloadOptions, ValidationResult } from './types';
|
|
5
|
+
export { AMSCheckoutPage } from './core/component/ckp';
|
|
14
6
|
export * from './types';
|
|
7
|
+
export declare class AMSCheckout extends AMSComponent {
|
|
8
|
+
constructor(_options: IoptionsParams, channelType?: ComponentSignEnum[], productSceneVersion?: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class AMSAutoDebitPay extends AMSCheckout {
|
|
11
|
+
constructor(options: IoptionsParams);
|
|
12
|
+
static preload(options?: IPreloadOptions): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class AMSCashierPayment extends AMSCheckout {
|
|
15
|
+
constructor(options: IoptionsParams);
|
|
16
|
+
static preload(options?: IPreloadOptions): void;
|
|
17
|
+
/**
|
|
18
|
+
* Form validation function
|
|
19
|
+
* If the form is currently displayed:
|
|
20
|
+
* - Successful validation: isValid is true
|
|
21
|
+
* - Failed validation: isValid is false, and error messages are displayed on the form page
|
|
22
|
+
* If not on the form display page, isValid returns false
|
|
23
|
+
* @returns {Promise<ValidationResult>} Returns a Promise containing the validation result
|
|
24
|
+
*/
|
|
25
|
+
validateFields(): Promise<ValidationResult>;
|
|
26
|
+
}
|
|
27
|
+
export declare class AMSVaulting extends AMSCheckout {
|
|
28
|
+
constructor(options: IoptionsParams);
|
|
29
|
+
static preload(options?: IPreloadOptions): void;
|
|
30
|
+
}
|
|
31
|
+
export declare class AntomElement extends AMSCheckout {
|
|
32
|
+
constructor(options: IoptionsParams);
|
|
33
|
+
}
|
|
34
|
+
export declare class AddressElement extends AddressComponent {
|
|
35
|
+
constructor(options: IoptionsAddressParams);
|
|
36
|
+
}
|
|
37
|
+
export declare class AMSElement extends ElementComponent {
|
|
38
|
+
constructor(options: IElementOptions);
|
|
39
|
+
}
|
|
40
|
+
export declare class AMSEasyPay {
|
|
41
|
+
private core;
|
|
42
|
+
constructor(options: IoptionsParams);
|
|
43
|
+
static preload(options?: IPreloadOptions): void;
|
|
44
|
+
createComponent(params: IcreateComponent): void;
|
|
45
|
+
unmount(): void;
|
|
46
|
+
}
|
|
47
|
+
export declare class AMSAutoDebit {
|
|
48
|
+
private core;
|
|
49
|
+
constructor(options: IoptionsParams);
|
|
50
|
+
createComponent(params: IcreateComponent): Promise<void>;
|
|
51
|
+
unmount(): void;
|
|
52
|
+
static preload(options?: IPreloadOptions): void;
|
|
53
|
+
}
|
|
15
54
|
export default AMSCheckout;
|