@alipay/ams-checkout 0.0.1730706734-dev.7 → 0.0.1730706734-dev.9

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.23.0";
9
- export declare const AMSAutoDebitAppVersion = "1.23.0";
10
- export declare const AMSEasyPayAppVersion = "1.23.0";
11
- export declare const AMSCashierPaymentAppVersion = "1.23.0";
12
- export declare const AMSVaultingAppVersion = "1.23.0";
13
- export declare const AMSPaymentElementAppVersion = "1.23.0";
14
- export declare const ADDRESSElementAppVersion = "1.23.0";
8
+ export declare const AMSCheckoutAppVersion = "1.24.0";
9
+ export declare const AMSAutoDebitAppVersion = "1.24.0";
10
+ export declare const AMSEasyPayAppVersion = "1.24.0";
11
+ export declare const AMSCashierPaymentAppVersion = "1.24.0";
12
+ export declare const AMSVaultingAppVersion = "1.24.0";
13
+ export declare const AMSPaymentElementAppVersion = "1.24.0";
14
+ export declare const ADDRESSElementAppVersion = "1.24.0";
@@ -26,19 +26,19 @@ export var elementAppMarmotMap = {
26
26
  dev: 'http://page.alipay.net/page/antom-web-checkout-v2',
27
27
  sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2',
28
28
  pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2',
29
- sandbox: 'https://ac.alipay.com/page/antom-web-checkout-v2',
30
- light_sandbox: 'https://ac.alipay.com/page/antom-web-checkout-v2',
31
- prod: 'https://ac.alipay.com/page/antom-web-checkout-v2'
29
+ sandbox: 'https://checkout.antom.com',
30
+ light_sandbox: 'https://checkout.antom.com',
31
+ prod: 'https://checkout.antom.com'
32
32
  };
33
33
  export var sdkVersion = json.version;
34
34
 
35
35
  /**
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
37
37
  */
38
- export var AMSCheckoutAppVersion = '1.23.0'; // 兜底版本号
39
- export var AMSAutoDebitAppVersion = '1.23.0'; // 代扣
40
- export var AMSEasyPayAppVersion = '1.23.0'; // easypay
41
- export var AMSCashierPaymentAppVersion = '1.23.0'; // 收银台(卡、apm)
42
- export var AMSVaultingAppVersion = '1.23.0'; // 绑卡
43
- export var AMSPaymentElementAppVersion = '1.23.0'; // payment element
44
- export var ADDRESSElementAppVersion = '1.23.0'; // address element
38
+ export var AMSCheckoutAppVersion = '1.24.0'; // 兜底版本号
39
+ export var AMSAutoDebitAppVersion = '1.24.0'; // 代扣
40
+ export var AMSEasyPayAppVersion = '1.24.0'; // easypay
41
+ export var AMSCashierPaymentAppVersion = '1.24.0'; // 收银台(卡、apm)
42
+ export var AMSVaultingAppVersion = '1.24.0'; // 绑卡
43
+ export var AMSPaymentElementAppVersion = '1.24.0'; // payment element
44
+ export var ADDRESSElementAppVersion = '1.24.0'; // address element
@@ -13,12 +13,13 @@ var CKP_PAYMENT_PAGE_HOST = {
13
13
  DEV: 'https://dev.page.alipay.net',
14
14
  TEST: 'https://test.page.alipay.net',
15
15
  PRE: 'https://pre.ac.alipay.com',
16
- PROD: 'https://ac.alipay.com'
16
+ PROD: 'https://checkout.antom.com'
17
17
  };
18
18
 
19
19
  // for local development
20
20
 
21
21
  var CKP_PAGE_ADDRESS = '/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html';
22
+ var CKP_PAGE_NEW_ADDRESS = '/checkout-page/pages/payment/index.html';
22
23
  export var getCKPPageAddress = function getCKPPageAddress(env) {
23
24
  switch (env) {
24
25
  case 'dev':
@@ -30,7 +31,7 @@ export var getCKPPageAddress = function getCKPPageAddress(env) {
30
31
  case 'prod':
31
32
  case 'sandbox':
32
33
  case 'light_sandbox':
33
- return "".concat(CKP_PAYMENT_PAGE_HOST.PROD).concat(CKP_PAGE_ADDRESS);
34
+ return "".concat(CKP_PAYMENT_PAGE_HOST.PROD).concat(CKP_PAGE_NEW_ADDRESS);
34
35
  default:
35
36
  // for local development, e.g. http://localhost:5173/checkout-page/src/pages/payment/index.html
36
37
  return env;
@@ -318,14 +318,14 @@ export var ElementComponent = /*#__PURE__*/function () {
318
318
  });
319
319
  });
320
320
  // 发送validate消息
