@alipay/ams-checkout 1.26.0 → 1.28.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.
@@ -5,10 +5,10 @@ export declare const sdkVersion: string;
5
5
  /**
6
6
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
7
7
  */
8
- export declare const AMSCheckoutAppVersion = "1.26.0";
9
- export declare const AMSAutoDebitAppVersion = "1.26.0";
10
- export declare const AMSEasyPayAppVersion = "1.26.0";
11
- export declare const AMSCashierPaymentAppVersion = "1.26.0";
12
- export declare const AMSVaultingAppVersion = "1.26.0";
13
- export declare const AMSPaymentElementAppVersion = "1.26.0";
14
- export declare const ADDRESSElementAppVersion = "1.26.0";
8
+ export declare const AMSCheckoutAppVersion = "1.28.0";
9
+ export declare const AMSAutoDebitAppVersion = "1.28.0";
10
+ export declare const AMSEasyPayAppVersion = "1.28.0";
11
+ export declare const AMSCashierPaymentAppVersion = "1.28.0";
12
+ export declare const AMSVaultingAppVersion = "1.28.0";
13
+ export declare const AMSPaymentElementAppVersion = "1.28.0";
14
+ export declare const ADDRESSElementAppVersion = "1.28.0";
@@ -35,10 +35,10 @@ export var sdkVersion = json.version;
35
35
  /**
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
37
37
  */
38
- export var AMSCheckoutAppVersion = '1.26.0'; // 兜底版本号
39
- export var AMSAutoDebitAppVersion = '1.26.0'; // 代扣
40
- export var AMSEasyPayAppVersion = '1.26.0'; // easypay
41
- export var AMSCashierPaymentAppVersion = '1.26.0'; // 收银台(卡、apm)
42
- export var AMSVaultingAppVersion = '1.26.0'; // 绑卡
43
- export var AMSPaymentElementAppVersion = '1.26.0'; // payment element
44
- export var ADDRESSElementAppVersion = '1.26.0'; // address element
38
+ export var AMSCheckoutAppVersion = '1.28.0'; // 兜底版本号
39
+ export var AMSAutoDebitAppVersion = '1.28.0'; // 代扣
40
+ export var AMSEasyPayAppVersion = '1.28.0'; // easypay
41
+ export var AMSCashierPaymentAppVersion = '1.28.0'; // 收银台(卡、apm)
42
+ export var AMSVaultingAppVersion = '1.28.0'; // 绑卡
43
+ export var AMSPaymentElementAppVersion = '1.28.0'; // payment element
44
+ export var ADDRESSElementAppVersion = '1.28.0'; // address element
@@ -198,6 +198,15 @@ export declare const EVENT: {
198
198
  initSecuritySDK: {
199
199
  name: string;
200
200
  };
201
+ closePaymentPolling: {
202
+ name: string;
203
+ };
204
+ onPollingEnd: {
205
+ name: string;
206
+ };
207
+ getApplePayToken: {
208
+ name: string;
209
+ };
201
210
  };
202
211
  export declare const COMPONENT_CONTAINER_ID = "ams-component-container";
203
212
  export declare const COMPONENT_SECTION_ID = "ams-component-section";
@@ -200,6 +200,15 @@ export var EVENT = {
200
200
  },
201
201
  initSecuritySDK: {
202
202
  name: 'initSecuritySDK'
203
+ },
204
+ closePaymentPolling: {
205
+ name: 'closePaymentPolling'
206
+ },
207
+ onPollingEnd: {
208
+ name: 'onPollingEnd'
209
+ },
210
+ getApplePayToken: {
211
+ name: 'getApplePayToken'
203
212
  }
204
213
  };
205
214
  export var COMPONENT_CONTAINER_ID = 'ams-component-container';
