@alipay/ams-checkout 0.0.1745808793-dev.2 → 0.0.1745808793-dev.4

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.
@@ -196,37 +196,40 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
196
196
  submitRes = _ref2[2],
197
197
  _webLaunchRes = _ref2[3];
198
198
  var logMetaData = _this.logger.getLogConfig().mdata;
199
+ var data = {
200
+ sessionResult: (_this$paymentContext = _this.paymentContext) === null || _this$paymentContext === void 0 ? void 0 : _this$paymentContext.paymentSessionObj,
201
+ submitResult: submitRes,
202
+ paymentSessionData: (_this$paymentContext2 = _this.paymentContext) === null || _this$paymentContext2 === void 0 ? void 0 : _this$paymentContext2.paymentSessionId,
203
+ heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
204
+ renderDisplayType: _this.paymentContext.displayInfo.type,
205
+ appearance: (_this$paymentContext$ = _this.paymentContext.displayInfo) === null || _this$paymentContext$ === void 0 ? void 0 : _this$paymentContext$.appearance,
206
+ notRedirectAfterComplete: ((_this$paymentContext$2 = _this.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this$paymentContext$2 === void 0 ? void 0 : _this$paymentContext$2.notRedirectAfterComplete) === true,
207
+ isAppWebview: _this.paymentContext.startBizFlowOptions.isAppWebview,
208
+ merchantAppointParam: (_this$paymentContext$3 = _this.paymentContext.startBizFlowOptions.submitPayRequestExtra) === null || _this$paymentContext$3 === void 0 ? void 0 : _this$paymentContext$3.merchantAppointParam,
209
+ allowSubmitPayCallAhead: _this.allowSubmitPayCallAhead,
210
+ doubleFaUrl: getDefaultEasySafePayPageUrl(ESP_PAGE_NAME.DOUBLE_FA, _this.initConfig.environment),
211
+ envInfo: {
212
+ screenHeight: screen.height,
213
+ screenWidth: screen.width
214
+ },
215
+ logMetaData: _objectSpread(_objectSpread({
216
+ trackId: logMetaData.requestSeq,
217
+ platform: logMetaData.platform,
218
+ firstLogTime: logMetaData.firstLogTime
219
+ }, ((_this$paymentContext$4 = _this.paymentContext.paymentSessionObj) === null || _this$paymentContext$4 === void 0 ? void 0 : _this$paymentContext$4.paymentSessionConfig) || {}), {}, {
220
+ renderDisplayType: logMetaData.renderDisplayType,
221
+ sdkVersion: logMetaData.sdkVersion,
222
+ merchantId: logMetaData.merchantId,
223
+ instanceId: logMetaData.instanceId,
224
+ paymentMethodType: logMetaData.paymentMethodType
225
+ })
226
+ };
227
+ if (queryRes) {
228
+ data.queryResult = queryRes;
229
+ }
199
230
  _this.eventCenter.dispatchToApp({
200
231
  event: 'renderComponent',
201
- data: {
202
- sessionResult: (_this$paymentContext = _this.paymentContext) === null || _this$paymentContext === void 0 ? void 0 : _this$paymentContext.paymentSessionObj,
203
- queryResult: queryRes,
204
- submitResult: submitRes,
205
- paymentSessionData: (_this$paymentContext2 = _this.paymentContext) === null || _this$paymentContext2 === void 0 ? void 0 : _this$paymentContext2.paymentSessionId,
206
- heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
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: getDefaultEasySafePayPageUrl(ESP_PAGE_NAME.DOUBLE_FA, _this.initConfig.environment),
214
- envInfo: {
215
- screenHeight: screen.height,
216
- screenWidth: screen.width
217
- },
218
- logMetaData: _objectSpread(_objectSpread({
219
- trackId: logMetaData.requestSeq,
220
- platform: logMetaData.platform,
221
- firstLogTime: logMetaData.firstLogTime
222
- }, ((_this$paymentContext$4 = _this.paymentContext.paymentSessionObj) === null || _this$paymentContext$4 === void 0 ? void 0 : _this$paymentContext$4.paymentSessionConfig) || {}), {}, {
223
- renderDisplayType: logMetaData.renderDisplayType,
224
- sdkVersion: logMetaData.sdkVersion,
225
- merchantId: logMetaData.merchantId,
226
- instanceId: logMetaData.instanceId,
227
- paymentMethodType: logMetaData.paymentMethodType
228
- })
229
- }
232
+ data: data
230
233
  });
231
234
  }).catch(function (error) {
232
235
  _this.eventCenter.emit(EVENT.destroy.name, {});
@@ -468,14 +471,15 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
468
471
  key: "initSecuritySDK",
469
472
  value: function () {
470
473
  var _initSecuritySDK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
471
- var _this$paymentContext$10, _this$paymentContext$11, productSceneVersion, nonCompliant, nonInitSecuritySDK, isFirstTimeToPay, shouldInitSecuritySDK;
474
+ 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
475
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
473
476
  while (1) switch (_context5.prev = _context5.next) {
474
477
  case 0:
475
478
  _context5.prev = 0;
476
479
  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;
480
+ 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;
481
+ 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;
482
+ 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
483
  isFirstTimeToPay = !this.paymentContext.paymentSessionObj.action.autoDebitWithToken;
480
484
  shouldInitSecuritySDK = false;
481
485
  if (nonInitSecuritySDK) {
@@ -488,44 +492,38 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
488
492
  // console.log('[web-sdk][security-sdk] DO NOT init security sdk for easypay 1.0');
489
493
  shouldInitSecuritySDK = false;
490
494
  } 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;
495
+ if (isFirstTimeToPay) {
496
+ // 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');
497
+ shouldInitSecuritySDK = signButtonDisplay && userSignAgreement;
495
498
  } 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
- }
499
+ // 切流「隐私合规」且非首次支付
500
+ // console.log('[web-sdk][security-sdk] DO init security sdk for easypay 2.0 and when not first time to pay');
501
+ shouldInitSecuritySDK = true;
504
502
  }
505
503
  }
506
504
  }
507
505
  if (!shouldInitSecuritySDK) {
508
- _context5.next = 10;
506
+ _context5.next = 11;
509
507
  break;
510
508
  }
511
- _context5.next = 10;
509
+ _context5.next = 11;
512
510
  return this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);
513
- case 10:
511
+ case 11:
514
512
  this.logger.logInfo({
515
513
  title: 'a3753.b101271.c388193.d514078'
516
514
  }, {
517
515
  riskSdkInfo: shouldInitSecuritySDK ? RiskSdkInfoEnum.NEED : RiskSdkInfoEnum.NO_NEED
518
516
  });
519
- _context5.next = 15;
517
+ _context5.next = 16;
520
518
  break;
521
- case 13:
522
- _context5.prev = 13;
519
+ case 14:
520
+ _context5.prev = 14;
523
521
  _context5.t0 = _context5["catch"](0);
524
- case 15:
522
+ case 16:
525
523
  case "end":
526
524
  return _context5.stop();
527
525
  }
528
- }, _callee5, this, [[0, 13]]);
526
+ }, _callee5, this, [[0, 14]]);
529
527
  }));
530
528
  function initSecuritySDK() {
531
529
  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.4",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",