@alipay/ams-checkout 0.0.1745808793-dev.2 → 0.0.1745808793-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.
@@ -468,14 +468,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
468
468
  key: "initSecuritySDK",
469
469
  value: function () {
470
470
  var _initSecuritySDK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
471
- var _this$paymentContext$10, _this$paymentContext$11, productSceneVersion, nonCompliant, nonInitSecuritySDK, isFirstTimeToPay, shouldInitSecuritySDK;
471
+ var _this$paymentContext$10, _this$paymentContext$11, _this$paymentContext$12, _this$paymentContext$13, _this$paymentContext$14, _this$paymentContext$15, productSceneVersion, nonInitSecuritySDK, signButtonDisplay, userSignAgreement, isFirstTimeToPay, shouldInitSecuritySDK;
472
472
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
473
473
  while (1) switch (_context5.prev = _context5.next) {
474
474
  case 0:
475
475
  _context5.prev = 0;
476
476
  productSceneVersion = this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion;
477
- nonCompliant = (_this$paymentContext$10 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$10 === void 0 ? void 0 : _this$paymentContext$10.nonCompliant;
478
- nonInitSecuritySDK = (_this$paymentContext$11 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$11 === void 0 ? void 0 : _this$paymentContext$11.nonInitSecuritySDK;
477
+ nonInitSecuritySDK = (_this$paymentContext$10 = (_this$paymentContext$11 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$11 === void 0 ? void 0 : _this$paymentContext$11.nonInitSecuritySDK) !== null && _this$paymentContext$10 !== void 0 ? _this$paymentContext$10 : false;
478
+ signButtonDisplay = (_this$paymentContext$12 = (_this$paymentContext$13 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$13 === void 0 ? void 0 : _this$paymentContext$13.signButtonDisplay) !== null && _this$paymentContext$12 !== void 0 ? _this$paymentContext$12 : false;
479
+ userSignAgreement = (_this$paymentContext$14 = (_this$paymentContext$15 = this.paymentContext.paymentSessionObj.action) === null || _this$paymentContext$15 === void 0 ? void 0 : _this$paymentContext$15.userSignAgreement) !== null && _this$paymentContext$14 !== void 0 ? _this$paymentContext$14 : false;
479
480
  isFirstTimeToPay = !this.paymentContext.paymentSessionObj.action.autoDebitWithToken;
480
481
  shouldInitSecuritySDK = false;
481
482
  if (nonInitSecuritySDK) {
@@ -488,44 +489,38 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
488
489
  // console.log('[web-sdk][security-sdk] DO NOT init security sdk for easypay 1.0');
489
490
  shouldInitSecuritySDK = false;
490
491
  } else if (productSceneVersion === '2.0') {
491
- if (nonCompliant === true) {
492
- // 未切流「隐私合规」
493
- // console.log('[web-sdk][security-sdk] DO init security sdk for easypay 2.0 and nonCompliant is true');
494
- shouldInitSecuritySDK = true;
492
+ if (isFirstTimeToPay) {
493
+ // console.log((signButtonDisplay && userSignAgreement) ? '[web-sdk][security-sdk] DO init security sdk for easypay 2.0, first time to pay and user agreeement signing from merchant' : '[web-sdk][security-sdk] DO NOT init security sdk for easypay 2.0, first time to pay and user agreeement has not been signed from merchant');
494
+ shouldInitSecuritySDK = signButtonDisplay && userSignAgreement;
495
495
  } else {
496
- if (isFirstTimeToPay) {
497
- // console.log('[web-sdk][security-sdk] DO NOT init security sdk for easypay 2.0 and when first time to pay');
498
- shouldInitSecuritySDK = false;
499
- } else {
500
- // 切流「隐私合规」且非首次支付
501
- // console.log('[web-sdk][security-sdk] DO init security sdk for easypay 2.0 and when not first time to pay');
502
- shouldInitSecuritySDK = true;
503
- }
496
+ // 切流「隐私合规」且非首次支付
497
+ // console.log('[web-sdk][security-sdk] DO init security sdk for easypay 2.0 and when not first time to pay');
498
+ shouldInitSecuritySDK = true;
504
499
  }
505
500
  }
506
501
  }
507
502
  if (!shouldInitSecuritySDK) {
508
- _context5.next = 10;
503
+ _context5.next = 11;
509
504
  break;
510
505
  }
511
- _context5.next = 10;
506
+ _context5.next = 11;
512
507
  return this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);
513
- case 10:
508
+ case 11:
514
509
  this.logger.logInfo({
515
510
  title: 'a3753.b101271.c388193.d514078'
516
511
  }, {
517
512
  riskSdkInfo: shouldInitSecuritySDK ? RiskSdkInfoEnum.NEED : RiskSdkInfoEnum.NO_NEED
518
513
  });
519
- _context5.next = 15;
514
+ _context5.next = 16;
520
515
  break;
521
- case 13:
522
- _context5.prev = 13;
516
+ case 14:
517
+ _context5.prev = 14;
523
518
  _context5.t0 = _context5["catch"](0);
524
- case 15:
519
+ case 16:
525
520
  case "end":
526
521
  return _context5.stop();
527
522
  }
528
- }, _callee5, this, [[0, 13]]);
523
+ }, _callee5, this, [[0, 14]]);
529
524
  }));
530
525
  function initSecuritySDK() {
531
526
  return _initSecuritySDK.apply(this, arguments);
@@ -243,6 +243,8 @@ export interface PaymentSessionActionData {
243
243
  requireFastSdk: boolean;
244
244
  nonCompliant?: boolean;
245
245
  nonInitSecuritySDK?: boolean;
246
+ signButtonDisplay?: boolean;
247
+ userSignAgreement?: boolean;
246
248
  skipSdkQueryForm?: {
247
249
  value: boolean;
248
250
  version: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1745808793-dev.2",
3
+ "version": "0.0.1745808793-dev.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",