@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
@@ -17,6 +17,7 @@ import { Context } from "../../model";
17
17
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
18
18
  import "./index.less";
19
19
  import useEngineContext from "../../../../../hooks/useEngineContext";
20
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
20
21
  import { clientPayment } from "../../utils";
21
22
  /**
22
23
  * @title: 支付宝支付
@@ -26,7 +27,7 @@ import { clientPayment } from "../../utils";
26
27
  * @Date: 2024-08-16 11:18
27
28
  */
28
29
  var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
29
- var _context$appHelper;
30
+ var _context$appHelper, _state$payGroup;
30
31
  var _useContext = useContext(Context),
31
32
  state = _useContext.state;
32
33
  var onChange = props.onChange;
@@ -42,6 +43,12 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
42
43
  var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
43
44
  interaction = _context$appHelper$ut.interaction;
44
45
 
46
+ // SuperPayAliPayH5支付日志记录器
47
+ var paymentLogger = usePaymentLogger({
48
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
49
+ step: '2'
50
+ });
51
+
45
52
  /**
46
53
  * @title: 初始化
47
54
  * @description:
@@ -58,52 +65,117 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
58
65
  while (1) switch (_context.prev = _context.next) {
59
66
  case 0:
60
67
  payGroup = _ref.payGroup;
68
+ // 记录SuperPayAliPayH5初始化开始
69
+ paymentLogger.addLog({
70
+ key: 'SuperPayAliPayH5初始化开始',
71
+ value: ""
72
+ });
73
+
61
74
  // 交易组
62
75
  values = getPayGroupParamsFromStorage(payGroup.order_id);
63
76
  if (!(interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils))) {
64
- _context.next = 4;
77
+ _context.next = 7;
65
78
  break;
66
79
  }
80
+ // 记录App环境检测
81
+ paymentLogger.addLog({
82
+ key: 'SuperPayAliPayH5App环境检测',
83
+ value: "检测到App环境,调用客户端支付"
84
+ });
85
+ paymentLogger.sendLogs('SuperPayAliPayH5App环境支付');
67
86
  return _context.abrupt("return", clientPayment({
68
87
  order_id: payGroup.order_id,
69
88
  type: 'aliPay',
70
89
  values: values,
71
90
  interaction: interaction
72
91
  }));
73
- case 4:
92
+ case 7:
74
93
  setOpen(true);
75
94
  if (values) {
76
- _context.next = 8;
95
+ _context.next = 13;
77
96
  break;
78
97
  }
98
+ // 记录获取支付参数失败
99
+ paymentLogger.addLog({
100
+ key: 'SuperPayAliPayH5获取支付参数失败',
101
+ value: {
102
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
103
+ data: {
104
+ payGroup: payGroup
105
+ }
106
+ }
107
+ });
108
+ paymentLogger.sendLogs('SuperPayAliPayH5获取支付参数失败');
79
109
  setOpen(false);
80
110
  return _context.abrupt("return");
81
- case 8:
82
- _context.prev = 8;
83
- _context.next = 11;
111
+ case 13:
112
+ // 记录获取支付参数成功
113
+ paymentLogger.addLog({
114
+ key: 'SuperPayAliPayH5获取支付参数成功',
115
+ value: ""
116
+ });
117
+ _context.prev = 14;
118
+ _context.next = 17;
84
119
  return getAliPayUrl(payGroup.order_id, values);
85
- case 11:
120
+ case 17:
86
121
  data = _context.sent;
87
122
  if (data !== null && data !== void 0 && data.pay_url) {
123
+ // 记录获取支付宝支付链接成功
124
+ paymentLogger.addLog({
125
+ key: 'SuperPayAliPayH5获取支付链接成功',
126
+ value: ""
127
+ });
128
+
88
129
  // 设置交易号
89
130
  setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
90
131
  setShowSuccessBackButton(true);
132
+
133
+ // 记录即将跳转到支付宝
134
+ paymentLogger.addLog({
135
+ key: 'SuperPayAliPayH5准备跳转支付宝',
136
+ value: ""
137
+ });
138
+ paymentLogger.sendLogs('SuperPayAliPayH5跳转成功');
139
+
91
140
  // 跳转
92
141
  window.location.href = data === null || data === void 0 ? void 0 : data.pay_url;
93
142
  } else {
143
+ // 记录支付链接为空
144
+ paymentLogger.addLog({
145
+ key: 'SuperPayAliPayH5支付链接为空',
146
+ value: {
147
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u652F\u4ED8\u5B9D\u652F\u4ED8\u94FE\u63A5\u4E3A\u7A7A"),
148
+ data: {
149
+ response_data: data
150
+ }
151
+ }
152
+ });
153
+ paymentLogger.sendLogs('SuperPayAliPayH5支付链接为空');
94
154
  setOpen(false);
95
155
  }
96
- _context.next = 18;
156
+ _context.next = 26;
97
157
  break;
98
- case 15:
99
- _context.prev = 15;
100
- _context.t0 = _context["catch"](8);
158
+ case 21:
159
+ _context.prev = 21;
160
+ _context.t0 = _context["catch"](14);
161
+ // 记录SuperPayAliPayH5处理错误
162
+ paymentLogger.addLog({
163
+ key: 'SuperPayAliPayH5处理错误',
164
+ value: {
165
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " SuperPayAliPayH5\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
166
+ data: {
167
+ payGroup: payGroup,
168
+ values: values
169
+ }
170
+ }
171
+ });
172
+ paymentLogger.sendLogs('SuperPayAliPayH5处理失败', _context.t0);
101
173
  setOpen(false);
102
- case 18:
174
+ case 26:
103
175
  case "end":
104
176
  return _context.stop();
105
177
  }
106
- }, _callee, null, [[8, 15]]);
178
+ }, _callee, null, [[14, 21]]);
107
179
  }));
108
180
  return function init(_x) {
109
181
  return _ref2.apply(this, arguments);
@@ -8,15 +8,17 @@ 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 ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
14
14
  import { getWxPayUrl } from "./serve";
15
+ import { Context } from "../../model";
15
16
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
16
17
  import "./index.less";
17
18
  import { locales } from '@pisell/utils';
18
19
  import { clientPayment } from "../../utils";
19
20
  import useEngineContext from "../../../../../hooks/useEngineContext";
21
+ import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
20
22
  /**
21
23
  * @title: 微信支付
22
24
  * @description:
@@ -27,7 +29,9 @@ import useEngineContext from "../../../../../hooks/useEngineContext";
27
29
  * @Date: 2024-08-16 11:18
28
30
  */
