@alipay/ams-checkout 0.0.1752029048-dev.1 → 0.0.1752633195-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/component/popupWindow.style.d.ts +1 -4
- package/esm/component/popupWindow.style.js +1 -33
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +0 -7
- package/esm/constant/index.js +0 -7
- package/esm/core/component/element/elementController/index.js +14 -22
- package/esm/core/component/element/type.d.ts +15 -29
- package/esm/core/component/element/type.js +12 -20
- package/esm/foundation/product-processor/easysafepay/index.js +54 -45
- package/esm/foundation/service/container/index.d.ts +0 -2
- package/esm/foundation/service/container/index.js +19 -42
- package/esm/foundation/service/container/popup.d.ts +6 -9
- package/esm/foundation/service/container/popup.js +1 -3
- package/esm/types/index.d.ts +9 -7
- package/package.json +1 -1
@@ -80,7 +80,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
80
80
|
|
81
81
|
// 首次支付
|
82
82
|
isFirstTimeToPay = !autoDebitWithToken; // 处理ESP极速外跳支付场景
|
83
|
-
if (!(
|
83
|
+
if (!(requireFastSdk && isFirstTimeToPay)) {
|
84
84
|
_context.next = 12;
|
85
85
|
break;
|
86
86
|
}
|
@@ -148,7 +148,16 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
148
148
|
}, {
|
149
149
|
key: "buildRedirectResult",
|
150
150
|
value: function buildRedirectResult(authUrlInfo) {
|
151
|
+
var _this = this;
|
151
152
|
var data;
|
153
|
+
var appendLocaleIntoNormalUrl = function appendLocaleIntoNormalUrl(normalUrl) {
|
154
|
+
if ((authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.needLocale) === true && _this.initConfig.locale) {
|
155
|
+
var url = new URL(normalUrl);
|
156
|
+
url.searchParams.set('locale', _this.initConfig.locale);
|
157
|
+
return url.toString();
|
158
|
+
}
|
159
|
+
return normalUrl;
|
160
|
+
};
|
152
161
|
if (!(authUrlInfo !== null && authUrlInfo !== void 0 && authUrlInfo.normalUrl) && !(authUrlInfo !== null && authUrlInfo !== void 0 && authUrlInfo.schemeUrl) && !(authUrlInfo !== null && authUrlInfo !== void 0 && authUrlInfo.applinkUrl) && authUrlInfo !== null && authUrlInfo !== void 0 && authUrlInfo.authUrl) {
|
153
162
|
data = {
|
154
163
|
url: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
|
@@ -157,7 +166,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
157
166
|
};
|
158
167
|
} else {
|
159
168
|
data = {
|
160
|
-
url: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.normalUrl,
|
169
|
+
url: appendLocaleIntoNormalUrl(authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.normalUrl),
|
161
170
|
schemeUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.schemeUrl,
|
162
171
|
applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.applinkUrl
|
163
172
|
};
|
@@ -176,15 +185,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
176
185
|
}, {
|
177
186
|
key: "sendRequestAndWaitWebLaunch",
|
178
187
|
value: function sendRequestAndWaitWebLaunch() {
|
179
|
-
var
|
188
|
+
var _this2 = this;
|
180
189
|
var webLaunchPromise = new Promise(function (resolve, reject) {
|
181
190
|
var t = setTimeout(function () {
|
182
191
|
reject(new Error('Load resource timeout'));
|
183
|
-
},
|
184
|
-
|
192
|
+
}, _this2.LOAD_APP_RESOURCES_TIMEOUT);
|
193
|
+
_this2.eventCenter.listen('onLaunch', function (res) {
|
185
194
|
clearTimeout(t);
|
186
195
|
resolve(res);
|
187
|
-
|
196
|
+
_this2.logger.logInfo({
|
188
197
|
title: 'sdk_event_webAppOnLaunch'
|
189
198
|
});
|
190
199
|
});
|
@@ -192,25 +201,25 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
192
201
|
|
193
202
|
// 等请求和 Web启动都Ready之后,发送renderComponent
|
194
203
|
Promise.all([this.initSecuritySDK(), this.processQuery(), this.processSubmitPay(), webLaunchPromise]).then(function (_ref) {
|
195
|
-
var
|
204
|
+
var _this2$paymentContext, _this2$paymentContext2, _this2$paymentContext3, _this2$paymentContext4, _this2$paymentContext5, _this2$paymentContext6, _this2$paymentContext7;
|
196
205
|
var _ref2 = _slicedToArray(_ref, 4),
|
197
206
|
_initSecurityRes = _ref2[0],
|
198
207
|
queryRes = _ref2[1],
|
199
208
|
submitRes = _ref2[2],
|
200
209
|
_webLaunchRes = _ref2[3];
|
201
|
-
var logMetaData =
|
210
|
+
var logMetaData = _this2.logger.getLogConfig().mdata;
|
202
211
|
var data = {
|
203
|
-
sessionResult: (
|
212
|
+
sessionResult: (_this2$paymentContext = _this2.paymentContext) === null || _this2$paymentContext === void 0 ? void 0 : _this2$paymentContext.paymentSessionObj,
|
204
213
|
submitResult: submitRes,
|
205
|
-
paymentSessionData: (
|
214
|
+
paymentSessionData: (_this2$paymentContext2 = _this2.paymentContext) === null || _this2$paymentContext2 === void 0 ? void 0 : _this2$paymentContext2.paymentSessionId,
|
206
215
|
heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
|
207
|
-
renderDisplayType:
|
208
|
-
appearance: (
|
209
|
-
notRedirectAfterComplete: ((
|
210
|
-
isAppWebview:
|
211
|
-
merchantAppointParam: (
|
212
|
-
allowSubmitPayCallAhead:
|
213
|
-
doubleFaUrl: getDoubleFaUrlFromSession((
|
216
|
+
renderDisplayType: _this2.paymentContext.displayInfo.type,
|
217
|
+
appearance: (_this2$paymentContext3 = _this2.paymentContext.displayInfo) === null || _this2$paymentContext3 === void 0 ? void 0 : _this2$paymentContext3.appearance,
|
218
|
+
notRedirectAfterComplete: ((_this2$paymentContext4 = _this2.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this2$paymentContext4 === void 0 ? void 0 : _this2$paymentContext4.notRedirectAfterComplete) === true,
|
219
|
+
isAppWebview: _this2.paymentContext.startBizFlowOptions.isAppWebview,
|
220
|
+
merchantAppointParam: (_this2$paymentContext5 = _this2.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this2$paymentContext5 === void 0 ? void 0 : _this2$paymentContext5.merchantAppointParam,
|
221
|
+
allowSubmitPayCallAhead: _this2.allowSubmitPayCallAhead,
|
222
|
+
doubleFaUrl: getDoubleFaUrlFromSession((_this2$paymentContext6 = _this2.paymentContext) === null || _this2$paymentContext6 === void 0 ? void 0 : _this2$paymentContext6.paymentSessionObj, _this2.initConfig.environment),
|
214
223
|
envInfo: {
|
215
224
|
screenHeight: screen.height,
|
216
225
|
screenWidth: screen.width
|
@@ -219,7 +228,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
219
228
|
trackId: logMetaData.requestSeq,
|
220
229
|
platform: logMetaData.platform,
|
221
230
|
firstLogTime: logMetaData.firstLogTime
|
222
|
-
}, ((
|
231
|
+
}, ((_this2$paymentContext7 = _this2.paymentContext.paymentSessionObj) === null || _this2$paymentContext7 === void 0 ? void 0 : _this2$paymentContext7.paymentSessionConfig) || {}), {}, {
|
223
232
|
renderDisplayType: logMetaData.renderDisplayType,
|
224
233
|
sdkVersion: logMetaData.sdkVersion,
|
225
234
|
merchantId: logMetaData.merchantId,
|
@@ -230,16 +239,16 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
230
239
|
if (queryRes) {
|
231
240
|
data.queryResult = queryRes;
|
232
241
|
}
|
233
|
-
|
242
|
+
_this2.eventCenter.dispatchToApp({
|
234
243
|
event: 'renderComponent',
|
235
244
|
data: data
|
236
245
|
});
|
237
|
-
|
246
|
+
_this2.logger.logInfo({
|
238
247
|
title: 'sdk_event_renderComponent'
|
239
248
|
});
|
240
249
|
}).catch(function (error) {
|
241
|
-
|
242
|
-
|
250
|
+
_this2.eventCenter.emit(EVENT.destroy.name, {});
|
251
|
+
_this2.eventCenter.emit(EVENT.eventCallback.name, {
|
243
252
|
code: eventCodeEnum.SDK_INTERNAL_ERROR,
|
244
253
|
result: {
|
245
254
|
message: error === null || error === void 0 ? void 0 : error.message
|
@@ -251,18 +260,18 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
251
260
|
key: "processQuery",
|
252
261
|
value: function () {
|
253
262
|
var _processQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
254
|
-
var _this$
|
255
|
-
var queryParams, extendInfo, needAccountConfirmPage, isFirstTimeToPay, needQueryRender, extendInfoData, requestBizId, requester, _this$paymentContext$
|
263
|
+
var _this$paymentContext, _this$paymentContext2, _this$paymentContext3, _this$paymentContext$, _this$paymentContext4, _this$paymentContext5;
|
264
|
+
var queryParams, extendInfo, needAccountConfirmPage, isFirstTimeToPay, needQueryRender, extendInfoData, requestBizId, requester, _this$paymentContext$2, res;
|
256
265
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
257
266
|
while (1) switch (_context2.prev = _context2.next) {
|
258
267
|
case 0:
|
259
268
|
queryParams = {
|
260
|
-
paymentSessionData: ((_this$
|
261
|
-
paymentSessionConfig: (_this$
|
269
|
+
paymentSessionData: ((_this$paymentContext = this.paymentContext) === null || _this$paymentContext === void 0 ? void 0 : _this$paymentContext.paymentSessionId) || '',
|
270
|
+
paymentSessionConfig: (_this$paymentContext2 = this.paymentContext) === null || _this$paymentContext2 === void 0 || (_this$paymentContext2 = _this$paymentContext2.paymentSessionObj) === null || _this$paymentContext2 === void 0 ? void 0 : _this$paymentContext2.paymentSessionConfig
|
262
271
|
};
|
263
|
-
extendInfo = (_this$
|
264
|
-
needAccountConfirmPage = (_this$paymentContext$
|
265
|
-
isFirstTimeToPay = !((_this$
|
272
|
+
extendInfo = (_this$paymentContext3 = this.paymentContext) === null || _this$paymentContext3 === void 0 ? void 0 : _this$paymentContext3.paymentSessionObj.extendInfo;
|
273
|
+
needAccountConfirmPage = (_this$paymentContext$ = (_this$paymentContext4 = this.paymentContext) === null || _this$paymentContext4 === void 0 ? void 0 : _this$paymentContext4.paymentSessionObj.needAccountConfirmPage) !== null && _this$paymentContext$ !== void 0 ? _this$paymentContext$ : true;
|
274
|
+
isFirstTimeToPay = !((_this$paymentContext5 = this.paymentContext) !== null && _this$paymentContext5 !== void 0 && (_this$paymentContext5 = _this$paymentContext5.paymentSessionObj.action) !== null && _this$paymentContext5 !== void 0 && _this$paymentContext5.autoDebitWithToken);
|
266
275
|
needQueryRender = true;
|
267
276
|
try {
|
268
277
|
extendInfoData = JSON.parse(extendInfo);
|
@@ -290,7 +299,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
290
299
|
_context2.t1 = _objectSpread(_objectSpread({}, queryParams), {}, {
|
291
300
|
actionType: 'init',
|
292
301
|
integrationType: 'SDK',
|
293
|
-
sdkVersion: (_this$paymentContext$
|
302
|
+
sdkVersion: (_this$paymentContext$2 = this.paymentContext.sdkMetaData.sdkVersion) !== null && _this$paymentContext$2 !== void 0 ? _this$paymentContext$2 : '1.0.0'
|
294
303
|
});
|
295
304
|
_context2.t2 = this.initConfig.environment;
|
296
305
|
_context2.t3 = this.SDK_REQUEST_TIMEOUT;
|
@@ -349,21 +358,21 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
349
358
|
key: "processSubmitPay",
|
350
359
|
value: function () {
|
351
360
|
var _processSubmitPay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
352
|
-
var _this$
|
353
|
-
var submitParams, _ref3, _ref3$productSceneVer, productSceneVersion, _ref4, _ref4$action, _ref4$action2, _ref4$action2$enableS, enableSignAgreement, _ref4$action2$autoDeb, autoDebitWithToken, _this$paymentContext$
|
361
|
+
var _this$paymentContext6, _this$paymentContext7, _this$paymentContext8, _this$channelBehavior2, _this$channelBehavior3, _this$paymentContext$4, _this$paymentContext9;
|
362
|
+
var submitParams, _ref3, _ref3$productSceneVer, productSceneVersion, _ref4, _ref4$action, _ref4$action2, _ref4$action2$enableS, enableSignAgreement, _ref4$action2$autoDeb, autoDebitWithToken, _this$paymentContext$3, paymentMethodType, isAppWebview, backScheme, requestBizId, extParams, requester, _this$paymentContext$5, res;
|
354
363
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
355
364
|
while (1) switch (_context3.prev = _context3.next) {
|
356
365
|
case 0:
|
357
366
|
submitParams = {
|
358
|
-
paymentSessionData: ((_this$
|
359
|
-
paymentSessionConfig: (_this$
|
367
|
+
paymentSessionData: ((_this$paymentContext6 = this.paymentContext) === null || _this$paymentContext6 === void 0 ? void 0 : _this$paymentContext6.paymentSessionId) || '',
|
368
|
+
paymentSessionConfig: (_this$paymentContext7 = this.paymentContext) === null || _this$paymentContext7 === void 0 || (_this$paymentContext7 = _this$paymentContext7.paymentSessionObj) === null || _this$paymentContext7 === void 0 ? void 0 : _this$paymentContext7.paymentSessionConfig
|
360
369
|
};
|
361
370
|
_ref3 = submitParams.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer;
|
362
|
-
_ref4 = ((_this$
|
371
|
+
_ref4 = ((_this$paymentContext8 = this.paymentContext) === null || _this$paymentContext8 === void 0 ? void 0 : _this$paymentContext8.paymentSessionObj) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$enableS = _ref4$action2.enableSignAgreement, enableSignAgreement = _ref4$action2$enableS === void 0 ? false : _ref4$action2$enableS, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
|
363
372
|
if (productSceneVersion === '2.0' && !autoDebitWithToken) {
|
364
373
|
///EasyPay 2.0 首次传signAgreement字段
|
365
374
|
submitParams['signAgreement'] = enableSignAgreement;
|
366
|
-
paymentMethodType = (_this$paymentContext$
|
375
|
+
paymentMethodType = (_this$paymentContext$3 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$3 === void 0 || (_this$paymentContext$3 = _this$paymentContext$3.paymentMethodInfoView) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.paymentMethodType;
|
367
376
|
isAppWebview = this.paymentContext.startBizFlowOptions.isAppWebview;
|
368
377
|
if (paymentMethodType == 'ALIPAY_CN' && !isAppWebview) {
|
369
378
|
backScheme = getBackScheme(undefined, this.logger);
|
@@ -394,12 +403,12 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
394
403
|
extParams = ((_this$channelBehavior2 = this.channelBehavior) === null || _this$channelBehavior2 === void 0 || (_this$channelBehavior3 = _this$channelBehavior2.buildSubmitPayExtParams) === null || _this$channelBehavior3 === void 0 ? void 0 : _this$channelBehavior3.call(_this$channelBehavior2, {
|
395
404
|
instanceId: this.instanceId,
|
396
405
|
locale: this.initConfig.locale,
|
397
|
-
paymentMethodType: (_this$paymentContext$
|
406
|
+
paymentMethodType: (_this$paymentContext$4 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$4 === void 0 || (_this$paymentContext$4 = _this$paymentContext$4.paymentMethodInfoView) === null || _this$paymentContext$4 === void 0 ? void 0 : _this$paymentContext$4.paymentMethodType,
|
398
407
|
paymentSessionData: this.paymentContext.paymentSessionId,
|
399
408
|
paymentSessionObj: this.paymentContext.paymentSessionObj,
|
400
409
|
env: this.initConfig.environment,
|
401
410
|
sdkVersion: this.paymentContext.sdkMetaData.sdkVersion,
|
402
|
-
notRedirectAfterComplete: ((_this$
|
411
|
+
notRedirectAfterComplete: ((_this$paymentContext9 = this.paymentContext) === null || _this$paymentContext9 === void 0 || (_this$paymentContext9 = _this$paymentContext9.startBizFlowOptions) === null || _this$paymentContext9 === void 0 || (_this$paymentContext9 = _this$paymentContext9.submitPayRequestExtra) === null || _this$paymentContext9 === void 0 ? void 0 : _this$paymentContext9.notRedirectAfterComplete) === true
|
403
412
|
})) || {}; // 二次支付不再需要该参数
|
404
413
|
if (!autoDebitWithToken) {
|
405
414
|
extParams.complianceSDK = true;
|
@@ -410,7 +419,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
410
419
|
_context3.t0 = requester;
|
411
420
|
_context3.t1 = _objectSpread(_objectSpread({}, submitParams), {}, {
|
412
421
|
integrationType: 'SDK',
|
413
|
-
sdkVersion: (_this$paymentContext$
|
422
|
+
sdkVersion: (_this$paymentContext$5 = this.paymentContext.sdkMetaData.sdkVersion) !== null && _this$paymentContext$5 !== void 0 ? _this$paymentContext$5 : '1.0.0'
|
414
423
|
});
|
415
424
|
_context3.t2 = this.initConfig.environment;
|
416
425
|
_context3.t3 = this.SDK_REQUEST_TIMEOUT;
|
@@ -469,13 +478,13 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
469
478
|
key: "acquireApdidToken",
|
470
479
|
value: function () {
|
471
480
|
var _acquireApdidToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
472
|
-
var _this$paymentContext$
|
481
|
+
var _this$paymentContext$6;
|
473
482
|
var securityService, productScene, deviceId;
|
474
483
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
475
484
|
while (1) switch (_context4.prev = _context4.next) {
|
476
485
|
case 0:
|
477
486
|
securityService = ServiceProvider.getInstance(this.instanceId).getService('Security');
|
478
|
-
productScene = (_this$paymentContext$
|
487
|
+
productScene = (_this$paymentContext$6 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$6 === void 0 || (_this$paymentContext$6 = _this$paymentContext$6.paymentSessionConfig) === null || _this$paymentContext$6 === void 0 ? void 0 : _this$paymentContext$6.productScene;
|
479
488
|
deviceId = securityService.getDeviceId({
|
480
489
|
productScene: productScene
|
481
490
|
});
|
@@ -495,15 +504,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
495
504
|
key: "initSecuritySDK",
|
496
505
|
value: function () {
|
497
506
|
var _initSecuritySDK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
498
|
-
var _this$paymentContext$
|
507
|
+
var _this$paymentContext$7, _this$paymentContext$8, _this$paymentContext$9, _this$paymentContext$10, _this$paymentContext$11, _this$paymentContext$12, productSceneVersion, nonInitSecuritySDK, signButtonDisplay, userSignAgreement, isFirstTimeToPay, shouldInitSecuritySDK;
|
499
508
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
500
509
|
while (1) switch (_context5.prev = _context5.next) {
|
501
510
|
case 0:
|
502
511
|
_context5.prev = 0;
|
503
512
|
productSceneVersion = this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion;
|
504
|
-
nonInitSecuritySDK = (_this$paymentContext$
|
505
|
-
signButtonDisplay = (_this$paymentContext$
|
506
|
-
userSignAgreement = (_this$paymentContext$
|
513
|
+
nonInitSecuritySDK = (_this$paymentContext$7 = (_this$paymentContext$8 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$8 === void 0 ? void 0 : _this$paymentContext$8.nonInitSecuritySDK) !== null && _this$paymentContext$7 !== void 0 ? _this$paymentContext$7 : false;
|
514
|
+
signButtonDisplay = (_this$paymentContext$9 = (_this$paymentContext$10 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$10 === void 0 ? void 0 : _this$paymentContext$10.signButtonDisplay) !== null && _this$paymentContext$9 !== void 0 ? _this$paymentContext$9 : false;
|
515
|
+
userSignAgreement = (_this$paymentContext$11 = (_this$paymentContext$12 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$12 === void 0 ? void 0 : _this$paymentContext$12.userSignAgreement) !== null && _this$paymentContext$11 !== void 0 ? _this$paymentContext$11 : false;
|
507
516
|
isFirstTimeToPay = !this.paymentContext.paymentSessionObj.action.autoDebitWithToken;
|
508
517
|
shouldInitSecuritySDK = false;
|
509
518
|
if (nonInitSecuritySDK) {
|
@@ -35,7 +35,5 @@ export declare class ContainerService implements Service {
|
|
35
35
|
private changeCloseBtnVisibility;
|
36
36
|
private handleMaskCloseBtnShow;
|
37
37
|
private handleCloseButtonTheme;
|
38
|
-
private handlePopupWindow;
|
39
|
-
private handlePopWindow;
|
40
38
|
getWebApp(): HTMLIFrameElement;
|
41
39
|
}
|
@@ -195,7 +195,19 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
195
195
|
});
|
196
196
|
});
|
197
197
|
this.eventCenter.listen(EVENT.popupWindow.name, function (data) {
|
198
|
-
_this
|
198
|
+
var _this$displayInfo2;
|
199
|
+
if (data.paymentElementOldModel) return;
|
200
|
+
insertStyleSheet();
|
201
|
+
_this.popupManager.popup(_objectSpread({
|
202
|
+
platform: (_this$displayInfo2 = _this.displayInfo) === null || _this$displayInfo2 === void 0 ? void 0 : _this$displayInfo2.platform
|
203
|
+
}, data)).then(function () {
|
204
|
+
_this.eventCenter.addIFrame(_this.popupManager.popupApp);
|
205
|
+
}).catch(function (error) {
|
206
|
+
_this.logService.logError({
|
207
|
+
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
208
|
+
}, error);
|
209
|
+
_this.eventCenter.emit(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
210
|
+
});
|
199
211
|
});
|
200
212
|
this.eventCenter.listen(EVENT.popWindow.name, function () {
|
201
213
|
_this.popupManager.pop();
|
@@ -254,9 +266,9 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
254
266
|
}, {
|
255
267
|
key: "handleSizeChanged",
|
256
268
|
value: function handleSizeChanged(data) {
|
257
|
-
var _this$
|
258
|
-
appendAliasContainerId = _this$
|
259
|
-
selector = _this$
|
269
|
+
var _this$displayInfo3 = this.displayInfo,
|
270
|
+
appendAliasContainerId = _this$displayInfo3.appendAliasContainerId,
|
271
|
+
selector = _this$displayInfo3.selector;
|
260
272
|
var cashierId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat((selector === null || selector === void 0 ? void 0 : selector.indexOf('#')) === -1 ? selector : selector.slice(1)) : COMPONENT_CONTAINER_ID;
|
261
273
|
if (!this.webApp || !this.displayInfo) {
|
262
274
|
return;
|
@@ -317,9 +329,9 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
317
329
|
key: "focusScrollFixed",
|
318
330
|
value: function focusScrollFixed(focus) {
|
319
331
|
// 获取iframe dom元素
|
320
|
-
var _this$
|
321
|
-
appendAliasContainerId = _this$
|
322
|
-
selector = _this$
|
332
|
+
var _this$displayInfo4 = this.displayInfo,
|
333
|
+
appendAliasContainerId = _this$displayInfo4.appendAliasContainerId,
|
334
|
+
selector = _this$displayInfo4.selector;
|
323
335
|
var cashierId = appendAliasContainerId ? "".concat(COMPONENT_CONTAINER_ID, "-").concat((selector === null || selector === void 0 ? void 0 : selector.indexOf('#')) === -1 ? selector : selector.slice(1)) : COMPONENT_CONTAINER_ID;
|
324
336
|
if (!this.webApp || !this.displayInfo) {
|
325
337
|
return;
|
@@ -410,41 +422,6 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
410
422
|
maskCloseBlock === null || maskCloseBlock === void 0 || maskCloseBlock.classList.remove("".concat(COMPONENT_CLOSE_MASK_BLOCK_ID, "-light"));
|
411
423
|
}
|
412
424
|
}
|
413
|
-
|
414
|
-
// SDK主动打开弹框
|
415
|
-
}, {
|
416
|
-
key: "handlePopupWindow",
|
417
|
-
value: function handlePopupWindow(data) {
|
418
|
-
var _this$displayInfo4,
|
419
|
-
_this3 = this;
|
420
|
-
if (data.paymentElementOldModel) return;
|
421
|
-
insertStyleSheet();
|
422
|
-
this.popupManager.popup(_objectSpread({
|
423
|
-
platform: (_this$displayInfo4 = this.displayInfo) === null || _this$displayInfo4 === void 0 ? void 0 : _this$displayInfo4.platform,
|
424
|
-
showCloseOnLoading: data.showCloseOnLoading,
|
425
|
-
onCloseOnLoading: function onCloseOnLoading() {
|
426
|
-
return _this3.handlePopWindow(data);
|
427
|
-
}
|
428
|
-
}, data)).then(function () {
|
429
|
-
_this3.eventCenter.addIFrame(_this3.popupManager.popupApp);
|
430
|
-
}).catch(function (error) {
|
431
|
-
_this3.logService.logError({
|
432
|
-
title: (error === null || error === void 0 ? void 0 : error.title) || 'sdk_error_create_pop_up'
|
433
|
-
}, error);
|
434
|
-
_this3.eventCenter.emit(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);
|
435
|
-
});
|
436
|
-
}
|
437
|
-
|
438
|
-
// SDK主动关闭弹框
|
439
|
-
}, {
|
440
|
-
key: "handlePopWindow",
|
441
|
-
value: function handlePopWindow(data) {
|
442
|
-
this.popupManager.pop();
|
443
|
-
this.eventCenter.dispatchToApp({
|
444
|
-
event: EVENT.popWindow.name,
|
445
|
-
data: data
|
446
|
-
});
|
447
|
-
}
|
448
425
|
}, {
|
449
426
|
key: "getWebApp",
|
450
427
|
value: function getWebApp() {
|
@@ -1,12 +1,4 @@
|
|
1
1
|
import { PlatformEnum } from '../../../types';
|
2
|
-
export type IPopUpParams = {
|
3
|
-
url: string;
|
4
|
-
widthPadding: number;
|
5
|
-
heightPadding: number;
|
6
|
-
platform: PlatformEnum;
|
7
|
-
showCloseOnLoading: boolean;
|
8
|
-
onCloseOnLoading: () => void;
|
9
|
-
};
|
10
2
|
/**
|
11
3
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
12
4
|
* @date 2024/9/22
|
@@ -15,6 +7,11 @@ export declare class PopupManager {
|
|
15
7
|
private popupUrlQuery;
|
16
8
|
popupApp: HTMLIFrameElement;
|
17
9
|
setPopupUrlQuery(queryParams: string): void;
|
18
|
-
popup(data:
|
10
|
+
popup(data: {
|
11
|
+
url: string;
|
12
|
+
widthPadding: number;
|
13
|
+
heightPadding: number;
|
14
|
+
platform: PlatformEnum;
|
15
|
+
}): Promise<void>;
|
19
16
|
pop(): void;
|
20
17
|
}
|
@@ -53,9 +53,7 @@ export var PopupManager = /*#__PURE__*/function () {
|
|
53
53
|
widthPadding: data === null || data === void 0 ? void 0 : data.widthPadding,
|
54
54
|
device: data === null || data === void 0 ? void 0 : data.platform,
|
55
55
|
url: pageUrl,
|
56
|
-
loadingConfig: undefined
|
57
|
-
showCloseOnLoading: data.showCloseOnLoading,
|
58
|
-
onCloseOnLoading: data.onCloseOnLoading
|
56
|
+
loadingConfig: undefined
|
59
57
|
});
|
60
58
|
case 11:
|
61
59
|
this.popupApp = _context.sent;
|
package/esm/types/index.d.ts
CHANGED
@@ -261,13 +261,7 @@ export interface IPaymentSessionMetaData {
|
|
261
261
|
paymentMethodInfoView?: any;
|
262
262
|
paymentView?: any;
|
263
263
|
action?: PaymentSessionActionData;
|
264
|
-
authUrlInfo?:
|
265
|
-
appIdentifier?: string;
|
266
|
-
applinkUrl?: string;
|
267
|
-
normalUrl?: string;
|
268
|
-
schemeUrl?: string;
|
269
|
-
authUrl?: string;
|
270
|
-
};
|
264
|
+
authUrlInfo?: IAuthUrlInfo;
|
271
265
|
paymentSessionFactor?: {
|
272
266
|
externalRiskTimeout?: number;
|
273
267
|
extendInfo?: {
|
@@ -339,6 +333,14 @@ export interface IPaymentSessionMetaData {
|
|
339
333
|
skipRenderPaymentMethod?: boolean;
|
340
334
|
needAccountConfirmPage?: boolean;
|
341
335
|
}
|
336
|
+
export interface IAuthUrlInfo {
|
337
|
+
appIdentifier?: string;
|
338
|
+
applinkUrl?: string;
|
339
|
+
normalUrl?: string;
|
340
|
+
schemeUrl?: string;
|
341
|
+
authUrl?: string;
|
342
|
+
needLocale?: boolean;
|
343
|
+
}
|
342
344
|
export interface IPaymentSessionFactor {
|
343
345
|
merchantInfo?: IMerchantInfo;
|
344
346
|
paymentMethodInfo: IPaymentMethodInfo;
|