@@ -33,6 +33,7 @@ export declare class ElementComponent {
33
33
  private mountAuth;
34
34
  private mountAddress;
35
35
  private mountPayment;
36
+ mountErrorHandle(): void;
36
37
  mount(renderOptions: AddressMountOptions, sdkSelector: string): AddressMountResult;
37
38
  mount(renderOptions: PaymentMountOptions, sdkSelector: string): PaymentMountResult;
38
39
  mount(renderOptions: LinkAuthMountOptions, sdkSelector: string): LinkAuthMountResult;
@@ -27,6 +27,8 @@ import { ElementPaymentComponent } from "./components/payment";
27
27
  // import { oneAccount, sdkAction, submitResult } from './mock';
28
28
  import { v4 as uuid } from 'uuid';
29
29
  import { addressTheme, ELEMENT_ENVIRONMENT, ThemeType } from "./type";
30
+ import { LogConfig, Logger } from "../../../util/logger";
31
+ var logger = new Logger(LogConfig, true);
30
32
  var ElementProcessor = /*#__PURE__*/function () {
31
33
  function ElementProcessor(options) {
32
34
  _classCallCheck(this, ElementProcessor);
@@ -210,12 +212,7 @@ export var ElementComponent = /*#__PURE__*/function () {
210
212
  elementProps: renderOptions.elementProps
211
213
  }, _mountParams)).then(function (result) {
212
214
  if (!result) {
213
- var _this4$_options$onEve, _this4$_options2;
214
- (_this4$_options$onEve = (_this4$_options2 = _this4._options).onEventCallback) === null || _this4$_options$onEve === void 0 || _this4$_options$onEve.call(_this4$_options2, {
215
- code: EventCallbackCode.Failed,
216
- message: 'Address Component loading failed'
217
- });
218
- return undefined;
215
+ return _this4.mountErrorHandle();
219
216
  }
220
217
  _this4.eventService.addIFrame(result);
221
218
  _this4.iframes[ElementPaymentMethod.ADDRESS_ELEMENT] = result;
@@ -228,9 +225,9 @@ export var ElementComponent = /*#__PURE__*/function () {
228
225
  });
229
226
  // 渲染卡支付组件
230
227
  _defineProperty(this, "mountPayment", function (renderOptions, sdkSelector) {
231
- var _this4$_options3;
228
+ var _this4$_options2;
232
229
  var _mountParams = {
233
- appearance: renderOptions.appearance || ((_this4$_options3 = _this4._options) === null || _this4$_options3 === void 0 ? void 0 : _this4$_options3.appearance) || {
230
+ appearance: renderOptions.appearance || ((_this4$_options2 = _this4._options) === null || _this4$_options2 === void 0 ? void 0 : _this4$_options2.appearance) || {
234
231
  theme: ThemeType.Default
235
232
  }
236
233
  };
@@ -240,12 +237,7 @@ export var ElementComponent = /*#__PURE__*/function () {
240
237
  elementProps: renderOptions.elementProps
241
238
  }, _mountParams)).then(function (result) {
242
239
  if (!result) {
243
- var _this4$_options$onEve2, _this4$_options4;
244
- (_this4$_options$onEve2 = (_this4$_options4 = _this4._options).onEventCallback) === null || _this4$_options$onEve2 === void 0 || _this4$_options$onEve2.call(_this4$_options4, {
245
- code: EventCallbackCode.Failed,
246
- message: 'Payment Component loading failed'
247
- });
248
- return undefined;
240
+ return _this4.mountErrorHandle();
249
241
  }
250
242
  _this4.eventService.addIFrame(result);
251
243
  _this4.iframes[ElementPaymentMethod.PAYMENT_ELEMENT] = result;
@@ -330,7 +322,9 @@ export var ElementComponent = /*#__PURE__*/function () {
330
322
  data: {
331
323
  target: target,
332
324
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
333
- params: params
325
+ params: _objectSpread(_objectSpread({}, params), {}, {
326
+ sessionResult: _this4.parseData
327
+ })
334
328
  }
335
329
  }, function (result) {
336
330
  resolve(result);
@@ -341,7 +335,7 @@ export var ElementComponent = /*#__PURE__*/function () {
341
335
  _defineProperty(this, "validatePromiseFuncs", function () {
342
336
  return new Promise( /*#__PURE__*/function () {
343
337
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
344
- var params, _result$data, _result$data2, result, _result$data3, _result$data4, _result, _result2$data, _result2$data2, _result2$data3, _result2;
338
+ var params, _result$data, _result$data2, result, _result$data3, _result$data4, _result, _result2$data, _result2;
345
339
  return _regeneratorRuntime().wrap(function _callee$(_context) {
346
340
  while (1) switch (_context.prev = _context.next) {
347
341
  case 0:
@@ -379,7 +373,7 @@ export var ElementComponent = /*#__PURE__*/function () {
379
373
  return _context.abrupt("return", resolve(undefined));
380
374
  case 17:
381
375
  if (!(_this4.launchSource.includes(ElementPaymentMethod.PAYMENT_ELEMENT) || !_this4.isConnect)) {
382
- _context.next = 32;
376
+ _context.next = 30;
383
377
  break;
384
378
  }
385
379
  _context.prev = 18;
@@ -388,29 +382,29 @@ export var ElementComponent = /*#__PURE__*/function () {
388
382
  case 21:
389
383
  _result2 = _context.sent;
390
384
  console.log('element submit validate payment---------', _result2, _this4.isConnect);
391
- params.paymentFactors = (_result2$data = _result2.data) === null || _result2$data === void 0 || (_result2$data = _result2$data.data) === null || _result2$data === void 0 ? void 0 : _result2$data.paymentFactors;
392
- params.paymentMethod = (_result2$data2 = _result2.data) === null || _result2$data2 === void 0 || (_result2$data2 = _result2$data2.data) === null || _result2$data2 === void 0 ? void 0 : _result2$data2.paymentMethod;
393
- if (_result2 !== null && _result2 !== void 0 && (_result2$data3 = _result2.data) !== null && _result2$data3 !== void 0 && _result2$data3.success) {
394
- _context.next = 27;
385
+ // params.paymentFactors = result.data?.data?.paymentFactors;
386
+ // params.paymentMethod = result.data?.data?.paymentMethod;
387
+ if (_result2 !== null && _result2 !== void 0 && (_result2$data = _result2.data) !== null && _result2$data !== void 0 && _result2$data.success) {
388
+ _context.next = 25;
395
389
  break;
396
390
  }
397
391
  return _context.abrupt("return", resolve(undefined));
398
- case 27:
399
- _context.next = 32;
392
+ case 25:
393
+ _context.next = 30;
400
394
  break;
401
- case 29:
402
- _context.prev = 29;
395
+ case 27:
396
+ _context.prev = 27;
403
397
  _context.t0 = _context["catch"](18);
404
398
  return _context.abrupt("return", resolve(undefined));
405
- case 32:
399
+ case 30:
406
400
  // params.paymentFactors = paymentResult.data?.data.paymentFactors;
407
401
  // params.paymentMethod = paymentResult.data?.data.paymentMethod;
408
402
  resolve(params);
409
- case 33:
403
+ case 31:
410
404
  case "end":
411
405
  return _context.stop();
412
406
  }
413
- }, _callee, null, [[18, 29]]);
407
+ }, _callee, null, [[18, 27]]);
414
408
  }));
415
409
  return function (_x) {
416
410
  return _ref.apply(this, arguments);
@@ -426,6 +420,9 @@ export var ElementComponent = /*#__PURE__*/function () {
426
420
  this.componentsCount = 0;
427
421
  this.iframes = {};
428
422
  this.mountOptions = {};
423
+ logger.logInfo({
424
+ title: 'a3753.b101271.c386688'
425
+ });
429
426
  this.createElement();
430
427
  }
431
428
 
@@ -442,10 +439,10 @@ export var ElementComponent = /*#__PURE__*/function () {
442
439
  sessionData = _parseSessionData2[1];
443
440
  this.parseData = parseData;
444
441
  this.sessionData = sessionData;
445
- this.isConnect = ((_parseData$connectFac = parseData.connectFactor) === null || _parseData$connectFac === void 0 ? void 0 : _parseData$connectFac.enableConnect) && (parseData === null || parseData === void 0 || (_parseData$paymentSes = parseData.paymentSessionConfig) === null || _parseData$paymentSes === void 0 ? void 0 : _parseData$paymentSes.productScene) === ProductSceneEnum.ELEMENT_PAYMENT;
442
+ this.isConnect = (parseData === null || parseData === void 0 || (_parseData$connectFac = parseData.connectFactor) === null || _parseData$connectFac === void 0 ? void 0 : _parseData$connectFac.enableConnect) && (parseData === null || parseData === void 0 || (_parseData$paymentSes = parseData.paymentSessionConfig) === null || _parseData$paymentSes === void 0 ? void 0 : _parseData$paymentSes.productScene) === ProductSceneEnum.ELEMENT_PAYMENT;
446
443
  this.elementContainer = new AntomSDKCore();
447
444
  this.elementContainer.registerProcessor(ProductSceneEnum.ELEMENT_PAYMENT, '', new ElementProcessor({
448
- paymentSessionConfig: parseData.paymentSessionConfig,
445
+ paymentSessionConfig: parseData === null || parseData === void 0 ? void 0 : parseData.paymentSessionConfig,
449
446
  sessionData: sessionData,
450
447
  environment: this._options.environment,
451
448
  locale: this._options.locale,
@@ -459,15 +456,19 @@ export var ElementComponent = /*#__PURE__*/function () {
459
456
  if (!_this5.isConnect) return;
460
457
  var bizFlowBehavior = _this5.elementContainer.getBizFlowBehavior();
461
458
  if (!(bizFlowBehavior !== null && bizFlowBehavior !== void 0 && (_bizFlowBehavior$data = bizFlowBehavior.data) !== null && _bizFlowBehavior$data !== void 0 && _bizFlowBehavior$data.success)) {
462
- var _this5$_options, _this5$_options$onEve, _bizFlowBehavior$data2;
459
+ var _this5$_options, _this5$_options$onEve;
460
+ console.log('demo event callback----', {
461
+ code: EventCallbackCode.FAILED,
462
+ message: 'INTERNAL_FAILED'
463
+ });
463
464
  _this5 === null || _this5 === void 0 || (_this5$_options = _this5._options) === null || _this5$_options === void 0 || (_this5$_options$onEve = _this5$_options.onEventCallback) === null || _this5$_options$onEve === void 0 || _this5$_options$onEve.call(_this5$_options, {
464
- code: EventCallbackCode.Failed,
465
- message: (bizFlowBehavior === null || bizFlowBehavior === void 0 || (_bizFlowBehavior$data2 = bizFlowBehavior.data) === null || _bizFlowBehavior$data2 === void 0 ? void 0 : _bizFlowBehavior$data2.errorMsg) || 'start biz flow fail, please retry.'
465
+ code: EventCallbackCode.FAILED,
466
+ message: 'INTERNAL_FAILED'
466
467
  });
467
468
  } else {
468
- var _bizFlowBehavior$data3, _bizFlowBehavior$data4;
469
- _this5.oneAccountRes = bizFlowBehavior === null || bizFlowBehavior === void 0 || (_bizFlowBehavior$data3 = bizFlowBehavior.data) === null || _bizFlowBehavior$data3 === void 0 ? void 0 : _bizFlowBehavior$data3.oneAccountRes;
470
- _this5.sdkActionRes = bizFlowBehavior === null || bizFlowBehavior === void 0 || (_bizFlowBehavior$data4 = bizFlowBehavior.data) === null || _bizFlowBehavior$data4 === void 0 ? void 0 : _bizFlowBehavior$data4.sdkActionRes;
469
+ var _bizFlowBehavior$data2, _bizFlowBehavior$data3;
470
+ _this5.oneAccountRes = bizFlowBehavior === null || bizFlowBehavior === void 0 || (_bizFlowBehavior$data2 = bizFlowBehavior.data) === null || _bizFlowBehavior$data2 === void 0 ? void 0 : _bizFlowBehavior$data2.oneAccountRes;
471
+ _this5.sdkActionRes = bizFlowBehavior === null || bizFlowBehavior === void 0 || (_bizFlowBehavior$data3 = bizFlowBehavior.data) === null || _bizFlowBehavior$data3 === void 0 ? void 0 : _bizFlowBehavior$data3.sdkActionRes;
471
472
  _this5.afterInit();
472
473
  }
473
474
  });
@@ -499,9 +500,14 @@ export var ElementComponent = /*#__PURE__*/function () {
499
500
  }, this.isConnect);
500
501
  } catch (error) {
501
502
  var _this$_options$onEven, _this$_options;
503
+ console.log('demo event callback----', {
504
+ code: EventCallbackCode.FAILED,
505
+ message: 'INTERNAL_FAILED'
506
+ });
502
507
  (_this$_options$onEven = (_this$_options = this._options).onEventCallback) === null || _this$_options$onEven === void 0 || _this$_options$onEven.call(_this$_options, {
503
- code: EventCallbackCode.Failed,
504
- message: 'create sdk fail'
508
+ code: EventCallbackCode.FAILED,
509
+ message: 'INTERNAL_FAILED'
510
+ // message: 'create sdk fail',
505
511
  });
506
512
  }
507
513
 
@@ -515,7 +521,7 @@ export var ElementComponent = /*#__PURE__*/function () {
515
521
  value: function createIframeSrc() {
516
522
  var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ELEMENT_ENVIRONMENT.DEV;
517
523
  var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PackageJson.version;
518
- var baseUrl = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ELEMENT_ENVIRONMENT.DEV, 'http://dev.page.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.TEST, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SIT, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.PRE, 'https://pre.ac.alipay.com/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SANDBOX, 'https://checkout.antom.com'), ELEMENT_ENVIRONMENT.PROD, 'https://checkout.antom.com');
524
+ var baseUrl = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ELEMENT_ENVIRONMENT.DEV, 'http://page.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.TEST, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SIT, 'http://page.test.alipay.net/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.PRE, 'https://pre.ac.alipay.com/page/antom-web-checkout-v2'), ELEMENT_ENVIRONMENT.SANDBOX, 'https://checkout.antom.com'), ELEMENT_ENVIRONMENT.PROD, 'https://checkout.antom.com');
519
525
  var _env = (env === null || env === void 0 ? void 0 : env.toLocaleUpperCase()) || ELEMENT_ENVIRONMENT.DEV;
520
526
  var payment = "".concat(baseUrl[_env], "/elements/").concat(version, "/pages/element_payment/index.html");
521
527
  try {
@@ -562,6 +568,11 @@ export var ElementComponent = /*#__PURE__*/function () {
562
568
  (_this6 === null || _this6 === void 0 ? void 0 : _this6.authBase) && (_this6 === null || _this6 === void 0 || (_this6$authBase = _this6.authBase) === null || _this6$authBase === void 0 ? void 0 : _this6$authBase.update(result.data.height));
563
569
  }
564
570
  });
571
+ this.eventService.listen(ElementPaymentEvent.SEND_MUITI_APP_EVENT_TO_SDK, function (result) {
572
+ var _this6$_options$onEve, _this6$_options;
573
+ console.log('demo event callback----', result.data);
574
+ (_this6$_options$onEve = (_this6$_options = _this6._options).onEventCallback) === null || _this6$_options$onEve === void 0 || _this6$_options$onEve.call(_this6$_options, result.data);
575
+ });
565
576
  this.eventService.listen(ElementPaymentEvent.CALLBACK, function (result) {
566
577
  var _this6$eventCallback;
567
578
  console.log('antom sdk 组件事件回调');
@@ -640,7 +651,7 @@ export var ElementComponent = /*#__PURE__*/function () {
640
651
  params.queryResult = _this7.sdkActionRes;
641
652
  }
642
653
  _this7.eventService.emitAndListen({
643
- event: ElementPaymentEvent.INITIAL_DATA_READY,
654
+ event: ElementPaymentEvent.RENDER_COMPONENT,
644
655
  data: {
645
656
  target: target,
646
657
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
@@ -689,31 +700,40 @@ export var ElementComponent = /*#__PURE__*/function () {
689
700
  url: url
690
701
  }).then(function (result) {
691
702
  if (!result) {
692
- var _this8$_options$onEve, _this8$_options;
693
- (_this8$_options$onEve = (_this8$_options = _this8._options).onEventCallback) === null || _this8$_options$onEve === void 0 || _this8$_options$onEve.call(_this8$_options, {
694
- code: EventCallbackCode.Failed,
695
- message: 'Auth Component loading failed'
696
- });
697
- return undefined;
703
+ return _this8.mountErrorHandle();
698
704
  }
699
705
  _this8.eventService.addIFrame(result);
700
706
  _this8.iframes[ElementPaymentMethod.AUTH_ELEMENT] = result;
701
707
  });
702
708
  return {};
703
709
  }
710
+ }, {
711
+ key: "mountErrorHandle",
712
+ value: function mountErrorHandle() {
713
+ var _this$_options$onEven2, _this$_options3;
714
+ console.log('demo event callback----', {
715
+ code: EventCallbackCode.FAILED,
716
+ message: 'INTERNAL_FAILED'
717
+ });
718
+ (_this$_options$onEven2 = (_this$_options3 = this._options).onEventCallback) === null || _this$_options$onEven2 === void 0 || _this$_options$onEven2.call(_this$_options3, {
719
+ code: EventCallbackCode.FAILED,
720
+ message: 'INTERNAL_FAILED'
721
+ });
722
+ logger.logError({
723
+ title: 'a3753.b101271.c386691'
724
+ });
725
+ }
704
726
  }, {
705
727
  key: "mount",
706
728
  value: function mount(renderOptions, sdkSelector) {
729
+ logger.logInfo({
730
+ title: 'a3753.b101271.c386690'
731
+ });
707
732
  if (typeof sdkSelector === 'string') {
708
733
  var _this$_options$loadin4, _renderOptions$debugP, _renderOptions$debugP2;
709
734
  var element = document.querySelector(sdkSelector);
710
735
  if (!element) {
711
- var _this$_options$onEven2, _this$_options3;
712
- (_this$_options$onEven2 = (_this$_options3 = this._options).onEventCallback) === null || _this$_options$onEven2 === void 0 || _this$_options$onEven2.call(_this$_options3, {
713
- code: EventCallbackCode.Failed,
714
- message: 'Unable to obtain selector'
715
- });
716
- return undefined;
736
+ return this.mountErrorHandle();
717
737
  }
718
738
  this.componentsCount = this.componentsCount + 1;
719
739
  if (!this.loading && (_this$_options$loadin4 = this._options.loading) !== null && _this$_options$loadin4 !== void 0 && _this$_options$loadin4.onStartLoading && this.isConnect) {
@@ -735,11 +755,7 @@ export var ElementComponent = /*#__PURE__*/function () {
735
755
  return this.mountPayment(renderOptions, sdkSelector);
736
756
  }
737
757
  } else {
738
- this._options.onEventCallback({
739
- code: EventCallbackCode.Failed,
740
- message: 'Invalid argument for mount method'
741
- });
742
- return undefined;
758
+ return this.mountErrorHandle();
743
759
  }
744
760
  }
745
761
 
@@ -777,7 +793,7 @@ export var ElementComponent = /*#__PURE__*/function () {
777
793
  function () {
778
794
  var _submitPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
779
795
  var _this$_options$loadin7, _this$_options$loadin10;
780
- var _this$_options$loadin8, _this$_options$loadin9, validateRes, _this$_options$loadin11, _this$_options$loadin12;
796
+ var _this$_options$loadin8, _this$_options$loadin9, _this$_options$loadin11, _this$_options$loadin12;
781
797
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
782
798
  while (1) switch (_context2.prev = _context2.next) {
783
799
  case 0:
@@ -789,19 +805,11 @@ export var ElementComponent = /*#__PURE__*/function () {
789
805
  _context2.next = 3;
790
806
  return this.validatePromiseFuncs();
791
807
  case 3:
792
- validateRes = _context2.sent;
793
- if (!validateRes) {
794
- _context2.next = 7;
795
- break;
796
- }
797
- _context2.next = 7;
798
- return this.onSubmit(validateRes);
799
- case 7:
800
808
  if ((_this$_options$loadin10 = this._options.loading) !== null && _this$_options$loadin10 !== void 0 && _this$_options$loadin10.onEndLoading) {
801
809
  (_this$_options$loadin11 = this._options.loading) === null || _this$_options$loadin11 === void 0 || (_this$_options$loadin12 = _this$_options$loadin11.onEndLoading) === null || _this$_options$loadin12 === void 0 || _this$_options$loadin12.call(_this$_options$loadin11);
802
810
  }
803
811
  return _context2.abrupt("return");
804
- case 9:
812
+ case 5:
805
813
  case "end":
806
814
  return _context2.stop();
807
815
  }
@@ -1,4 +1,6 @@
1
1
  export declare const sdkAction: any;
2
+ export declare const oneAccount1: any;
3
+ export declare const oneAccount2: any;
2
4
  export declare const oneAccount: any;
3
5
  export declare const paymentResult: any;
4
6
  export declare const submitResult: any;
@@ -361,7 +361,7 @@ export var sdkAction = {
361
361
  },
362
362
  success: true
363
363
  };
364
- export var oneAccount = {
364
+ export var oneAccount1 = {
365
365
  accountInfo: {
366
366
  accountStatus: 'EFFECTIVE',
367
367
  email: 'test10@test.com',
@@ -375,7 +375,23 @@ export var oneAccount = {
375
375
  },
376
376
  errorActions: {},
377
377
  extendInfo: {},
378
- paymentMethods: [],
378
+ paymentMethods: [{
379
+ paymentMethodType: 'CARD',
380
+ iconName: 'VISA',
381
+ icon: 'https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg',
382
+ paymentMethodId: 'card-id',
383
+ paymentMethodDetail: {
384
+ last4: '**** 1233'
385
+ }
386
+ }, {
387
+ paymentMethodType: 'CARD',
388
+ iconName: 'VISA2',
389
+ icon: 'https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg',
390
+ paymentMethodId: 'card-id2',
391
+ paymentMethodDetail: {
392
+ last4: '**** 1235'
393
+ }
394
+ }],
379
395
  shippings: [{
380
396
  notes: '',
381
397
  prefer: '1',
@@ -397,6 +413,66 @@ export var oneAccount = {
397
413
  }],
398
414
  success: true
399
415
  };
416
+ export var oneAccount2 = {
417
+ accountInfo: {
418
+ email: 'xxxxx@163.com',
419
+ accountStatus: 'UNREGISTERED'
420
+ },
421
+ goods: {
422
+ goodsName: 'xxxxx@163.com',
423
+ goodsImageUrl: '',
424
+ goodsQuantity: 100,
425
+ goodsUnitAmount: {
426
+ currency: 'EUR',
427
+ value: 100,
428
+ currencyLabel: ''
429
+ }
430
+ },
431
+ paymentMethods: [],
432
+ links: {
433
+ privacyLink: 'https://global.alipay.com/docs/ac/Platform/bahzqeb-',
434
+ cookieLink: 'https://global.alipay.com/docs/ac/Platform/x1rhufzj'
435
+ },
436
+ metaData: {
437
+ countryList: [{
438
+ countryName: 'China',
439
+ default: true
440
+ }, {
441
+ countryName: 'Singapore',
442
+ default: false
443
+ }]
444
+ },
445
+ errorActions: {},
446
+ extendInfo: {},
447
+ merchantId: '111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=',
448
+ needInstallmentAbility: false,
449
+ needOtherElements: false,
450
+ orderDescription: 'AMSDM_GIFT',
451
+ success: true,
452
+ supportedLanguages: [{
453
+ locale: 'en_US',
454
+ preferred: true,
455
+ title: 'English'
456
+ }, {
457
+ country: 'BR',
458
+ locale: 'pt_BR',
459
+ preferred: false,
460
+ title: 'Português'
461
+ }, {
462
+ country: 'KR',
463
+ locale: 'ko_KR',
464
+ preferred: false,
465
+ title: '한국어'
466
+ }, {
467
+ country: 'MX,CL,PE',
468
+ locale: 'es_ES',
469
+ preferred: false,
470
+ title: 'Español'
471
+ }]
472
+ };
473
+ export var oneAccount = oneAccount1;
474
+ // export const oneAccount = oneAccount2;
475
+
400
476
  export var paymentResult = {
401
477
  success: true,
402
478
  data: {
@@ -429,63 +505,63 @@ export var paymentResult = {
429
505
  target: 'CONTAINER_ELEMENT'
430
506
  };
431
507
  export var submitResult = {
432
- "actionForm": {
433
- "actionFormType": "RedirectActionForm",
434
- "method": "GET",
435
- "normalUrl": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8",
436
- "redirectUrl": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8"
508
+ actionForm: {
509
+ actionFormType: 'RedirectActionForm',
510
+ method: 'GET',
511
+ normalUrl: 'https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8',
512
+ redirectUrl: 'https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8'
437
513
  },
438
- "codeFormViews": [{
439
- "code": "https://global.alipay.com/281002040092rqa01k6Ed31LA96JETxv4IP8",
440
- "codeExpireTime": "1732567070000",
441
- "displayType": "QRCODE"
514
+ codeFormViews: [{
515
+ code: 'https://global.alipay.com/281002040092rqa01k6Ed31LA96JETxv4IP8',
516
+ codeExpireTime: '1732567070000',
517
+ displayType: 'QRCODE'
442
518
  }],
443
- "errorActions": {},
444
- "extendInfo": {
445
- "iconName": "AlipayHK",
446
- "paymentRedirectUrl": "http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=amsdmpay_20240410_143002_4shkjh123",
447
- "icon": "https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",
448
- "paymentMethod": "ALIPAY_HK"
519
+ errorActions: {},
520
+ extendInfo: {
521
+ iconName: 'AlipayHK',
522
+ paymentRedirectUrl: 'http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=amsdmpay_20240410_143002_4shkjh123',
523
+ icon: 'https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg',
524
+ paymentMethod: 'ALIPAY_HK'
449
525
  },
450
- "orderAmount": {
451
- "amount": "1.10",
452
- "currency": "EUR",
453
- "currencyLabel": "",
454
- "formattedAmount": "1,10",
455
- "formattedAmountWithCurrency": "€ 1,10",
456
- "value": "110"
526
+ orderAmount: {
527
+ amount: '1.10',
528
+ currency: 'EUR',
529
+ currencyLabel: '',
530
+ formattedAmount: '1,10',
531
+ formattedAmountWithCurrency: '€ 1,10',
532
+ value: '110'
457
533
  },
458
- "orderAmountView": {
459
- "currency": "EUR",
460
- "currencyDivider": " ",
461
- "currencyLabel": "",
462
- "currencySymbolPosition": "L",
463
- "formattedValue": "1,10",
464
- "value": "1.10"
534
+ orderAmountView: {
535
+ currency: 'EUR',
536
+ currencyDivider: ' ',
537
+ currencyLabel: '',
538
+ currencySymbolPosition: 'L',
539
+ formattedValue: '1,10',
540
+ value: '1.10'
465
541
  },
466
- "paymentAmount": {
467
- "amount": "1.10",
468
- "currency": "EUR",
469
- "currencyLabel": "",
470
- "formattedAmount": "1,10",
471
- "formattedAmountWithCurrency": "€ 1,10",
472
- "value": "110"
542
+ paymentAmount: {
543
+ amount: '1.10',
544
+ currency: 'EUR',
545
+ currencyLabel: '',
546
+ formattedAmount: '1,10',
547
+ formattedAmountWithCurrency: '€ 1,10',
548
+ value: '110'
473
549
  },
474
- "paymentAmountView": {
475
- "currency": "EUR",
476
- "currencyDivider": " ",
477
- "currencyLabel": "",
478
- "currencySymbolPosition": "L",
479
- "formattedValue": "1,10",
480
- "value": "1.10"
550
+ paymentAmountView: {
551
+ currency: 'EUR',
552
+ currencyDivider: ' ',
553
+ currencyLabel: '',
554
+ currencySymbolPosition: 'L',
555
+ formattedValue: '1,10',
556
+ value: '1.10'
481
557
  },
482
- "paymentMethodType": "ALIPAY_HK",
483
- "paymentResultCode": "PAYMENT_IN_PROCESS",
484
- "paymentStatus": "PROCESSING",
485
- "serverTime": "1731566233772",
486
- "success": true,
487
- "supportedLanguages": [{
488
- "locale": "en_US",
489
- "preferred": true
558
+ paymentMethodType: 'ALIPAY_HK',
559
+ paymentResultCode: 'PAYMENT_IN_PROCESS',
560
+ paymentStatus: 'PROCESSING',
561
+ serverTime: '1731566233772',
562
+ success: true,
563
+ supportedLanguages: [{
564
+ locale: 'en_US',
565
+ preferred: true
490
566
  }]
491
567
  };
@@ -12,8 +12,8 @@ export declare const addressTheme: {
12
12
  night: string;
13
13
  };
14
14
  export declare enum EventCallbackCode {
15
- Failed = "Failed",
16
- Completed = "Completed"
15
+ FAILED = "FAILED",
16
+ SUCCESS = "SUCCESS"
17
17
  }
18
18
  export declare enum ELEMENT_ENVIRONMENT {
19
19
  DEV = "DEV",
@@ -13,8 +13,8 @@ export var ThemeType = /*#__PURE__*/function (ThemeType) {
13
13
  }({});
14
14
  export var addressTheme = _defineProperty(_defineProperty({}, ThemeType.Default, 'LIGHT'), ThemeType.Night, 'NIGHT');
15
15
  export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
16
- EventCallbackCode["Failed"] = "Failed";
17
- EventCallbackCode["Completed"] = "Completed";
16
+ EventCallbackCode["FAILED"] = "FAILED";
17
+ EventCallbackCode["SUCCESS"] = "SUCCESS";
18
18
  return EventCallbackCode;
19
19
  }({});
20
20
  export var ELEMENT_ENVIRONMENT = /*#__PURE__*/function (ELEMENT_ENVIRONMENT) {