@alipay/ams-checkout 0.0.1752633195-dev.1 → 0.0.1753090885-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.
@@ -80,7 +80,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
80
80
 
81
81
  // 首次支付
82
82
  isFirstTimeToPay = !autoDebitWithToken; // 处理ESP极速外跳支付场景
83
- if (!(requireFastSdk && isFirstTimeToPay)) {
83
+ if (!(isFirstTimeToPay && requireFastSdk)) {
84
84
  _context.next = 12;
85
85
  break;
86
86
  }
@@ -148,16 +148,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
148
148
  }, {
149
149
  key: "buildRedirectResult",
150
150
  value: function buildRedirectResult(authUrlInfo) {
151
- var _this = this;
152
151
  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
- };
161
152
  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) {
162
153
  data = {
163
154
  url: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
@@ -166,7 +157,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
166
157
  };
167
158
  } else {
168
159
  data = {
169
- url: appendLocaleIntoNormalUrl(authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.normalUrl),
160
+ url: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.normalUrl,
170
161
  schemeUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.schemeUrl,
171
162
  applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.applinkUrl
172
163
  };
@@ -185,15 +176,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
185
176
  }, {
186
177
  key: "sendRequestAndWaitWebLaunch",
187
178
  value: function sendRequestAndWaitWebLaunch() {
188
- var _this2 = this;
179
+ var _this = this;
189
180
  var webLaunchPromise = new Promise(function (resolve, reject) {
190
181
  var t = setTimeout(function () {
191
182
  reject(new Error('Load resource timeout'));
192
- }, _this2.LOAD_APP_RESOURCES_TIMEOUT);
193
- _this2.eventCenter.listen('onLaunch', function (res) {
183
+ }, _this.LOAD_APP_RESOURCES_TIMEOUT);
184
+ _this.eventCenter.listen('onLaunch', function (res) {
194
185
  clearTimeout(t);
195
186
  resolve(res);
196
- _this2.logger.logInfo({
187
+ _this.logger.logInfo({
197
188
  title: 'sdk_event_webAppOnLaunch'
198
189
  });
199
190
  });
@@ -201,25 +192,25 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
201
192
 
202
193
  // 等请求和 Web启动都Ready之后,发送renderComponent
203
194
  Promise.all([this.initSecuritySDK(), this.processQuery(), this.processSubmitPay(), webLaunchPromise]).then(function (_ref) {
204
- var _this2$paymentContext, _this2$paymentContext2, _this2$paymentContext3, _this2$paymentContext4, _this2$paymentContext5, _this2$paymentContext6, _this2$paymentContext7;
195
+ var _this$paymentContext, _this$paymentContext2, _this$paymentContext$, _this$paymentContext$2, _this$paymentContext$3, _this$paymentContext3, _this$paymentContext$4;
205
196
  var _ref2 = _slicedToArray(_ref, 4),
206
197
  _initSecurityRes = _ref2[0],
207
198
  queryRes = _ref2[1],
208
199
  submitRes = _ref2[2],
209
200
  _webLaunchRes = _ref2[3];
210
- var logMetaData = _this2.logger.getLogConfig().mdata;
201
+ var logMetaData = _this.logger.getLogConfig().mdata;
211
202
  var data = {
212
- sessionResult: (_this2$paymentContext = _this2.paymentContext) === null || _this2$paymentContext === void 0 ? void 0 : _this2$paymentContext.paymentSessionObj,
203
+ sessionResult: (_this$paymentContext = _this.paymentContext) === null || _this$paymentContext === void 0 ? void 0 : _this$paymentContext.paymentSessionObj,
213
204
  submitResult: submitRes,
214
- paymentSessionData: (_this2$paymentContext2 = _this2.paymentContext) === null || _this2$paymentContext2 === void 0 ? void 0 : _this2$paymentContext2.paymentSessionId,
205
+ paymentSessionData: (_this$paymentContext2 = _this.paymentContext) === null || _this$paymentContext2 === void 0 ? void 0 : _this$paymentContext2.paymentSessionId,
215
206
  heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
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),
207
+ renderDisplayType: _this.paymentContext.displayInfo.type,
208
+ appearance: (_this$paymentContext$ = _this.paymentContext.displayInfo) === null || _this$paymentContext$ === void 0 ? void 0 : _this$paymentContext$.appearance,
209
+ notRedirectAfterComplete: ((_this$paymentContext$2 = _this.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this$paymentContext$2 === void 0 ? void 0 : _this$paymentContext$2.notRedirectAfterComplete) === true,
210
+ isAppWebview: _this.paymentContext.startBizFlowOptions.isAppWebview,
211
+ merchantAppointParam: (_this$paymentContext$3 = _this.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.merchantAppointParam,
212
+ allowSubmitPayCallAhead: _this.allowSubmitPayCallAhead,
213
+ doubleFaUrl: getDoubleFaUrlFromSession((_this$paymentContext3 = _this.paymentContext) === null || _this$paymentContext3 === void 0 ? void 0 : _this$paymentContext3.paymentSessionObj, _this.initConfig.environment),
223
214
  envInfo: {
224
215
  screenHeight: screen.height,
225
216
  screenWidth: screen.width
@@ -228,7 +219,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
228
219
  trackId: logMetaData.requestSeq,
229
220
  platform: logMetaData.platform,
230
221
  firstLogTime: logMetaData.firstLogTime
231
- }, ((_this2$paymentContext7 = _this2.paymentContext.paymentSessionObj) === null || _this2$paymentContext7 === void 0 ? void 0 : _this2$paymentContext7.paymentSessionConfig) || {}), {}, {
222
+ }, ((_this$paymentContext$4 = _this.paymentContext.paymentSessionObj) === null || _this$paymentContext$4 === void 0 ? void 0 : _this$paymentContext$4.paymentSessionConfig) || {}), {}, {
232
223
  renderDisplayType: logMetaData.renderDisplayType,
233
224
  sdkVersion: logMetaData.sdkVersion,
234
225
  merchantId: logMetaData.merchantId,
@@ -239,16 +230,16 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
239
230
  if (queryRes) {
240
231
  data.queryResult = queryRes;
241
232
  }
242
- _this2.eventCenter.dispatchToApp({
233
+ _this.eventCenter.dispatchToApp({
243
234
  event: 'renderComponent',
244
235
  data: data
245
236
  });
246
- _this2.logger.logInfo({
237
+ _this.logger.logInfo({
247
238
  title: 'sdk_event_renderComponent'
248
239
  });
249
240
  }).catch(function (error) {
250
- _this2.eventCenter.emit(EVENT.destroy.name, {});
251
- _this2.eventCenter.emit(EVENT.eventCallback.name, {
241
+ _this.eventCenter.emit(EVENT.destroy.name, {});
242
+ _this.eventCenter.emit(EVENT.eventCallback.name, {
252
243
  code: eventCodeEnum.SDK_INTERNAL_ERROR,
253
244
  result: {
254
245
  message: error === null || error === void 0 ? void 0 : error.message
@@ -260,18 +251,18 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
260
251
  key: "processQuery",
261
252
  value: function () {
262
253
  var _processQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
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;
254
+ var _this$paymentContext4, _this$paymentContext5, _this$paymentContext6, _this$paymentContext$5, _this$paymentContext7, _this$paymentContext8;
255
+ var queryParams, extendInfo, needAccountConfirmPage, isFirstTimeToPay, needQueryRender, extendInfoData, requestBizId, requester, _this$paymentContext$6, res;
265
256
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
266
257
  while (1) switch (_context2.prev = _context2.next) {
267
258
  case 0:
268
259
  queryParams = {
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
260
+ paymentSessionData: ((_this$paymentContext4 = this.paymentContext) === null || _this$paymentContext4 === void 0 ? void 0 : _this$paymentContext4.paymentSessionId) || '',
261
+ paymentSessionConfig: (_this$paymentContext5 = this.paymentContext) === null || _this$paymentContext5 === void 0 || (_this$paymentContext5 = _this$paymentContext5.paymentSessionObj) === null || _this$paymentContext5 === void 0 ? void 0 : _this$paymentContext5.paymentSessionConfig
271
262
  };
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);
263
+ extendInfo = (_this$paymentContext6 = this.paymentContext) === null || _this$paymentContext6 === void 0 ? void 0 : _this$paymentContext6.paymentSessionObj.extendInfo;
264
+ needAccountConfirmPage = (_this$paymentContext$5 = (_this$paymentContext7 = this.paymentContext) === null || _this$paymentContext7 === void 0 ? void 0 : _this$paymentContext7.paymentSessionObj.needAccountConfirmPage) !== null && _this$paymentContext$5 !== void 0 ? _this$paymentContext$5 : true;
265
+ isFirstTimeToPay = !((_this$paymentContext8 = this.paymentContext) !== null && _this$paymentContext8 !== void 0 && (_this$paymentContext8 = _this$paymentContext8.paymentSessionObj.action) !== null && _this$paymentContext8 !== void 0 && _this$paymentContext8.autoDebitWithToken);
275
266
  needQueryRender = true;
276
267
  try {
277
268
  extendInfoData = JSON.parse(extendInfo);
@@ -299,7 +290,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
299
290
  _context2.t1 = _objectSpread(_objectSpread({}, queryParams), {}, {
300
291
  actionType: 'init',
301
292
  integrationType: 'SDK',
302
- sdkVersion: (_this$paymentContext$2 = this.paymentContext.sdkMetaData.sdkVersion) !== null && _this$paymentContext$2 !== void 0 ? _this$paymentContext$2 : '1.0.0'
293
+ sdkVersion: (_this$paymentContext$6 = this.paymentContext.sdkMetaData.sdkVersion) !== null && _this$paymentContext$6 !== void 0 ? _this$paymentContext$6 : '1.0.0'
303
294
  });
304
295
  _context2.t2 = this.initConfig.environment;
305
296
  _context2.t3 = this.SDK_REQUEST_TIMEOUT;
@@ -358,21 +349,21 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
358
349
  key: "processSubmitPay",
359
350
  value: function () {
360
351
  var _processSubmitPay = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
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;
352
+ var _this$paymentContext9, _this$paymentContext10, _this$paymentContext11, _this$channelBehavior2, _this$channelBehavior3, _this$paymentContext$8, _this$paymentContext12;
353
+ var submitParams, _ref3, _ref3$productSceneVer, productSceneVersion, _ref4, _ref4$action, _ref4$action2, _ref4$action2$enableS, enableSignAgreement, _ref4$action2$autoDeb, autoDebitWithToken, _this$paymentContext$7, paymentMethodType, isAppWebview, backScheme, requestBizId, extParams, requester, _this$paymentContext$9, res;
363
354
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
364
355
  while (1) switch (_context3.prev = _context3.next) {
365
356
  case 0:
366
357
  submitParams = {
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
358
+ paymentSessionData: ((_this$paymentContext9 = this.paymentContext) === null || _this$paymentContext9 === void 0 ? void 0 : _this$paymentContext9.paymentSessionId) || '',
359
+ paymentSessionConfig: (_this$paymentContext10 = this.paymentContext) === null || _this$paymentContext10 === void 0 || (_this$paymentContext10 = _this$paymentContext10.paymentSessionObj) === null || _this$paymentContext10 === void 0 ? void 0 : _this$paymentContext10.paymentSessionConfig
369
360
  };
370
361
  _ref3 = submitParams.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer;
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;
362
+ _ref4 = ((_this$paymentContext11 = this.paymentContext) === null || _this$paymentContext11 === void 0 ? void 0 : _this$paymentContext11.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;
372
363
  if (productSceneVersion === '2.0' && !autoDebitWithToken) {
373
364
  ///EasyPay 2.0 首次传signAgreement字段
374
365
  submitParams['signAgreement'] = enableSignAgreement;
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;
366
+ paymentMethodType = (_this$paymentContext$7 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$7 === void 0 || (_this$paymentContext$7 = _this$paymentContext$7.paymentMethodInfoView) === null || _this$paymentContext$7 === void 0 ? void 0 : _this$paymentContext$7.paymentMethodType;
376
367
  isAppWebview = this.paymentContext.startBizFlowOptions.isAppWebview;
377
368
  if (paymentMethodType == 'ALIPAY_CN' && !isAppWebview) {
378
369
  backScheme = getBackScheme(undefined, this.logger);
@@ -403,12 +394,12 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
403
394
  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, {
404
395
  instanceId: this.instanceId,
405
396
  locale: this.initConfig.locale,
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,
397
+ paymentMethodType: (_this$paymentContext$8 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$8 === void 0 || (_this$paymentContext$8 = _this$paymentContext$8.paymentMethodInfoView) === null || _this$paymentContext$8 === void 0 ? void 0 : _this$paymentContext$8.paymentMethodType,
407
398
  paymentSessionData: this.paymentContext.paymentSessionId,
408
399
  paymentSessionObj: this.paymentContext.paymentSessionObj,
409
400
  env: this.initConfig.environment,
410
401
  sdkVersion: this.paymentContext.sdkMetaData.sdkVersion,
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
402
+ notRedirectAfterComplete: ((_this$paymentContext12 = this.paymentContext) === null || _this$paymentContext12 === void 0 || (_this$paymentContext12 = _this$paymentContext12.startBizFlowOptions) === null || _this$paymentContext12 === void 0 || (_this$paymentContext12 = _this$paymentContext12.submitPayRequestExtra) === null || _this$paymentContext12 === void 0 ? void 0 : _this$paymentContext12.notRedirectAfterComplete) === true
412
403
  })) || {}; // 二次支付不再需要该参数
413
404
  if (!autoDebitWithToken) {
414
405
  extParams.complianceSDK = true;
@@ -419,7 +410,7 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
419
410
  _context3.t0 = requester;
420
411
  _context3.t1 = _objectSpread(_objectSpread({}, submitParams), {}, {
421
412
  integrationType: 'SDK',
422
- sdkVersion: (_this$paymentContext$5 = this.paymentContext.sdkMetaData.sdkVersion) !== null && _this$paymentContext$5 !== void 0 ? _this$paymentContext$5 : '1.0.0'
413
+ sdkVersion: (_this$paymentContext$9 = this.paymentContext.sdkMetaData.sdkVersion) !== null && _this$paymentContext$9 !== void 0 ? _this$paymentContext$9 : '1.0.0'
423
414
  });
424
415
  _context3.t2 = this.initConfig.environment;
425
416
  _context3.t3 = this.SDK_REQUEST_TIMEOUT;
@@ -478,13 +469,13 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
478
469
  key: "acquireApdidToken",
479
470
  value: function () {
480
471
  var _acquireApdidToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
481
- var _this$paymentContext$6;
472
+ var _this$paymentContext$10;
482
473
  var securityService, productScene, deviceId;
483
474
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
484
475
  while (1) switch (_context4.prev = _context4.next) {
485
476
  case 0:
486
477
  securityService = ServiceProvider.getInstance(this.instanceId).getService('Security');
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;
478
+ productScene = (_this$paymentContext$10 = this.paymentContext.paymentSessionObj) === null || _this$paymentContext$10 === void 0 || (_this$paymentContext$10 = _this$paymentContext$10.paymentSessionConfig) === null || _this$paymentContext$10 === void 0 ? void 0 : _this$paymentContext$10.productScene;
488
479
  deviceId = securityService.getDeviceId({
489
480
  productScene: productScene
490
481
  });
@@ -504,15 +495,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
504
495
  key: "initSecuritySDK",
505
496
  value: function () {
506
497
  var _initSecuritySDK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
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;
498
+ var _this$paymentContext$11, _this$paymentContext$12, _this$paymentContext$13, _this$paymentContext$14, _this$paymentContext$15, _this$paymentContext$16, productSceneVersion, nonInitSecuritySDK, signButtonDisplay, userSignAgreement, isFirstTimeToPay, shouldInitSecuritySDK;
508
499
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
509
500
  while (1) switch (_context5.prev = _context5.next) {
510
501
  case 0:
511
502
  _context5.prev = 0;
512
503
  productSceneVersion = this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion;
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;
504
+ nonInitSecuritySDK = (_this$paymentContext$11 = (_this$paymentContext$12 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$12 === void 0 ? void 0 : _this$paymentContext$12.nonInitSecuritySDK) !== null && _this$paymentContext$11 !== void 0 ? _this$paymentContext$11 : false;
505
+ signButtonDisplay = (_this$paymentContext$13 = (_this$paymentContext$14 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$14 === void 0 ? void 0 : _this$paymentContext$14.signButtonDisplay) !== null && _this$paymentContext$13 !== void 0 ? _this$paymentContext$13 : false;
506
+ userSignAgreement = (_this$paymentContext$15 = (_this$paymentContext$16 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$16 === void 0 ? void 0 : _this$paymentContext$16.userSignAgreement) !== null && _this$paymentContext$15 !== void 0 ? _this$paymentContext$15 : false;
516
507
  isFirstTimeToPay = !this.paymentContext.paymentSessionObj.action.autoDebitWithToken;
517
508
  shouldInitSecuritySDK = false;
518
509
  if (nonInitSecuritySDK) {
@@ -13,7 +13,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
13
13
  import axios from 'axios';
14
14
  import { ServiceProvider } from '..';
15
15
  import { errorEnum } from "./deps";
16
- import { appId, device, fomatGetwayError, get, hostSignMap, isPC, lightSandboxMap, queryParse, requestHost, safeJson, sdkVersion, sofaId, tntInstId } from "./deps";
16
+ import { appId, device, fomatGetwayError, get, hostSignMap, lightSandboxMap, queryParse, requestHost, safeJson, sdkVersion, sofaId, tntInstId } from "./deps";
17
17
 
18
18
  /**
19
19
  * @author congle.zzq <congle.zzq@alipay.com>
@@ -149,7 +149,7 @@ export var RequesterService = /*#__PURE__*/function () {
149
149
  value: function getEnvInfo(options) {
150
150
  var _options$envInfo;
151
151
  var envInfo = _objectSpread(_objectSpread({
152
- terminalType: isPC() ? 'WEB' : 'WAP',
152
+ terminalType: device.isMobile ? 'WAP' : 'WEB',
153
153
  browserInfo: {
154
154
  browserJavaScriptEnabled: true,
155
155
  browserLanguage: navigator.language,
@@ -20,7 +20,7 @@ import { sdkVersion } from "../config/index";
20
20
  import { appId, hostSignMap, lightSandboxMap, requestHost, sofaId, tntInstId } from "../config/request";
21
21
  import { errorEnum } from "../types";
22
22
  import { get } from "../util/get";
23
- import { device, isPC, queryParse, safeJson } from "../util";
23
+ import { device, queryParse, safeJson } from "../util";
24
24
  import { fomatGetwayError } from "./utils";
25
25
  var _queryParse = queryParse(),
26
26
  _sandbox = _queryParse._sandbox;
@@ -70,7 +70,7 @@ function _request() {
70
70
  while (1) switch (_context.prev = _context.next) {
71
71
  case 0:
72
72
  envInfo = _objectSpread(_objectSpread({
73
- terminalType: isPC() ? 'WEB' : 'WAP',
73
+ terminalType: device.isMobile ? 'WAP' : 'WEB',
74
74
  browserInfo: {
75
75
  browserJavaScriptEnabled: true,
76
76
  browserLanguage: navigator.language,
@@ -261,7 +261,13 @@ export interface IPaymentSessionMetaData {
261
261
  paymentMethodInfoView?: any;
262
262
  paymentView?: any;
263
263
  action?: PaymentSessionActionData;
264
- authUrlInfo?: IAuthUrlInfo;
264
+ authUrlInfo?: {
265
+ appIdentifier?: string;
266
+ applinkUrl?: string;
267
+ normalUrl?: string;
268
+ schemeUrl?: string;
269
+ authUrl?: string;
270
+ };
265
271
  paymentSessionFactor?: {
266
272
  externalRiskTimeout?: number;
267
273
  extendInfo?: {
@@ -333,14 +339,6 @@ export interface IPaymentSessionMetaData {
333
339
  skipRenderPaymentMethod?: boolean;
334
340
  needAccountConfirmPage?: boolean;
335
341
  }
336
- export interface IAuthUrlInfo {
337
- appIdentifier?: string;
338
- applinkUrl?: string;
339
- normalUrl?: string;
340
- schemeUrl?: string;
341
- authUrl?: string;
342
- needLocale?: boolean;
343
- }
344
342
  export interface IPaymentSessionFactor {
345
343
  merchantInfo?: IMerchantInfo;
346
344
  paymentMethodInfo: IPaymentMethodInfo;
@@ -26,6 +26,7 @@ declare const device: {
26
26
  macOS: boolean;
27
27
  WindowsNT: boolean;
28
28
  isMobile: boolean;
29
+ isOpenHarmonyMobile: boolean;
29
30
  };
30
31
  declare const safeJson: (data: any, obj: any) => any;
31
32
  declare const isPC: () => boolean;
package/esm/util/index.js CHANGED
@@ -148,14 +148,33 @@ var isAndroid = /Android/i.test(UA);
148
148
  var isMacOS = /\bMacintosh\b/.test(UA);
149
149
  var isWindowsNT = /Windows NT/.test(UA);
150
150
  var isMobile = function isMobile() {
151
- return /Android|iPhone|iPad|iPod|Mobile/.test(UA);
151
+ return /Android|iPhone|iPad|iPod|Mobile/.test(UA) || isOpenHarmonyMobile();
152
+ };
153
+ var isOpenHarmony = function isOpenHarmony() {
154
+ // 检查是否为鸿蒙操作系统
155
+ return /OpenHarmony/i.test(navigator.userAgent);
156
+ };
157
+ var isOpenHarmonyMobile = function isOpenHarmonyMobile() {
158
+ // 检查是否为鸿蒙操作系统
159
+ var isHarmonyOS = /OpenHarmony/i.test(navigator.userAgent);
160
+ // 检查是否为手机设备
161
+ var isPhone = /Phone/i.test(navigator.userAgent);
162
+ // 检查是否为平板设备
163
+ var isTablet = /Tablet/i.test(navigator.userAgent);
164
+ // 返回是否为鸿蒙手机或平板
165
+ return isHarmonyOS && (isPhone || isTablet);
166
+ };
167
+ var isOpenHarmonyPC = function isOpenHarmonyPC() {
168
+ // 检查是否为鸿蒙操作系统
169
+ return /OpenHarmony/i.test(navigator.userAgent) && /PC/i.test(navigator.userAgent);
152
170
  };
153
171
  var device = {
154
172
  iOS: isIOS,
155
173
  Android: isAndroid,
156
174
  macOS: isMacOS,
157
175
  WindowsNT: isWindowsNT,
158
- isMobile: !!isMobile()
176
+ isMobile: !!isMobile(),
177
+ isOpenHarmonyMobile: !!isOpenHarmonyMobile()
159
178
  };
160
179
  var safeJson = function safeJson(data, obj) {
161
180
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1752633195-dev.1",
3
+ "version": "0.0.1753090885-dev.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",