@alipay/ams-checkout 0.0.1717583358-dev.0 → 0.0.1718085825-dev.2

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.
@@ -81,6 +81,7 @@ export default class ComponentApp {
81
81
  _handleAppMessage(data: eventPayload): void;
82
82
  private dismissLoadingFunc;
83
83
  private handleSizeChanged;
84
+ private handleAuthUrlInfo;
84
85
  private handleRedirect;
85
86
  private handleDeclareInfo;
86
87
  private handleDeclarePopWindowCallback;
@@ -56,7 +56,7 @@ var ComponentApp = /*#__PURE__*/function () {
56
56
  _defineProperty(this, "_multipleCallbackEvents", void 0);
57
57
  _defineProperty(this, "_merchantAppointParam", void 0);
58
58
  _defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
59
- this._appVersion = '1.15.1';
59
+ this._appVersion = '1.16.0.0';
60
60
  this._isInitComponent = false;
61
61
  this._selector = "#".concat(COMPONENT_SECTION_ID);
62
62
  this.createIframeNode = function () {
@@ -247,6 +247,10 @@ var ComponentApp = /*#__PURE__*/function () {
247
247
  key: "appendIframeNodes",
248
248
  value: function appendIframeNodes(componentSign, renderParams) {
249
249
  var _renderParams,
250
+ _this$_renderParams5,
251
+ _this$_renderParams6,
252
+ _this$_renderParams7,
253
+ _this$_renderParams8,
250
254
  _this3 = this;
251
255
  if (this._isInitComponent) {
252
256
  this.dispatchToSDK(EVENT.error.name, ERRORMESSAGE.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);
@@ -266,6 +270,49 @@ var ComponentApp = /*#__PURE__*/function () {
266
270
  key: 'sdk_create_component',
267
271
  value: Date.now()
268
272
  });
273
+ var params = {
274
+ paymentSessionData: this._renderParams && ((_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.sessionData) || '',
275
+ paymentSessionConfig: (_this$_renderParams6 = this._renderParams) === null || _this$_renderParams6 === void 0 || (_this$_renderParams6 = _this$_renderParams6.paymentSessionMetaData) === null || _this$_renderParams6 === void 0 ? void 0 : _this$_renderParams6.paymentSessionConfig
276
+ };
277
+ var _ref2 = params.paymentSessionConfig || {},
278
+ _ref2$productSceneVer = _ref2.productSceneVersion,
279
+ productSceneVersion = _ref2$productSceneVer === void 0 ? '' : _ref2$productSceneVer,
280
+ _ref2$productScene = _ref2.productScene,
281
+ productScene = _ref2$productScene === void 0 ? '' : _ref2$productScene;
282
+ var _ref3 = ((_this$_renderParams7 = this._renderParams) === null || _this$_renderParams7 === void 0 ? void 0 : _this$_renderParams7.paymentSessionMetaData) || {},
283
+ _ref3$action = _ref3.action,
284
+ _ref3$action2 = _ref3$action === void 0 ? {} : _ref3$action,
285
+ _ref3$action2$autoDeb = _ref3$action2.autoDebitWithToken,
286
+ autoDebitWithToken = _ref3$action2$autoDeb === void 0 ? false : _ref3$action2$autoDeb,
287
+ _ref3$action2$require = _ref3$action2.requireFastSdk,
288
+ requireFastSdk = _ref3$action2$require === void 0 ? false : _ref3$action2$require;
289
+ var _ref4 = ((_this$_renderParams8 = this._renderParams) === null || _this$_renderParams8 === void 0 ? void 0 : _this$_renderParams8.paymentSessionMetaData) || {},
290
+ _ref4$authUrlInfo = _ref4.authUrlInfo,
291
+ authUrlInfo = _ref4$authUrlInfo === void 0 ? {} : _ref4$authUrlInfo;
292
+ this.AMSSDK.logger.logInfo({
293
+ title: 'sdk_event_createComponent'
294
+ }, {
295
+ version: productSceneVersion,
296
+ product: this.AMSSDK.options.product
297
+ }).send();
298
+ if (componentSignEnum.EASY_PAY_WALLET === this._componentSign) {
299
+ if (productScene === productSceneEnum.EASY_PAY && productSceneVersion === '1.0' && !autoDebitWithToken && requireFastSdk) {
300
+ // EASY_PAY 1.0首次支付,requireFastSdk为true,不需要接口请求
301
+ this.handleAuthUrlInfo(authUrlInfo);
302
+ return;
303
+ }
304
+ }
305
+ if (componentSignEnum.AUTO_DEBIT_WALLET === this._componentSign) {
306
+ var _this$_renderParams9, _action$web, _action$wap;
307
+ var action = ((_this$_renderParams9 = this._renderParams) === null || _this$_renderParams9 === void 0 || (_this$_renderParams9 = _this$_renderParams9.paymentSessionMetaData) === null || _this$_renderParams9 === void 0 ? void 0 : _this$_renderParams9.action) || {};
308
+ var 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;
309
+ var _requireFastSdk = (action === null || action === void 0 ? void 0 : action.requireFastSdk) || false;
310
+ if (signType === 'REDIRECT' && _requireFastSdk === true) {
311
+ // REDIRECT,requireFastSdk为true,不需要接口请求
312
+ this.handleAuthUrlInfo(authUrlInfo);
313
+ return;
314
+ }
315
+ }
269
316
  this.dispatchToSDK(EVENT.eventCallback.name, {
270
317
  code: eventCodeEnum.SDK_START_OF_LOADING
271
318
  });
@@ -275,10 +322,10 @@ var ComponentApp = /*#__PURE__*/function () {
275
322
  insertStyleSheet();
276
323
  }
277
324
  if (this._renderDisplayType === renderDisplayTypeEnum.popup) {
278
- var _this$_renderParams5;
325
+ var _this$_renderParams10;
279
326
  createBaseElement(this.platform, this.closeBtnFunc.bind(this));
280
327
  createRetentionPopup(this.platform, this.hideRetentionPopupFunc.bind(this), this.retentionPopupLeaveFunc.bind(this));
281
- var channelBehavior = getChannelBehavior((_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.paymentSessionMetaData);
328
+ var channelBehavior = getChannelBehavior((_this$_renderParams10 = this._renderParams) === null || _this$_renderParams10 === void 0 ? void 0 : _this$_renderParams10.paymentSessionMetaData);
282
329
  var onClickOutside = function onClickOutside() {};
283
330
  if (channelBehavior !== null && channelBehavior !== void 0 && channelBehavior.allowClickOutsideClose) {
284
331
  onClickOutside = this.closeBtnFunc.bind(this);
@@ -366,9 +413,9 @@ var ComponentApp = /*#__PURE__*/function () {
366
413
  }, {
367
414
  key: "createActionQueryPromise",
368
415
  value: function createActionQueryPromise() {
369
- var _this$_renderParams6,
416
+ var _this$_renderParams11,
370
417
  _this5 = this;
371
- var paymentMethodType = (_this$_renderParams6 = this._renderParams) === null || _this$_renderParams6 === void 0 || (_this$_renderParams6 = _this$_renderParams6.paymentSessionMetaData) === null || _this$_renderParams6 === void 0 || (_this$_renderParams6 = _this$_renderParams6.paymentMethodInfoView) === null || _this$_renderParams6 === void 0 ? void 0 : _this$_renderParams6.paymentMethodType;
418
+ var paymentMethodType = (_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.paymentSessionMetaData) === null || _this$_renderParams11 === void 0 || (_this$_renderParams11 = _this$_renderParams11.paymentMethodInfoView) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.paymentMethodType;
372
419
  this._performanceData.push({
373
420
  key: 'sdk_action_query_start',
374
421
  value: Date.now()
@@ -376,9 +423,9 @@ var ComponentApp = /*#__PURE__*/function () {
376
423
 
377
424
  // eslint-disable-next-line no-async-promise-executor
378
425
  this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
379
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
426
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
380
427
  var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5, _this5$_renderParams6;
381
- var envInfo, params, _ref3, _ref3$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref4, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7, _this5$_renderParams8, _ref5, _ref5$productSceneVer, productSceneVersion, _ref5$productScene, productScene, _ref6, _ref6$action, _ref6$action2, _ref6$action2$autoDeb, autoDebitWithToken, _this5$_renderParams9, _action$web, _action$wap, action, signType;
428
+ var envInfo, params, _ref6, _ref6$extendInfo, extendInfo, actionData, enableVaultingApiOptimize, enableEasypayApiOptimize, _ref7, skipSdkQuery, skipSdkQueryForm, extendInfoData, ifSkip, channelBehavior, _this5$_renderParams7, _this5$_renderParams8, _ref8, _ref8$productSceneVer, productSceneVersion, _ref8$productScene, productScene, _ref9, _ref9$action, _ref9$action2, _ref9$action2$autoDeb, autoDebitWithToken, _this5$_renderParams9, _action$web2, _action$wap2, action, signType;
382
429
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
383
430
  while (1) switch (_context2.prev = _context2.next) {
384
431
  case 0:
@@ -394,10 +441,10 @@ var ComponentApp = /*#__PURE__*/function () {
394
441
  /**
395
442
  * @description Simulated or unnecessary scenarios
396
443
  */
397
- _ref3 = ((_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.paymentSessionMetaData) || {}, _ref3$extendInfo = _ref3.extendInfo, extendInfo = _ref3$extendInfo === void 0 ? '' : _ref3$extendInfo, actionData = _ref3.action;
444
+ _ref6 = ((_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.paymentSessionMetaData) || {}, _ref6$extendInfo = _ref6.extendInfo, extendInfo = _ref6$extendInfo === void 0 ? '' : _ref6$extendInfo, actionData = _ref6.action;
398
445
  enableVaultingApiOptimize = false;
399
446
  enableEasypayApiOptimize = false;
400
- _ref4 = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.action) || {}, skipSdkQuery = _ref4.skipSdkQuery, skipSdkQueryForm = _ref4.skipSdkQueryForm;
447
+ _ref7 = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.action) || {}, skipSdkQuery = _ref7.skipSdkQuery, skipSdkQueryForm = _ref7.skipSdkQueryForm;
401
448
  try {
402
449
  extendInfoData = JSON.parse(extendInfo);
403
450
  enableVaultingApiOptimize = extendInfoData.enableVaultingApiOptimize || false;
@@ -481,8 +528,8 @@ var ComponentApp = /*#__PURE__*/function () {
481
528
  _context2.next = 40;
482
529
  break;
483
530
  }
484
- _ref5 = params.paymentSessionConfig || {}, _ref5$productSceneVer = _ref5.productSceneVersion, productSceneVersion = _ref5$productSceneVer === void 0 ? '' : _ref5$productSceneVer, _ref5$productScene = _ref5.productScene, productScene = _ref5$productScene === void 0 ? '' : _ref5$productScene;
485
- _ref6 = ((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.paymentSessionMetaData) || {}, _ref6$action = _ref6.action, _ref6$action2 = _ref6$action === void 0 ? {} : _ref6$action, _ref6$action2$autoDeb = _ref6$action2.autoDebitWithToken, autoDebitWithToken = _ref6$action2$autoDeb === void 0 ? false : _ref6$action2$autoDeb;
531
+ _ref8 = params.paymentSessionConfig || {}, _ref8$productSceneVer = _ref8.productSceneVersion, productSceneVersion = _ref8$productSceneVer === void 0 ? '' : _ref8$productSceneVer, _ref8$productScene = _ref8.productScene, productScene = _ref8$productScene === void 0 ? '' : _ref8$productScene;
532
+ _ref9 = ((_this5$_renderParams7 = _this5._renderParams) === null || _this5$_renderParams7 === void 0 ? void 0 : _this5$_renderParams7.paymentSessionMetaData) || {}, _ref9$action = _ref9.action, _ref9$action2 = _ref9$action === void 0 ? {} : _ref9$action, _ref9$action2$autoDeb = _ref9$action2.autoDebitWithToken, autoDebitWithToken = _ref9$action2$autoDeb === void 0 ? false : _ref9$action2$autoDeb;
486
533
  if (!((_this5$_renderParams8 = _this5._renderParams) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.paymentSessionMetaData) !== null && _this5$_renderParams8 !== void 0 && (_this5$_renderParams8 = _this5$_renderParams8.action) !== null && _this5$_renderParams8 !== void 0 && _this5$_renderParams8.skipSdkQuery && enableEasypayApiOptimize)) {
487
534
  _context2.next = 35;
488
535
  break;
@@ -511,7 +558,7 @@ var ComponentApp = /*#__PURE__*/function () {
511
558
  break;
512
559
  }
513
560
  action = ((_this5$_renderParams9 = _this5._renderParams) === null || _this5$_renderParams9 === void 0 || (_this5$_renderParams9 = _this5$_renderParams9.paymentSessionMetaData) === null || _this5$_renderParams9 === void 0 ? void 0 : _this5$_renderParams9.action) || {};
514
- 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;
561
+ signType = isPC() ? action === null || action === void 0 || (_action$web2 = action.web) === null || _action$web2 === void 0 ? void 0 : _action$web2.signType : action === null || action === void 0 || (_action$wap2 = action.wap) === null || _action$wap2 === void 0 ? void 0 : _action$wap2.signType;
515
562
  if (!(signType === 'SMS')) {
516
563
  _context2.next = 45;
517
564
  break;
@@ -579,7 +626,7 @@ var ComponentApp = /*#__PURE__*/function () {
579
626
  }, _callee2);
580
627
  }));
581
628
  return function (_x, _x2) {
582
- return _ref2.apply(this, arguments);
629
+ return _ref5.apply(this, arguments);
583
630
  };
584
631
  }());
585
632
  return this._actionQueryPromise;
@@ -589,22 +636,22 @@ var ComponentApp = /*#__PURE__*/function () {
589
636
  }, {
590
637
  key: "createSubmitPromise",
591
638
  value: function createSubmitPromise() {
592
- var _this$_renderParams7,
593
- _this$_renderParams8,
594
- _this$_renderParams9,
639
+ var _this$_renderParams12,
640
+ _this$_renderParams13,
641
+ _this$_renderParams14,
595
642
  _this6 = this;
596
643
  this._performanceData.push({
597
644
  key: 'sdk_submit_start',
598
645
  value: Date.now()
599
646
  });
600
647
  var params = {
601
- paymentSessionData: this._renderParams && ((_this$_renderParams7 = this._renderParams) === null || _this$_renderParams7 === void 0 ? void 0 : _this$_renderParams7.sessionData) || '',
602
- paymentSessionConfig: (_this$_renderParams8 = this._renderParams) === null || _this$_renderParams8 === void 0 || (_this$_renderParams8 = _this$_renderParams8.paymentSessionMetaData) === null || _this$_renderParams8 === void 0 ? void 0 : _this$_renderParams8.paymentSessionConfig
648
+ paymentSessionData: this._renderParams && ((_this$_renderParams12 = this._renderParams) === null || _this$_renderParams12 === void 0 ? void 0 : _this$_renderParams12.sessionData) || '',
649
+ paymentSessionConfig: (_this$_renderParams13 = this._renderParams) === null || _this$_renderParams13 === void 0 || (_this$_renderParams13 = _this$_renderParams13.paymentSessionMetaData) === null || _this$_renderParams13 === void 0 ? void 0 : _this$_renderParams13.paymentSessionConfig
603
650
  };
604
- var channelBehavior = getChannelBehavior((_this$_renderParams9 = this._renderParams) === null || _this$_renderParams9 === void 0 ? void 0 : _this$_renderParams9.paymentSessionMetaData);
651
+ var channelBehavior = getChannelBehavior((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.paymentSessionMetaData);
605
652
  // eslint-disable-next-line no-async-promise-executor
606
653
  this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
607
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
654
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
608
655
  var _channelBehavior$buil, _this6$_renderParams$;
609
656
  var shouldSkipSubmitPayInSDK, _this6$_renderParams, extParams;
610
657
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -687,7 +734,7 @@ var ComponentApp = /*#__PURE__*/function () {
687
734
  }, _callee3);
688
735
  }));
689
736
  return function (_x3) {
690
- return _ref7.apply(this, arguments);
737
+ return _ref10.apply(this, arguments);
691
738
  };
692
739
  }());
693
740
  }
@@ -1203,11 +1250,31 @@ var ComponentApp = /*#__PURE__*/function () {
1203
1250
  this.app.style.height = "".concat(data.context.data.height, "px");
1204
1251
  }
1205
1252
  }
1253
+ }, {
1254
+ key: "handleAuthUrlInfo",
1255
+ value: function handleAuthUrlInfo(authUrlInfo) {
1256
+ var data = {};
1257
+ 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) {
1258
+ data = {
1259
+ normalUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
1260
+ schemeUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl,
1261
+ applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.authUrl
1262
+ };
1263
+ } else {
1264
+ data = {
1265
+ normalUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.normalUrl,
1266
+ schemeUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.schemeUrl,
1267
+ applinkUrl: authUrlInfo === null || authUrlInfo === void 0 ? void 0 : authUrlInfo.applinkUrl
1268
+ };
1269
+ }
1270
+ this.handleRedirect(data, true);
1271
+ }
1206
1272
  }, {
1207
1273
  key: "handleRedirect",
1208
1274
  value: function handleRedirect(data) {
1209
1275
  var _data$isDestroy,
1210
1276
  _this7 = this;
1277
+ var fromFastSdk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1211
1278
  var _data = typeof data === 'string' ? {
1212
1279
  normalUrl: data
1213
1280
  } : _objectSpread(_objectSpread({}, data), {}, {
@@ -1230,7 +1297,8 @@ var ComponentApp = /*#__PURE__*/function () {
1230
1297
  }, {
1231
1298
  redirectInfo: JSON.stringify(_data),
1232
1299
  openType: type,
1233
- url: url
1300
+ url: url,
1301
+ fromFastSdk: fromFastSdk
1234
1302
  }).send();
1235
1303
  };
1236
1304
  var failCallback = function failCallback(type, url) {
@@ -1243,7 +1311,8 @@ var ComponentApp = /*#__PURE__*/function () {
1243
1311
  }, {
1244
1312
  redirectInfo: JSON.stringify(_data),
1245
1313
  openType: type,
1246
- url: url
1314
+ url: url,
1315
+ fromFastSdk: fromFastSdk
1247
1316
  }).send();
1248
1317
  };
1249
1318
 
@@ -1286,9 +1355,9 @@ var ComponentApp = /*#__PURE__*/function () {
1286
1355
  }
1287
1356
  }, {
1288
1357
  key: "handleDeclareInfo",
1289
- value: function handleDeclareInfo(_ref8) {
1290
- var _ref8$closeDialogData = _ref8.closeDialogData,
1291
- closeDialogData = _ref8$closeDialogData === void 0 ? {} : _ref8$closeDialogData;
1358
+ value: function handleDeclareInfo(_ref11) {
1359
+ var _ref11$closeDialogDat = _ref11.closeDialogData,
1360
+ closeDialogData = _ref11$closeDialogDat === void 0 ? {} : _ref11$closeDialogDat;
1292
1361
  _handleDeclareInfo({
1293
1362
  closeDialogData: closeDialogData
1294
1363
  });
@@ -1429,7 +1498,7 @@ var ComponentApp = /*#__PURE__*/function () {
1429
1498
  key: "sendRenderEvent",
1430
1499
  value: (function () {
1431
1500
  var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1432
- var _this$_renderParams10, _this$_renderParams11, _this$_renderParams12, _this$_renderParams13, _this$_renderParams14, _this$_renderParams15, _this$AMSSDK$logger, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$AMSSDK, _this$_renderParams19, res, submitRes;
1501
+ var _this$_renderParams15, _this$_renderParams16, _this$_renderParams17, _this$_renderParams18, _this$_renderParams19, _this$_renderParams20, _this$AMSSDK$logger, _this$_renderParams21, _this$_renderParams22, _this$_renderParams23, _this$AMSSDK, _this$_renderParams24, res, submitRes;
1433
1502
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1434
1503
  while (1) switch (_context8.prev = _context8.next) {
1435
1504
  case 0:
@@ -1458,28 +1527,28 @@ var ComponentApp = /*#__PURE__*/function () {
1458
1527
  data: {
1459
1528
  queryResult: res,
1460
1529
  submitResult: submitRes,
1461
- sessionResult: (_this$_renderParams10 = this._renderParams) === null || _this$_renderParams10 === void 0 ? void 0 : _this$_renderParams10.paymentSessionMetaData,
1462
- paymentSessionData: (_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.sessionData,
1530
+ sessionResult: (_this$_renderParams15 = this._renderParams) === null || _this$_renderParams15 === void 0 ? void 0 : _this$_renderParams15.paymentSessionMetaData,
1531
+ paymentSessionData: (_this$_renderParams16 = this._renderParams) === null || _this$_renderParams16 === void 0 ? void 0 : _this$_renderParams16.sessionData,
1463
1532
  heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
1464
- renderDisplayType: (_this$_renderParams12 = this._renderParams) === null || _this$_renderParams12 === void 0 ? void 0 : _this$_renderParams12.renderDisplayType,
1465
- appearance: (_this$_renderParams13 = this._renderParams) === null || _this$_renderParams13 === void 0 ? void 0 : _this$_renderParams13.appearance,
1466
- notRedirectAfterComplete: ((_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.notRedirectAfterComplete) === true,
1533
+ renderDisplayType: (_this$_renderParams17 = this._renderParams) === null || _this$_renderParams17 === void 0 ? void 0 : _this$_renderParams17.renderDisplayType,
1534
+ appearance: (_this$_renderParams18 = this._renderParams) === null || _this$_renderParams18 === void 0 ? void 0 : _this$_renderParams18.appearance,
1535
+ notRedirectAfterComplete: ((_this$_renderParams19 = this._renderParams) === null || _this$_renderParams19 === void 0 ? void 0 : _this$_renderParams19.notRedirectAfterComplete) === true,
1467
1536
  merchantAppointParam: this._merchantAppointParam,
1468
1537
  envInfo: {
1469
1538
  screenHeight: screen.height,
1470
1539
  screenWidth: screen.width
1471
1540
  },
1472
1541
  logMetaData: _objectSpread(_objectSpread({
1473
- trackId: (_this$_renderParams15 = this._renderParams) === null || _this$_renderParams15 === void 0 ? void 0 : _this$_renderParams15.sessionData,
1542
+ trackId: (_this$_renderParams20 = this._renderParams) === null || _this$_renderParams20 === void 0 ? void 0 : _this$_renderParams20.sessionData,
1474
1543
  platform: this.platform,
1475
1544
  firstLogTime: (_this$AMSSDK$logger = this.AMSSDK.logger) === null || _this$AMSSDK$logger === void 0 ? void 0 : _this$AMSSDK$logger.getComponentStartTime()
1476
- }, ((_this$_renderParams16 = this._renderParams) === null || _this$_renderParams16 === void 0 || (_this$_renderParams16 = _this$_renderParams16.paymentSessionMetaData) === null || _this$_renderParams16 === void 0 ? void 0 : _this$_renderParams16.paymentSessionConfig) || {}), {}, {
1477
- renderDisplayType: (_this$_renderParams17 = this._renderParams) === null || _this$_renderParams17 === void 0 ? void 0 : _this$_renderParams17.renderDisplayType,
1545
+ }, ((_this$_renderParams21 = this._renderParams) === null || _this$_renderParams21 === void 0 || (_this$_renderParams21 = _this$_renderParams21.paymentSessionMetaData) === null || _this$_renderParams21 === void 0 ? void 0 : _this$_renderParams21.paymentSessionConfig) || {}), {}, {
1546
+ renderDisplayType: (_this$_renderParams22 = this._renderParams) === null || _this$_renderParams22 === void 0 ? void 0 : _this$_renderParams22.renderDisplayType,
1478
1547
  sdkVersion: this._appVersion,
1479
- merchantId: (_this$_renderParams18 = this._renderParams) === null || _this$_renderParams18 === void 0 || (_this$_renderParams18 = _this$_renderParams18.paymentSessionMetaData) === null || _this$_renderParams18 === void 0 ? void 0 : _this$_renderParams18.clientId,
1548
+ merchantId: (_this$_renderParams23 = this._renderParams) === null || _this$_renderParams23 === void 0 || (_this$_renderParams23 = _this$_renderParams23.paymentSessionMetaData) === null || _this$_renderParams23 === void 0 ? void 0 : _this$_renderParams23.clientId,
1480
1549
  instanceId: (_this$AMSSDK = this.AMSSDK) === null || _this$AMSSDK === void 0 ? void 0 : _this$AMSSDK._instanceId,
1481
1550
  performanceData: this._performanceData,
1482
- paymentMethodType: (_this$_renderParams19 = this._renderParams) === null || _this$_renderParams19 === void 0 || (_this$_renderParams19 = _this$_renderParams19.paymentSessionMetaData) === null || _this$_renderParams19 === void 0 || (_this$_renderParams19 = _this$_renderParams19.paymentMethodInfoView) === null || _this$_renderParams19 === void 0 ? void 0 : _this$_renderParams19.paymentMethodType
1551
+ paymentMethodType: (_this$_renderParams24 = this._renderParams) === null || _this$_renderParams24 === void 0 || (_this$_renderParams24 = _this$_renderParams24.paymentSessionMetaData) === null || _this$_renderParams24 === void 0 || (_this$_renderParams24 = _this$_renderParams24.paymentMethodInfoView) === null || _this$_renderParams24 === void 0 ? void 0 : _this$_renderParams24.paymentMethodType
1483
1552
  })
1484
1553
  }
1485
1554
  }
@@ -116,8 +116,7 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
116
116
  blockPayPalPayLaterButton = _ref2.blockPayPalPayLaterButton,
117
117
  displayPayPalPayLaterButtonOnly = _ref2.displayPayPalPayLaterButtonOnly,
118
118
  enableMessages = _ref2.enableMessages,
119
- intent = _ref2.intent,
120
- buyerCountry = _ref2.buyerCountry;
119
+ intent = _ref2.intent;
121
120
  var script = document.createElement('script');
122
121
  var src = "https://www.paypal.com/sdk/js?";
123
122
  var urlSearchParams = new URLSearchParams({
@@ -126,8 +125,6 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
126
125
  'client-id': channelMerchantAccountId
127
126
  });
128
127
  var disableFundingArr = ['bancontact', 'blik', 'eps', 'giropay', 'ideal', 'mercadopago', 'mybank', 'p24', 'sepa', 'sofort'];
129
- // TODO: 上线后删除
130
- // const disableFundingArr = [];
131
128
  if (blockPayPalCreditButton && !displayPayPalPayLaterButtonOnly) {
132
129
  disableFundingArr.push('card');
133
130
  }
@@ -146,11 +143,6 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
146
143
  urlSearchParams.append('intent', 'authorize');
147
144
  urlSearchParams.append('commit', 'false');
148
145
  }
149
-
150
- // TODO: 上线后删除
151
- if (buyerCountry) {
152
- urlSearchParams.append('buyer-country', buyerCountry);
153
- }
154
146
  if (PaypalMethodEnum.PAYPAL_VAULT === paymentMethodType) {
155
147
  urlSearchParams.append('vault', 'true');
156
148
  }
@@ -91,7 +91,6 @@ export interface IPaypalConfiguration {
91
91
  displayPayPalPayLaterButtonOnly?: boolean;
92
92
  enableMessages?: boolean;
93
93
  intent?: payPalConfigurationIntentEnum;
94
- buyerCountry?: string;
95
94
  }
96
95
  export declare enum payPalConfigurationIntentEnum {
97
96
  'intent' = "intent",
@@ -149,12 +148,20 @@ export interface IpaymentSessionMetaData {
149
148
  amountConfirmRequired?: boolean;
150
149
  autoDebitWithToken: boolean;
151
150
  skipSdkQuery: boolean;
151
+ requireFastSdk: boolean;
152
152
  skipSdkQueryForm?: {
153
153
  value: boolean;
154
154
  version: string;
155
155
  platform: string;
156
156
  };
157
157
  };
158
+ authUrlInfo?: {
159
+ appIdentifier?: string;
160
+ applinkUrl?: string;
161
+ normalUrl?: string;
162
+ schemeUrl?: string;
163
+ authUrl?: string;
164
+ };
158
165
  paymentSessionFactor?: {
159
166
  extendInfo?: {
160
167
  merchantCapabilities?: string[];
package/package.json CHANGED
@@ -1,56 +1 @@
1
- {
2
- "name": "@alipay/ams-checkout",
3
- "version": "0.0.1717583358-dev.0",
4
- "description": "",
5
- "author": "",
6
- "main": "esm/index.js",
7
- "module": "esm/index.js",
8
- "typings": "esm/index.d.ts",
9
- "files": [
10
- "dist",
11
- "esm",
12
- "LEGAL.md",
13
- "LICENSE",
14
- "README.md"
15
- ],
16
- "scripts": {
17
- "build": "father build",
18
- "ci": "npm run lint",
19
- "cov": "jest --coverage",
20
- "format": "prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"",
21
- "lint": "eslint ./src",
22
- "test": "jest"
23
- },
24
- "dependencies": {
25
- "axios": "^1.3.4",
26
- "uuid": "^9.0.0"
27
- },
28
- "devDependencies": {
29
- "@babel/core": "^7.20.7",
30
- "@babel/preset-env": "^7.20.2",
31
- "@testing-library/jest-dom": "^5.1.1",
32
- "@testing-library/react": "^9.5.0",
33
- "@types/jest": "^29.2.4",
34
- "@types/uuid": "^9.0.0",
35
- "@typescript-eslint/eslint-plugin": "latest",
36
- "@typescript-eslint/parser": "^5.60.0",
37
- "babel-jest": "^29.3.1",
38
- "babel-loader": "^9.1.0",
39
- "babel-plugin-import": "^1.13.0",
40
- "eslint": "^8.36.0",
41
- "eslint-plugin-prettier": "latest",
42
- "father": "^4.2.3",
43
- "jest": "^29.5.0",
44
- "jest-environment-jsdom": "^29.3.1",
45
- "prettier": "^2.8.4",
46
- "prettier-plugin-organize-imports": "^3.2.3",
47
- "prettier-plugin-packagejson": "^2.4.5",
48
- "ts-jest": "^29.0.3",
49
- "ts-node": "^10.9.1",
50
- "typescript": "^4.9.5"
51
- },
52
- "engines": {},
53
- "publishConfig": {
54
- "access": "public"
55
- }
56
- }
1
+ {"name":"@alipay/ams-checkout","version":"0.0.1718085825-dev.2","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"}}