321
- _defineProperty(this, "onValidateFunc", function (target) {
321
+ _defineProperty(this, "onValidateFunc", function (target, params) {
322
322
  return new Promise(function (resolve) {
323
323
  _this4.eventService.emitAndListen({
324
324
  event: ElementPaymentEvent.VALIDATE,
325
325
  data: {
326
326
  target: target,
327
327
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
328
- params: {}
328
+ params: params
329
329
  }
330
330
  }, function (result) {
331
331
  resolve(result);
@@ -373,31 +373,39 @@ export var ElementComponent = /*#__PURE__*/function () {
373
373
  }
374
374
  return _context.abrupt("return", resolve(undefined));
375
375
  case 17:
376
- if (!_this4.launchSource.includes(ElementPaymentMethod.PAYMENT_ELEMENT)) {
377
- _context.next = 26;
376
+ if (!(_this4.launchSource.includes(ElementPaymentMethod.PAYMENT_ELEMENT) || !_this4.isConnect)) {
377
+ _context.next = 32;
378
378
  break;
379
379
  }
380
- _context.next = 20;
381
- return _this4.onValidateFunc(ElementPaymentMethod.PAYMENT_ELEMENT);
382
- case 20:
380
+ _context.prev = 18;
381
+ _context.next = 21;
382
+ return _this4.onValidateFunc(ElementPaymentMethod.PAYMENT_ELEMENT, params);
383
+ case 21:
383
384
  _result2 = _context.sent;
384
- console.log('element submit validate payment---------', _result2);
385
+ console.log('element submit validate payment---------', _result2, _this4.isConnect);
385
386
  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;
386
387
  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;
387
388
  if (_result2 !== null && _result2 !== void 0 && (_result2$data3 = _result2.data) !== null && _result2$data3 !== void 0 && _result2$data3.success) {
388
- _context.next = 26;
389
+ _context.next = 27;
389
390
  break;
390
391
  }
391
392
  return _context.abrupt("return", resolve(undefined));
392
- case 26:
393
+ case 27:
394
+ _context.next = 32;
395
+ break;
396
+ case 29:
397
+ _context.prev = 29;
398
+ _context.t0 = _context["catch"](18);
399
+ return _context.abrupt("return", resolve(undefined));
400
+ case 32:
393
401
  // params.paymentFactors = paymentResult.data?.data.paymentFactors;
394
402
  // params.paymentMethod = paymentResult.data?.data.paymentMethod;
395
403
  resolve(params);
396
- case 27:
404
+ case 33:
397
405
  case "end":
398
406
  return _context.stop();
399
407
  }
400
- }, _callee);
408
+ }, _callee, null, [[18, 29]]);
401
409
  }));
402
410
  return function (_x) {
403
411
  return _ref.apply(this, arguments);
@@ -83,6 +83,7 @@ export default class ComponentApp {
83
83
  * @description Processing messages from iframe
84
84
  */
85
85
  _handleAppMessage(data: EventPayload): void;
86
+ private logEventCallback;
86
87
  private dismissLoadingFunc;
87
88
  private handleSizeChanged;
88
89
  private handleAuthUrlInfo;
@@ -1317,8 +1317,36 @@ var ComponentApp = /*#__PURE__*/function () {
1317
1317
  return;
1318
1318
  }
1319
1319
 
1320
- // The plug-in communicates with the sdk after processing
1321
- this.dispatchToSDK(data.context.event, data.context.data, data.context.eventCallbackId);
1320
+ // log event before sending the callback
1321
+ this.logEventCallback(data, "sdk_event_event_callback");
1322
+ try {
1323
+ // The plug-in communicates with the sdk after processing
1324
+ this.dispatchToSDK(data.context.event, data.context.data, data.context.eventCallbackId);
1325
+ // log event after sending the callback
1326
+ this.logEventCallback(data, "sdk_event_afterEventCallback");
1327
+ } catch (e) {
1328
+ console.error(e);
1329
+ }
1330
+ }
1331
+ }, {
1332
+ key: "logEventCallback",
1333
+ value: function logEventCallback(data, title) {
1334
+ if (data.context.event === EVENT.eventCallback.name) {
1335
+ var _data$context4;
1336
+ var callbackData = "";
1337
+ try {
1338
+ var _data$context3;
1339
+ callbackData = JSON.stringify((data === null || data === void 0 || (_data$context3 = data.context) === null || _data$context3 === void 0 ? void 0 : _data$context3.data) || "");
1340
+ } catch (e) {
1341
+ console.error(e);
1342
+ }
1343
+ this.AMSSDK.logger.logInfo({
1344
+ title: title
1345
+ }, {
1346
+ callbackData: callbackData,
1347
+ callbackId: (data === null || data === void 0 || (_data$context4 = data.context) === null || _data$context4 === void 0 ? void 0 : _data$context4.eventCallbackId) || ""
1348
+ }).send();
1349
+ }
1322
1350
  }
1323
1351
  }, {
1324
1352
  key: "dismissLoadingFunc",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1730706734-dev.7",
3
+ "version": "0.0.1730706734-dev.9",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",