@pisell/private-materials 6.3.14 → 6.3.15

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.
Files changed (104) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +13 -13
  7. package/build/lowcode/render/default/view.js +9 -9
  8. package/build/lowcode/view.js +9 -9
  9. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  10. package/es/components/booking/components/browserSelect/index.js +1 -1
  11. package/es/components/booking/forms/model.js +5 -5
  12. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  13. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  14. package/es/components/booking/info/service/like/index.js +1 -1
  15. package/es/components/booking/info/service2/utils.d.ts +1 -1
  16. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  17. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  18. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  19. package/es/components/booking/notes/model.js +5 -5
  20. package/es/components/booking/payments/model.js +5 -5
  21. package/es/components/eftposPay/amount.d.ts +1 -1
  22. package/es/components/eftposPay/device.d.ts +1 -1
  23. package/es/components/eftposPay/hooks.d.ts +1 -1
  24. package/es/components/eftposPay/store/index.d.ts +2 -2
  25. package/es/components/listComponent/index.js +5 -5
  26. package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
  27. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
  28. package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
  29. package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
  30. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
  31. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
  32. package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
  33. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
  34. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
  35. package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
  36. package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
  37. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
  38. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
  39. package/es/components/pay/toC/index.js +278 -118
  40. package/es/components/productExtension/card/index.js +3 -3
  41. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  42. package/es/components/productExtension/fields/Forms/index.js +12 -12
  43. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  44. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  45. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  46. package/es/components/productExtension/server.js +2 -2
  47. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  48. package/es/components/schedules/calendar/index.js +4 -4
  49. package/es/components/schedules/calendar/serve.js +2 -2
  50. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  51. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  52. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  53. package/es/components/schedules/components/ResourceList/index.js +1 -1
  54. package/es/components/schedules/components/Search/index.js +5 -5
  55. package/es/components/schedules/model.js +5 -5
  56. package/es/components/schedules/openHours/index.js +1 -1
  57. package/es/components/schedules/openHours/serve.js +2 -2
  58. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  59. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  60. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  61. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  62. package/es/components/schedules/products/serve.js +2 -2
  63. package/es/components/schedules/products/utils.js +5 -5
  64. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  65. package/es/components/schedules/resources/detail/index.js +10 -10
  66. package/es/components/schedules/resources/list/index.js +2 -2
  67. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  68. package/es/components/schedules/resources/serve.js +2 -2
  69. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  70. package/es/components/schedules/utils.d.ts +1 -1
  71. package/es/components/schedules/utils.js +4 -4
  72. package/es/components/selectModal/index.js +2 -2
  73. package/es/hooks/useComponents.js +1 -1
  74. package/es/hooks/usePaymentLogger.d.ts +22 -0
  75. package/es/hooks/usePaymentLogger.js +78 -0
  76. package/es/utils/index.d.ts +1 -1
  77. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  78. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  79. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  80. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  81. package/lib/components/eftposPay/amount.d.ts +1 -1
  82. package/lib/components/eftposPay/device.d.ts +1 -1
  83. package/lib/components/eftposPay/hooks.d.ts +1 -1
  84. package/lib/components/eftposPay/store/index.d.ts +2 -2
  85. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
  86. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
  87. package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
  88. package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
  89. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
  90. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
  91. package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
  92. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
  93. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
  94. package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
  95. package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
  96. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
  97. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
  98. package/lib/components/pay/toC/index.js +183 -48
  99. package/lib/components/schedules/utils.d.ts +1 -1
  100. package/lib/components/schedules/utils.js +1 -1
  101. package/lib/hooks/usePaymentLogger.d.ts +22 -0
  102. package/lib/hooks/usePaymentLogger.js +69 -0
  103. package/lib/utils/index.d.ts +1 -1
  104. package/package.json +4 -4
@@ -11,6 +11,7 @@ import { useImperativeHandle, forwardRef, useContext } from 'react';
11
11
  import { customPaymentApi } from "./serve";
12
12
  import { Context } from "../../model";
13
13
  import { getPayGroupParamsFromStorage } from "../../payGroup";