29
31
  var SuperPayWxPayH5 = function SuperPayWxPayH5(props, ref) {
30
- var _context$appHelper;
32
+ var _context$appHelper, _state$payGroup;
33
+ var _useContext = useContext(Context),
34
+ state = _useContext.state;
31
35
  var _useState = useState(false),
32
36
  _useState2 = _slicedToArray(_useState, 2),
33
37
  open = _useState2[0],
@@ -36,6 +40,12 @@ var SuperPayWxPayH5 = function SuperPayWxPayH5(props, ref) {
36
40
  var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
37
41
  interaction = _context$appHelper$ut.interaction;
38
42
 
43
+ // SuperPayWxPayH5支付日志记录器
44
+ var paymentLogger = usePaymentLogger({
45
+ orderId: ((_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.order_id) || 'unknown',
46
+ step: '2'
47
+ });
48
+
39
49
  /**
40
50
  * @title: 初始化
41
51
  * @description:
@@ -52,52 +62,116 @@ var SuperPayWxPayH5 = function SuperPayWxPayH5(props, ref) {
52
62
  while (1) switch (_context.prev = _context.next) {
53
63
  case 0:
54
64
  payGroup = _ref.payGroup;
65
+ // 记录SuperPayWxPayH5初始化开始
66
+ paymentLogger.addLog({
67
+ key: 'SuperPayWxPayH5初始化开始',
68
+ value: ""
69
+ });
70
+
55
71
  // 获取交易组
56
72
  values = getPayGroupParamsFromStorage(payGroup.order_id);
57
73
  if (!(interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils))) {
58
- _context.next = 4;
74
+ _context.next = 7;
59
75
  break;
60
76
  }
77
+ // 记录App环境检测
78
+ paymentLogger.addLog({
79
+ key: 'SuperPayWxPayH5App环境检测',
80
+ value: "检测到App环境,调用客户端支付"
81
+ });
82
+ paymentLogger.sendLogs('SuperPayWxPayH5App环境支付');
61
83
  return _context.abrupt("return", clientPayment({
62
84
  order_id: payGroup.order_id,
63
85
  type: 'wxPay',
64
86
  values: values,
65
87
  interaction: interaction
66
88
  }));
67
- case 4:
89
+ case 7:
68
90
  setOpen(true);
69
91
  if (values) {
70
- _context.next = 8;
92
+ _context.next = 13;
71
93
  break;
72
94
  }
95
+ // 记录获取支付参数失败
96
+ paymentLogger.addLog({
97
+ key: 'SuperPayWxPayH5获取支付参数失败',
98
+ value: {
99
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u627E\u5230\u5B58\u50A8\u7684\u652F\u4ED8\u53C2\u6570"),
100
+ data: {
101
+ payGroup: payGroup
102
+ }
103
+ }
104
+ });
105
+ paymentLogger.sendLogs('SuperPayWxPayH5获取支付参数失败');
73
106
  setOpen(false);
74
107
  return _context.abrupt("return");
75
- case 8:
76
- _context.prev = 8;
77
- _context.next = 11;
108
+ case 13:
109
+ // 记录获取支付参数成功
110
+ paymentLogger.addLog({
111
+ key: 'SuperPayWxPayH5获取支付参数成功',
112
+ value: ""
113
+ });
114
+ _context.prev = 14;
115
+ _context.next = 17;
78
116
  return getWxPayUrl(payGroup.order_id, values);
79
- case 11:
117
+ case 17:
80
118
  data = _context.sent;
81
119
  if (data !== null && data !== void 0 && data.pay_url) {
120
+ // 记录获取微信支付链接成功
121
+ paymentLogger.addLog({
122
+ key: 'SuperPayWxPayH5获取支付链接成功',
123
+ value: ""
124
+ });
125
+
82
126
  // 设置交易号
83
127
  setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
84
128
 
129
+ // 记录即将跳转到微信支付
130
+ paymentLogger.addLog({
131
+ key: 'SuperPayWxPayH5准备跳转微信支付',
132
+ value: ""
133
+ });
134
+ paymentLogger.sendLogs('SuperPayWxPayH5跳转成功');
135
+
85
136
  // 跳转支付
86
137
  window.location.href = data === null || data === void 0 ? void 0 : data.pay_url;
87
138
  } else {
139
+ // 记录支付链接为空
140
+ paymentLogger.addLog({
141
+ key: 'SuperPayWxPayH5支付链接为空',
142
+ value: {
143
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u5FAE\u4FE1\u652F\u4ED8\u94FE\u63A5\u4E3A\u7A7A"),
144
+ data: {
145
+ response_data: data
146
+ }
147
+ }
148
+ });
149
+ paymentLogger.sendLogs('SuperPayWxPayH5支付链接为空');
88
150
  setOpen(false);
89
151
  }
90
- _context.next = 18;
152
+ _context.next = 26;
91
153
  break;
92
- case 15:
93
- _context.prev = 15;
94
- _context.t0 = _context["catch"](8);
154
+ case 21:
155
+ _context.prev = 21;
156
+ _context.t0 = _context["catch"](14);
157
+ // 记录SuperPayWxPayH5处理错误
158
+ paymentLogger.addLog({
159
+ key: 'SuperPayWxPayH5处理错误',
160
+ value: {
161
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " SuperPayWxPayH5\u5904\u7406\u5931\u8D25: ").concat((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '未知错误'),
162
+ data: {
163
+ payGroup: payGroup,
164
+ values: values
165
+ }
166
+ }
167
+ });
168
+ paymentLogger.sendLogs('SuperPayWxPayH5处理失败', _context.t0);
95
169
  setOpen(false);
96
- case 18:
170
+ case 26:
97
171
  case "end":
98
172
  return _context.stop();
99
173
  }
100
- }, _callee, null, [[8, 15]]);
174
+ }, _callee, null, [[14, 21]]);
101
175
  }));
102
176
  return function init(_x) {
103
177
  return _ref2.apply(this, arguments);