@alipay/ams-checkout 0.0.1704122903-dev.1 → 0.0.1704122903-dev.3

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.
@@ -339,7 +339,7 @@ var ComponentApp = /*#__PURE__*/function () {
339
339
  this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
340
340
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
341
341
  var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4;
342
- var envInfo, params, _this5$_renderParams5, _ref3, _ref3$productSceneVer, productSceneVersion, _ref3$productScene, productScene, _ref4, _ref4$action, _ref4$action2, _ref4$action2$autoDeb, autoDebitWithToken, _this5$_renderParams6, _action$web, _action$wap, action, signType;
342
+ var envInfo, params, search, _this5$_renderParams5, _ref3, _ref3$productSceneVer, productSceneVersion, _ref3$productScene, productScene, _ref4, _ref4$action, _ref4$action2, _ref4$action2$autoDeb, autoDebitWithToken, _this5$_renderParams6, _action$web, _action$wap, action, signType;
343
343
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
344
344
  while (1) switch (_context2.prev = _context2.next) {
345
345
  case 0:
@@ -364,7 +364,7 @@ var ComponentApp = /*#__PURE__*/function () {
364
364
  }));
365
365
  case 4:
366
366
  if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
367
- _context2.next = 10;
367
+ _context2.next = 11;
368
368
  break;
369
369
  }
370
370
  params.paymentMethodType = 'CARD';
@@ -372,60 +372,62 @@ var ComponentApp = /*#__PURE__*/function () {
372
372
  return _this5.getDeviceIdAndLog();
373
373
  case 8:
374
374
  envInfo.deviceId = _context2.sent;
375
- if (window.navigator.userAgent.indexOf('miniProgram') > -1) {
375
+ // TODO 加一个后门 判断是否为小程序环境
376
+ search = window.location.search;
377
+ if (window.navigator.userAgent.indexOf('miniProgram') > -1 || search.indexOf('miniProgram') > -1) {
376
378
  envInfo.extendInfo = {
377
379
  WAP_SUB_TYPE: 'WECHAT_MINI_PROGRAM'
378
380
  };
379
381
  }
380
- case 10:
382
+ case 11:
381
383
  if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
382
- _context2.next = 18;
384
+ _context2.next = 19;
383
385
  break;
384
386
  }
385
387
  _ref3 = params.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer, _ref3$productScene = _ref3.productScene, productScene = _ref3$productScene === void 0 ? '' : _ref3$productScene;
386
388
  _ref4 = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.paymentSessionMetaData) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
387
389
  if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken)) {
388
- _context2.next = 15;
390
+ _context2.next = 16;
389
391
  break;
390
392
  }
391
393
  return _context2.abrupt("return", resolve({
392
394
  message: 'sdk no need to make query request',
393
395
  success: true
394
396
  }));
395
- case 15:
396
- _context2.next = 17;
397
+ case 16:
398
+ _context2.next = 18;
397
399
  return _this5.getDeviceIdAndLog();
398
- case 17:
399
- envInfo.deviceId = _context2.sent;
400
400
  case 18:
401
+ envInfo.deviceId = _context2.sent;
402
+ case 19:
401
403
  if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
402
- _context2.next = 28;
404
+ _context2.next = 29;
403
405
  break;
404
406
  }
405
407
  action = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 || (_this5$_renderParams6 = _this5$_renderParams6.paymentSessionMetaData) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.action) || {};
406
408
  signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
407
409
  if (!(signType === 'SMS')) {
408
- _context2.next = 23;
410
+ _context2.next = 24;
409
411
  break;
410
412
  }
411
413
  return _context2.abrupt("return", resolve({
412
414
  message: 'sdk no need to make query request',
413
415
  success: true
414
416
  }));
415
- case 23:
417
+ case 24:
416
418
  if (!(!signType || signType !== 'REDIRECT')) {
417
- _context2.next = 25;
419
+ _context2.next = 26;
418
420
  break;
419
421
  }
420
422
  return _context2.abrupt("return", resolve({
421
423
  success: false
422
424
  }));
423
- case 25:
424
- _context2.next = 27;
425
+ case 26:
426
+ _context2.next = 28;
425
427
  return _this5.getDeviceIdAndLog();
426
- case 27:
427
- envInfo.deviceId = _context2.sent;
428
428
  case 28:
429
+ envInfo.deviceId = _context2.sent;
430
+ case 29:
429
431
  _this5.AMSSDK.logger.logInfo({
430
432
  title: 'sdk_event_sdkQuery'
431
433
  }, {
@@ -461,7 +463,7 @@ var ComponentApp = /*#__PURE__*/function () {
461
463
  paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
462
464
  }).send();
463
465
  });
464
- case 30:
466
+ case 31:
465
467
  case "end":
466
468
  return _context2.stop();
467
469
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@alipay/ams-checkout","version":"0.0.1704122903-dev.1","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","eslint-plugin-prettier":"latest","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}
1
+ {"name":"@alipay/ams-checkout","version":"0.0.1704122903-dev.3","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","eslint-plugin-prettier":"latest","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}