14
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
14
15
  import "./index.less";
15
16
  /**
16
17
  * @title: cash 支付
@@ -22,9 +23,16 @@ import "./index.less";
22
23
  * @Date: 2024-08-16 11:00
23
24
  */
24
25
  var CashManual = function CashManual(props, ref) {
26
+ var _state$payGroup;
25
27
  var _useContext = useContext(Context),
26
28
  state = _useContext.state;
27
29
 
30
+ // CashManual支付日志记录器
31
+ var paymentLogger = usePaymentLogger({
32
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
33
+ step: '2'
34
+ });
35
+
28
36
  /**
29
37
  * @title: 初始化
30
38
  * @description:
@@ -35,35 +43,89 @@ var CashManual = function CashManual(props, ref) {
35
43
  */
36
44
  var init = /*#__PURE__*/function () {
37
45
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
38
- var _state$payGroup, _state$payGroup2;
46
+ var _state$payGroup2, _state$payGroup3;
39
47
  var payGroup, current, orderId, values;
40
48
  return _regeneratorRuntime().wrap(function _callee$(_context) {
41
49
  while (1) switch (_context.prev = _context.next) {
42
50
  case 0:
43
51
  payGroup = _ref.payGroup;
44
- current = ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.otherPayment) || {};
45
- orderId = (payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id) || ((_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.order_id); // 交易组信息
52
+ // 记录CashManual初始化开始
53
+ paymentLogger.addLog({
54
+ key: 'CashManual初始化开始',
55
+ value: ""
56
+ });
57
+ current = ((_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.otherPayment) || {};
58
+ orderId = (payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id) || ((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id); // 交易组信息
46
59
  values = getPayGroupParamsFromStorage(orderId);
47
- _context.prev = 4;
48
- _context.next = 7;
60
+ if (values) {
61
+ _context.next = 9;
62
+ break;
63
+ }
64
+ // 记录获取支付参数失败
65
+ paymentLogger.addLog({
66
+ key: 'CashManual获取支付参数失败',
67
+ value: {
68
+ title: "\u8BA2\u5355".concat(orderId, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
69
+ data: {
70
+ payGroup: payGroup
71
+ }
72
+ }
73
+ });
74
+ paymentLogger.sendLogs('CashManual获取支付参数失败');
75
+ return _context.abrupt("return");
76
+ case 9:
77
+ // 记录获取支付参数成功
78
+ paymentLogger.addLog({
79
+ key: 'CashManual获取支付参数成功',
80
+ value: ""
81
+ });
82
+ _context.prev = 10;
83
+ // 记录开始调用支付API
84
+ paymentLogger.addLog({
85
+ key: 'CashManual开始支付API调用',
86
+ value: ""
87
+ });
88
+
89
+ // 支付
90
+ _context.next = 14;
49
91
  return customPaymentApi(orderId, _objectSpread({
50
92
  params: current.params
51
93
  }, values));
52
- case 7:
94
+ case 14:
95
+ // 记录支付API调用成功
96
+ paymentLogger.addLog({
97
+ key: 'CashManual支付API调用成功',
98
+ value: ""
99
+ });
100
+ paymentLogger.sendLogs('CashManual支付成功');
101
+
53
102
  // 回调
54
103
  state.payCallback({
55
104
  key: 'success'
56
105
  });
57
- _context.next = 12;
106
+ _context.next = 23;
58
107
  break;
59
- case 10:
60
- _context.prev = 10;
61
- _context.t0 = _context["catch"](4);
62
- case 12:
108
+ case 19:
109
+ _context.prev = 19;
110
+ _context.t0 = _context["catch"](10);
111
+ // 记录CashManual支付错误
112
+ paymentLogger.addLog({
113
+ key: 'CashManual支付错误',
114
+ value: {
115
+ title: "\u8BA2\u5355".concat(orderId, " CashManual\u652F\u4ED8\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
116
+ data: {
117
+ payGroup: payGroup,
118
+ current: current,
119
+ values: values
120
+ }
121
+ }
122
+ });
123
+ paymentLogger.sendLogs('CashManual支付失败', _context.t0);
124
+ case 23:
63
125
  case "end":
64
126
  return _context.stop();
65
127
  }
66
- }, _callee, null, [[4, 10]]);
128
+ }, _callee, null, [[10, 19]]);
67
129
  }));
68
130
  return function init(_x) {
69
131
  return _ref2.apply(this, arguments);
@@ -11,6 +11,7 @@ import { useImperativeHandle, forwardRef, useContext } from 'react';
11
11
  import { customPaymentApi } from "./serve";
12
12
  import { Context } from "../../model";
13
13
  import { getPayGroupParamsFromStorage } from "../../payGroup";
14
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
14
15
  import "./index.less";
15
16
  /**
16
17
  * @title: 自定义支付
@@ -22,9 +23,16 @@ import "./index.less";
22
23
  * @Date: 2024-08-16 11:01
23
24
  */
24
25
  var CustomPayment = function CustomPayment(props, ref) {
26
+ var _state$payGroup;
25
27
  var _useContext = useContext(Context),
26
28
  state = _useContext.state;
27
29
 
30
+ // CustomPayment支付日志记录器
31
+ var paymentLogger = usePaymentLogger({
32
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
33
+ step: '2'
34
+ });
35
+
28
36
  /**
29
37
  * @title: 初始化
30
38
  * @description:
@@ -35,34 +43,87 @@ var CustomPayment = function CustomPayment(props, ref) {
35
43
  */
36
44
  var init = /*#__PURE__*/function () {
37
45
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
38
- var _state$payGroup, _state$payGroup2;
46
+ var _state$payGroup2, _state$payGroup3;
39
47
  var payGroup, current, orderId, values;
40
48
  return _regeneratorRuntime().wrap(function _callee$(_context) {
41
49
  while (1) switch (_context.prev = _context.next) {
42
50
  case 0:
43
51
  payGroup = _ref.payGroup;
44
- current = ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.otherPayment) || {};
45
- orderId = (payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id) || ((_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.order_id); // 获取交易组
52
+ // 记录CustomPayment初始化开始
53
+ paymentLogger.addLog({
54
+ key: 'CustomPayment初始化开始',
55
+ value: ""
56
+ });
57
+ current = ((_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.otherPayment) || {};
58
+ orderId = (payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id) || ((_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id); // 获取交易组
46
59
  values = getPayGroupParamsFromStorage(orderId);
47
- _context.prev = 4;
48
- _context.next = 7;
60
+ if (values) {
61
+ _context.next = 9;
62
+ break;
63
+ }
64
+ // 记录获取支付参数失败
65
+ paymentLogger.addLog({
66
+ key: 'CustomPayment获取支付参数失败',
67
+ value: {
68
+ title: "\u8BA2\u5355".concat(orderId, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
69
+ data: {
70
+ payGroup: payGroup
71
+ }
72
+ }
73
+ });
74
+ paymentLogger.sendLogs('CustomPayment获取支付参数失败');
75
+ return _context.abrupt("return");
76
+ case 9:
77
+ // 记录获取支付参数成功
78
+ paymentLogger.addLog({
79
+ key: 'CustomPayment获取支付参数成功',
80
+ value: ""
81
+ });
82
+ _context.prev = 10;
83
+ // 记录开始调用支付API
84
+ paymentLogger.addLog({
85
+ key: 'CustomPayment开始支付API调用',
86
+ value: ""
87
+ });
88
+ _context.next = 14;
49
89
  return customPaymentApi(orderId, _objectSpread({
50
90
  params: current.params
51
91
  }, values));
52
- case 7:
92
+ case 14:
93
+ // 记录支付API调用成功
94
+ paymentLogger.addLog({
95
+ key: 'CustomPayment支付API调用成功',
96
+ value: ""
97
+ });
98
+ paymentLogger.sendLogs('CustomPayment支付成功');
99
+
100
+ // 回调
53
101
  state.payCallback({
54
102
  key: 'success'
55
103
  });
56
- _context.next = 12;
104
+ _context.next = 23;
57
105
  break;
58
- case 10:
59
- _context.prev = 10;
60
- _context.t0 = _context["catch"](4);
61
- case 12:
106
+ case 19:
107
+ _context.prev = 19;
108
+ _context.t0 = _context["catch"](10);
109
+ // 记录CustomPayment支付错误
110
+ paymentLogger.addLog({
111
+ key: 'CustomPayment支付错误',
112
+ value: {
113
+ title: "\u8BA2\u5355".concat(orderId, " CustomPayment\u652F\u4ED8\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
114
+ data: {
115
+ payGroup: payGroup,
116
+ current: current,
117
+ values: values
118
+ }
119
+ }
120
+ });
121
+ paymentLogger.sendLogs('CustomPayment支付失败', _context.t0);
122
+ case 23:
62
123
  case "end":
63
124
  return _context.stop();
64
125
  }
65
- }, _callee, null, [[4, 10]]);
126
+ }, _callee, null, [[10, 19]]);
66
127
  }));
67
128
  return function init(_x) {
68
129
  return _ref2.apply(this, arguments);
@@ -15,6 +15,7 @@ import ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
15
15
  import { getAliPayUrl } from "./serve";
16
16
  import { Context } from "../../model";
17
17
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
18
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
18
19
  import "./index.less";
19
20
  /**
20
21
  * @title: 支付宝支付
@@ -24,6 +25,7 @@ import "./index.less";
24
25
  * @Date: 2024-08-16 11:18
25
26
  */
26
27
  var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
28
+ var _state$payGroup;
27
29
  var _useContext = useContext(Context),
28
30
  state = _useContext.state;
29
31
  var onChange = props.onChange;
@@ -36,6 +38,12 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
36
38
  showSuccessBackButton = _useState4[0],
37
39
  setShowSuccessBackButton = _useState4[1];
38
40
 
41
+ // GlobePayAliPayH5支付日志记录器
42
+ var paymentLogger = usePaymentLogger({
43
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
44
+ step: '2'
45
+ });
46
+
39
47
  /**
40
48
  * @title: 初始化
41
49
  * @description:
@@ -51,43 +59,111 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
51
59
  while (1) switch (_context.prev = _context.next) {
52
60
  case 0:
53
61
  payGroup = _ref.payGroup;
62
+ // 记录GlobePayAliPayH5初始化开始
63
+ paymentLogger.addLog({
64
+ key: 'GlobePayAliPayH5初始化开始',
65
+ value: ""
66
+ });
54
67
  setOpen(true);
55
68
 
56
69
  // 交易组
57
70
  values = getPayGroupParamsFromStorage(payGroup.order_id);
58
71
  if (values) {
59
- _context.next = 6;
72
+ _context.next = 9;
60
73
  break;
61
74
  }
75
+ // 记录获取支付参数失败
76
+ paymentLogger.addLog({
77
+ key: 'GlobePayAliPayH5获取支付参数失败',
78
+ value: {
79
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
80
+ data: {
81
+ payGroup: payGroup
82
+ }
83
+ }
84
+ });
85
+ paymentLogger.sendLogs('GlobePayAliPayH5获取支付参数失败');
62
86
  setOpen(false);
63
87
  return _context.abrupt("return");
64
- case 6:
65
- _context.prev = 6;
66
- _context.next = 9;
67
- return getAliPayUrl(payGroup.order_id, values);
68
88
  case 9:
89
+ // 记录获取支付参数成功
90
+ paymentLogger.addLog({
91
+ key: 'GlobePayAliPayH5获取支付参数成功',
92
+ value: ""
93
+ });
94
+ _context.prev = 10;
95
+ // 记录开始获取支付宝支付链接
96
+ paymentLogger.addLog({
97
+ key: 'GlobePayAliPayH5开始获取支付链接',
98
+ value: ""
99
+ });
100
+
101
+ // 获取支付宝支付链接
102
+ _context.next = 14;
103
+ return getAliPayUrl(payGroup.order_id, values);
104
+ case 14:
69
105
  data = _context.sent;
70
106
  url = data.url || (data === null || data === void 0 ? void 0 : data.pay_url);
71
107
  if (url) {
108
+ // 记录获取支付链接成功
109
+ paymentLogger.addLog({
110
+ key: 'GlobePayAliPayH5获取支付链接成功',
111
+ value: ""
112
+ });
113
+
72
114
  // 设置交易号
73
115
  setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
116
+
117
+ // 记录准备跳转支付宝
118
+ paymentLogger.addLog({
119
+ key: 'GlobePayAliPayH5准备跳转支付宝',
120
+ value: ""
121
+ });
74
122
  setShowSuccessBackButton(true);
123
+
124
+ // 在跳转前发送日志
125
+ paymentLogger.sendLogs('GlobePayAliPayH5跳转成功');
126
+
75
127
  // 跳转
76
128
  window.location.href = url;
77
129
  } else {
130
+ // 记录未获取到支付链接
131
+ paymentLogger.addLog({
132
+ key: 'GlobePayAliPayH5未获取到支付链接',
133
+ value: {
134
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
135
+ data: {
136
+ payGroup: payGroup,
137
+ response: data
138
+ }
139
+ }
140
+ });
141
+ paymentLogger.sendLogs('GlobePayAliPayH5未获取到支付链接');
78
142
  setOpen(false);
79
143
  }
80
- _context.next = 17;
144
+ _context.next = 24;
81
145
  break;
82
- case 14:
83
- _context.prev = 14;
84
- _context.t0 = _context["catch"](6);
146
+ case 19:
147
+ _context.prev = 19;
148
+ _context.t0 = _context["catch"](10);
149
+ // 记录GlobePayAliPayH5处理错误
150
+ paymentLogger.addLog({
151
+ key: 'GlobePayAliPayH5处理错误',
152
+ value: {
153
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " GlobePayAliPayH5\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
154
+ data: {
155
+ payGroup: payGroup,
156
+ values: values
157
+ }
158
+ }
159
+ });
160
+ paymentLogger.sendLogs('GlobePayAliPayH5处理失败', _context.t0);
85
161
  setOpen(false);
86
- case 17:
162
+ case 24:
87
163
  case "end":
88
164
  return _context.stop();
89
165
  }
90
- }, _callee, null, [[6, 14]]);
166
+ }, _callee, null, [[10, 19]]);
91
167
  }));
92
168
  return function init(_x) {
93
169
  return _ref2.apply(this, arguments);
@@ -100,6 +176,12 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
100
176
  });
101
177
  var handleSuccessBack = function handleSuccessBack() {
102
178
  var _state$payCallback;
179
+ // 记录用户从支付宝返回并确认成功
180
+ paymentLogger.addLog({
181
+ key: 'GlobePayAliPayH5用户确认支付成功',
182
+ value: ""
183
+ });
184
+ paymentLogger.sendLogs('GlobePayAliPayH5支付成功');
103
185
  (_state$payCallback = state.payCallback) === null || _state$payCallback === void 0 || _state$payCallback.call(state, {
104
186
  key: 'success'
105
187
  });
@@ -8,12 +8,14 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
- import React, { useState, useImperativeHandle, forwardRef } from 'react';
11
+ import React, { useState, useImperativeHandle, forwardRef, useContext } from 'react';
12
12
  import { PisellModal } from '@pisell/materials';
13
13
  import { locales } from '@pisell/utils';
14
14
  import ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
15
15
  import { getAliPayUrl } from "./serve";
16
+ import { Context } from "../../model";
16
17
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
18
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
17
19
  import "./index.less";
18
20
  /**
19
21
  * @title: Paypal支付
@@ -23,12 +25,21 @@ import "./index.less";
23
25
  * @Date: 2024-08-16 11:18
24
26
  */
25
27
  var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
28
+ var _state$payGroup;
29
+ var _useContext = useContext(Context),
30
+ state = _useContext.state;
26
31
  var onChange = props.onChange;
27
32
  var _useState = useState(false),
28
33
  _useState2 = _slicedToArray(_useState, 2),
29
34
  open = _useState2[0],
30
35
  setOpen = _useState2[1];
31
36
 
37
+ // GlobePayPaypalH5支付日志记录器
38
+ var paymentLogger = usePaymentLogger({
39
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
40
+ step: '2'
41
+ });
42
+
32
43
  /**
33
44
  * @title: 初始化
34
45
  * @description:
@@ -44,43 +55,110 @@ var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
44
55
  while (1) switch (_context.prev = _context.next) {
45
56
  case 0:
46
57
  payGroup = _ref.payGroup;
58
+ // 记录GlobePayPaypalH5初始化开始
59
+ paymentLogger.addLog({
60
+ key: 'GlobePayPaypalH5初始化开始',
61
+ value: ""
62
+ });
47
63
  setOpen(true);
48
64
 
49
65
  // 交易组
50
66
  values = getPayGroupParamsFromStorage(payGroup.order_id);
51
67
  if (values) {
52
- _context.next = 6;
68
+ _context.next = 9;
53
69
  break;
54
70
  }
71
+ // 记录获取支付参数失败
72
+ paymentLogger.addLog({
73
+ key: 'GlobePayPaypalH5获取支付参数失败',
74
+ value: {
75
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
76
+ data: {
77
+ payGroup: payGroup
78
+ }
79
+ }
80
+ });
81
+ paymentLogger.sendLogs('GlobePayPaypalH5获取支付参数失败');
55
82
  setOpen(false);
56
83
  return _context.abrupt("return");
57
- case 6:
58
- _context.prev = 6;
59
- _context.next = 9;
60
- return getAliPayUrl(payGroup.order_id, values);
61
84
  case 9:
85
+ // 记录获取支付参数成功
86
+ paymentLogger.addLog({
87
+ key: 'GlobePayPaypalH5获取支付参数成功',
88
+ value: ""
89
+ });
90
+ _context.prev = 10;
91
+ // 记录开始获取Paypal支付链接
92
+ paymentLogger.addLog({
93
+ key: 'GlobePayPaypalH5开始获取支付链接',
94
+ value: ""
95
+ });
96
+
97
+ // 获取Paypal支付链接
98
+ _context.next = 14;
99
+ return getAliPayUrl(payGroup.order_id, values);
100
+ case 14:
62
101
  data = _context.sent;
63
102
  url = data.url || (data === null || data === void 0 ? void 0 : data.pay_url);
64
103
  if (url) {
104
+ // 记录获取支付链接成功
105
+ paymentLogger.addLog({
106
+ key: 'GlobePayPaypalH5获取支付链接成功',
107
+ value: ""
108
+ });
109
+
65
110
  // 设置交易号
66
111
  setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
67
112
 
113
+ // 记录准备跳转Paypal
114
+ paymentLogger.addLog({
115
+ key: 'GlobePayPaypalH5准备跳转Paypal',
116
+ value: ""
117
+ });
118
+
119
+ // 在跳转前发送日志
120
+ paymentLogger.sendLogs('GlobePayPaypalH5跳转成功');
121
+
68
122
  // 跳转
69
123
  window.location.href = url;
70
124
  } else {
125
+ // 记录未获取到支付链接
126
+ paymentLogger.addLog({
127
+ key: 'GlobePayPaypalH5未获取到支付链接',
128
+ value: {
129
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
130
+ data: {
131
+ payGroup: payGroup,
132
+ response: data
133
+ }
134
+ }
135
+ });
136
+ paymentLogger.sendLogs('GlobePayPaypalH5未获取到支付链接');
71
137
  setOpen(false);
72
138
  }
73
- _context.next = 17;
139
+ _context.next = 24;
74
140
  break;
75
- case 14:
76
- _context.prev = 14;
77
- _context.t0 = _context["catch"](6);
141
+ case 19:
142
+ _context.prev = 19;
143
+ _context.t0 = _context["catch"](10);
144
+ // 记录GlobePayPaypalH5处理错误
145
+ paymentLogger.addLog({
146
+ key: 'GlobePayPaypalH5处理错误',
147
+ value: {
148
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " GlobePayPaypalH5\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
149
+ data: {
150
+ payGroup: payGroup,
151
+ values: values
152
+ }
153
+ }
154
+ });
155
+ paymentLogger.sendLogs('GlobePayPaypalH5处理失败', _context.t0);
78
156
  setOpen(false);
79
- case 17:
157
+ case 24:
80
158
  case "end":
81
159
  return _context.stop();
82
160
  }
83
- }, _callee, null, [[6, 14]]);
161
+ }, _callee, null, [[10, 19]]);
84
162
  }));
85
163
  return function init(_x) {
86
164
  return _ref2.apply(this, arguments);
@@ -5,6 +5,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
5
5
  import { useImperativeHandle, forwardRef, useContext } from 'react';
6
6
  import { Context } from "../../model";
7
7
  import useEngineContext from "../../../../../hooks/useEngineContext";
8
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
8
9
  import "./index.less";
9
10
  /**
10
11
  * @title: GlobePayQrcode
@@ -16,10 +17,17 @@ import "./index.less";
16
17
  * @Date: 2024-08-16 11:17
17
18
  */
18
19
  var GlobePayQrcode = function GlobePayQrcode(props, ref) {
20
+ var _state$payGroup;
19
21
  var _useContext = useContext(Context),
20
22
  state = _useContext.state;
21
23
  var context = useEngineContext();
22
24
 
25
+ // GlobePayQrcode支付日志记录器
26
+ var paymentLogger = usePaymentLogger({
27
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
28
+ step: '2'
29
+ });
30
+
23
31
  /**
24
32
  * @title: 初始化
25
33
  * @description:
@@ -35,21 +43,52 @@ var GlobePayQrcode = function GlobePayQrcode(props, ref) {
35
43
  while (1) switch (_context.prev = _context.next) {
36
44
  case 0:
37
45
  payGroup = _ref.payGroup;
38
- _context.prev = 1;
39
- _item = payGroup === null || payGroup === void 0 ? void 0 : payGroup.otherPayment; // const platform = context.appHelper?.constants?.platform || 'h5';
46
+ // 记录GlobePayQrcode初始化开始
47
+ paymentLogger.addLog({
48
+ key: 'GlobePayQrcode初始化开始',
49
+ value: ""
50
+ });
51
+ _context.prev = 2;
52
+ _item = payGroup === null || payGroup === void 0 ? void 0 : payGroup.otherPayment; // 记录获取支付配置
53
+ paymentLogger.addLog({
54
+ key: 'GlobePayQrcode获取支付配置',
55
+ value: ""
56
+ });
57
+
58
+ // const platform = context.appHelper?.constants?.platform || 'h5';
59
+
60
+ // 记录准备回调
61
+ paymentLogger.addLog({
62
+ key: 'GlobePayQrcode准备回调',
63
+ value: ""
64
+ });
65
+
66
+ // 在回调前发送成功日志
67
+ paymentLogger.sendLogs('GlobePayQrcode处理成功');
40
68
  state.payCallback({
41
69
  key: _item.service,
42
70
  data: payGroup
43
71
  });
44
72
  return _context.abrupt("return");
45
- case 7:
46
- _context.prev = 7;
47
- _context.t0 = _context["catch"](1);
48
- case 9:
73
+ case 11:
74
+ _context.prev = 11;
75
+ _context.t0 = _context["catch"](2);
76
+ // 记录GlobePayQrcode处理错误
77
+ paymentLogger.addLog({
78
+ key: 'GlobePayQrcode处理错误',
79
+ value: {
80
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " GlobePayQrcode\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
81
+ data: {
82
+ payGroup: payGroup
83
+ }
84
+ }
85
+ });
86
+ paymentLogger.sendLogs('GlobePayQrcode处理失败', _context.t0);
87
+ case 15:
49
88
  case "end":
50
89
  return _context.stop();
51
90
  }
52
- }, _callee, null, [[1, 7]]);
91
+ }, _callee, null, [[2, 11]]);
53
92
  }));
54
93
  return function init(_x) {
55
94
  return _ref2.apply(this, arguments);