@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
@@ -35,30 +35,67 @@ module.exports = __toCommonJS(BankDeposit_exports);
35
35
  var import_react = require("react");
36
36
  var import_model = require("../../model");
37
37
  var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
38
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
38
39
  var import_utils = require("../../utils");
39
40
  var import_index = require("./index.less");
40
41
  var BankDeposit = (props, ref) => {
42
+ var _a;
41
43
  const { state } = (0, import_react.useContext)(import_model.Context);
42
44
  const context = (0, import_useEngineContext.default)();
45
+ const paymentLogger = (0, import_usePaymentLogger.default)({
46
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
47
+ step: "2"
48
+ });
43
49
  const init = async ({ payGroup }) => {
44
- var _a, _b;
45
- const platform = ((_b = (_a = context.appHelper) == null ? void 0 : _a.constants) == null ? void 0 : _b.platform) || "h5";
46
- let _item = payGroup == null ? void 0 : payGroup.otherPayment;
47
- if (platform === "pc") {
48
- state.payCallback({
49
- key: _item.service,
50
- data: {
51
- order_id: payGroup.order_id,
52
- payment_method: _item.title
50
+ var _a2, _b;
51
+ paymentLogger.addLog({
52
+ key: "BankDeposit初始化开始",
53
+ value: ""
54
+ });
55
+ try {
56
+ const platform = ((_b = (_a2 = context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b.platform) || "h5";
57
+ let _item = payGroup == null ? void 0 : payGroup.otherPayment;
58
+ paymentLogger.addLog({
59
+ key: "BankDeposit平台检测",
60
+ value: ""
61
+ });
62
+ if (platform === "pc") {
63
+ paymentLogger.addLog({
64
+ key: "BankDepositPC处理",
65
+ value: ""
66
+ });
67
+ state.payCallback({
68
+ key: _item.service,
69
+ data: {
70
+ order_id: payGroup.order_id,
71
+ payment_method: _item.title
72
+ }
73
+ });
74
+ paymentLogger.sendLogs("BankDepositPC处理成功");
75
+ return;
76
+ }
77
+ const _href = `${(0, import_utils.formatFranchiseeRoute)(
78
+ `/pay/manual-transfer?id=${(payGroup == null ? void 0 : payGroup.order_id) || (payGroup == null ? void 0 : payGroup.order_id)}`,
79
+ state.history
80
+ )}`;
81
+ paymentLogger.addLog({
82
+ key: "BankDepositH5准备跳转",
83
+ value: ""
84
+ });
85
+ paymentLogger.sendLogs("BankDepositH5跳转成功");
86
+ state.history.push(_href);
87
+ } catch (err) {
88
+ paymentLogger.addLog({
89
+ key: "BankDeposit处理错误",
90
+ value: {
91
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} BankDeposit处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
92
+ data: {
93
+ payGroup
94
+ }
53
95
  }
54
96
  });
55
- return;
97
+ paymentLogger.sendLogs("BankDeposit处理失败", err);
56
98
  }
57
- const _href = `${(0, import_utils.formatFranchiseeRoute)(
58
- `/pay/manual-transfer?id=${(payGroup == null ? void 0 : payGroup.order_id) || (payGroup == null ? void 0 : payGroup.order_id)}`,
59
- state.history
60
- )}`;
61
- state.history.push(_href);
62
99
  };
63
100
  (0, import_react.useImperativeHandle)(
64
101
  ref,
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/pay/toC/PaymentMethods/CashManual/index.tsx
@@ -26,23 +36,71 @@ var import_react = require("react");
26
36
  var import_serve = require("./serve");
27
37
  var import_model = require("../../model");
28
38
  var import_payGroup = require("../../payGroup");
39
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
29
40
  var import_index = require("./index.less");
30
41
  var CashManual = (props, ref) => {
42
+ var _a;
31
43
  const { state } = (0, import_react.useContext)(import_model.Context);
44
+ const paymentLogger = (0, import_usePaymentLogger.default)({
45
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
46
+ step: "2"
47
+ });
32
48
  const init = async ({ payGroup }) => {
33
- var _a, _b;
34
- let current = ((_a = state.payGroup) == null ? void 0 : _a.otherPayment) || {};
49
+ var _a2, _b;
50
+ paymentLogger.addLog({
51
+ key: "CashManual初始化开始",
52
+ value: ""
53
+ });
54
+ let current = ((_a2 = state.payGroup) == null ? void 0 : _a2.otherPayment) || {};
35
55
  const orderId = (payGroup == null ? void 0 : payGroup.order_id) || ((_b = state.payGroup) == null ? void 0 : _b.order_id);
36
56
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(orderId);
57
+ if (!values) {
58
+ paymentLogger.addLog({
59
+ key: "CashManual获取支付参数失败",
60
+ value: {
61
+ title: `订单${orderId} 未找到存储的支付参数`,
62
+ data: {
63
+ payGroup
64
+ }
65
+ }
66
+ });
67
+ paymentLogger.sendLogs("CashManual获取支付参数失败");
68
+ return;
69
+ }
70
+ paymentLogger.addLog({
71
+ key: "CashManual获取支付参数成功",
72
+ value: ""
73
+ });
37
74
  try {
75
+ paymentLogger.addLog({
76
+ key: "CashManual开始支付API调用",
77
+ value: ""
78
+ });
38
79
  await (0, import_serve.customPaymentApi)(orderId, {
39
80
  params: current.params,
40
81
  ...values
41
82
  });
83
+ paymentLogger.addLog({
84
+ key: "CashManual支付API调用成功",
85
+ value: ""
86
+ });
87
+ paymentLogger.sendLogs("CashManual支付成功");
42
88
  state.payCallback({
43
89
  key: "success"
44
90
  });
45
91
  } catch (err) {
92
+ paymentLogger.addLog({
93
+ key: "CashManual支付错误",
94
+ value: {
95
+ title: `订单${orderId} CashManual支付失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
96
+ data: {
97
+ payGroup,
98
+ current,
99
+ values
100
+ }
101
+ }
102
+ });
103
+ paymentLogger.sendLogs("CashManual支付失败", err);
46
104
  }
47
105
  };
48
106
  (0, import_react.useImperativeHandle)(
@@ -1,6 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
7
  var __export = (target, all) => {
6
8
  for (var name in all)
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
14
16
  }
15
17
  return to;
16
18
  };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
17
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
28
 
19
29
  // src/components/pay/toC/PaymentMethods/CustomPayment/index.tsx
@@ -26,23 +36,71 @@ var import_react = require("react");
26
36
  var import_serve = require("./serve");
27
37
  var import_model = require("../../model");
28
38
  var import_payGroup = require("../../payGroup");
39
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
29
40
  var import_index = require("./index.less");
30
41
  var CustomPayment = (props, ref) => {
42
+ var _a;
31
43
  const { state } = (0, import_react.useContext)(import_model.Context);
44
+ const paymentLogger = (0, import_usePaymentLogger.default)({
45
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
46
+ step: "2"
47
+ });
32
48
  const init = async ({ payGroup }) => {
33
- var _a, _b;
34
- let current = ((_a = state.payGroup) == null ? void 0 : _a.otherPayment) || {};
49
+ var _a2, _b;
50
+ paymentLogger.addLog({
51
+ key: "CustomPayment初始化开始",
52
+ value: ""
53
+ });
54
+ let current = ((_a2 = state.payGroup) == null ? void 0 : _a2.otherPayment) || {};
35
55
  const orderId = (payGroup == null ? void 0 : payGroup.order_id) || ((_b = state.payGroup) == null ? void 0 : _b.order_id);
36
56
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(orderId);
57
+ if (!values) {
58
+ paymentLogger.addLog({
59
+ key: "CustomPayment获取支付参数失败",
60
+ value: {
61
+ title: `订单${orderId} 未找到存储的支付参数`,
62
+ data: {
63
+ payGroup
64
+ }
65
+ }
66
+ });
67
+ paymentLogger.sendLogs("CustomPayment获取支付参数失败");
68
+ return;
69
+ }
70
+ paymentLogger.addLog({
71
+ key: "CustomPayment获取支付参数成功",
72
+ value: ""
73
+ });
37
74
  try {
75
+ paymentLogger.addLog({
76
+ key: "CustomPayment开始支付API调用",
77
+ value: ""
78
+ });
38
79
  await (0, import_serve.customPaymentApi)(orderId, {
39
80
  params: current.params,
40
81
  ...values
41
82
  });
83
+ paymentLogger.addLog({
84
+ key: "CustomPayment支付API调用成功",
85
+ value: ""
86
+ });
87
+ paymentLogger.sendLogs("CustomPayment支付成功");
42
88
  state.payCallback({
43
89
  key: "success"
44
90
  });
45
91
  } catch (err) {
92
+ paymentLogger.addLog({
93
+ key: "CustomPayment支付错误",
94
+ value: {
95
+ title: `订单${orderId} CustomPayment支付失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
96
+ data: {
97
+ payGroup,
98
+ current,
99
+ values
100
+ }
101
+ }
102
+ });
103
+ paymentLogger.sendLogs("CustomPayment支付失败", err);
46
104
  }
47
105
  };
48
106
  (0, import_react.useImperativeHandle)(
@@ -39,30 +39,89 @@ var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoadi
39
39
  var import_serve = require("./serve");
40
40
  var import_model = require("../../model");
41
41
  var import_payGroup = require("../../payGroup");
42
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
42
43
  var import_index = require("./index.less");
43
44
  var GlobePayAliPayH5 = (props, ref) => {
45
+ var _a;
44
46
  const { state } = (0, import_react.useContext)(import_model.Context);
45
47
  const { onChange } = props;
46
48
  const [open, setOpen] = (0, import_react.useState)(false);
47
49
  const [showSuccessBackButton, setShowSuccessBackButton] = (0, import_react.useState)(false);
50
+ const paymentLogger = (0, import_usePaymentLogger.default)({
51
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
52
+ step: "2"
53
+ });
48
54
  const init = async ({ payGroup }) => {
55
+ paymentLogger.addLog({
56
+ key: "GlobePayAliPayH5初始化开始",
57
+ value: ""
58
+ });
49
59
  setOpen(true);
50
60
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
51
61
  if (!values) {
62
+ paymentLogger.addLog({
63
+ key: "GlobePayAliPayH5获取支付参数失败",
64
+ value: {
65
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
66
+ data: {
67
+ payGroup
68
+ }
69
+ }
70
+ });
71
+ paymentLogger.sendLogs("GlobePayAliPayH5获取支付参数失败");
52
72
  setOpen(false);
53
73
  return;
54
74
  }
75
+ paymentLogger.addLog({
76
+ key: "GlobePayAliPayH5获取支付参数成功",
77
+ value: ""
78
+ });
55
79
  try {
80
+ paymentLogger.addLog({
81
+ key: "GlobePayAliPayH5开始获取支付链接",
82
+ value: ""
83
+ });
56
84
  const data = await (0, import_serve.getAliPayUrl)(payGroup.order_id, values);
57
85
  const url = data.url || (data == null ? void 0 : data.pay_url);
58
86
  if (url) {
87
+ paymentLogger.addLog({
88
+ key: "GlobePayAliPayH5获取支付链接成功",
89
+ value: ""
90
+ });
59
91
  (0, import_payGroup.setPayNumber)(payGroup == null ? void 0 : payGroup.order_id, data == null ? void 0 : data.pay_number);
92
+ paymentLogger.addLog({
93
+ key: "GlobePayAliPayH5准备跳转支付宝",
94
+ value: ""
95
+ });
60
96
  setShowSuccessBackButton(true);
97
+ paymentLogger.sendLogs("GlobePayAliPayH5跳转成功");
61
98
  window.location.href = url;
62
99
  } else {
100
+ paymentLogger.addLog({
101
+ key: "GlobePayAliPayH5未获取到支付链接",
102
+ value: {
103
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未获取到有效的支付链接`,
104
+ data: {
105
+ payGroup,
106
+ response: data
107
+ }
108
+ }
109
+ });
110
+ paymentLogger.sendLogs("GlobePayAliPayH5未获取到支付链接");
63
111
  setOpen(false);
64
112
  }
65
113
  } catch (err) {
114
+ paymentLogger.addLog({
115
+ key: "GlobePayAliPayH5处理错误",
116
+ value: {
117
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} GlobePayAliPayH5处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
118
+ data: {
119
+ payGroup,
120
+ values
121
+ }
122
+ }
123
+ });
124
+ paymentLogger.sendLogs("GlobePayAliPayH5处理失败", err);
66
125
  setOpen(false);
67
126
  }
68
127
  };
@@ -73,8 +132,13 @@ var GlobePayAliPayH5 = (props, ref) => {
73
132
  })
74
133
  );
75
134
  const handleSuccessBack = () => {
76
- var _a;
77
- (_a = state.payCallback) == null ? void 0 : _a.call(state, {
135
+ var _a2;
136
+ paymentLogger.addLog({
137
+ key: "GlobePayAliPayH5用户确认支付成功",
138
+ value: ""
139
+ });
140
+ paymentLogger.sendLogs("GlobePayAliPayH5支付成功");
141
+ (_a2 = state.payCallback) == null ? void 0 : _a2.call(state, {
78
142
  key: "success"
79
143
  });
80
144
  };
@@ -37,28 +37,89 @@ var import_materials = require("@pisell/materials");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoading"));
39
39
  var import_serve = require("./serve");
40
+ var import_model = require("../../model");
40
41
  var import_payGroup = require("../../payGroup");
42
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
41
43
  var import_index = require("./index.less");
42
44
  var GlobePayPaypalH5 = (props, ref) => {
45
+ var _a;
46
+ const { state } = (0, import_react.useContext)(import_model.Context);
43
47
  const { onChange } = props;
44
48
  const [open, setOpen] = (0, import_react.useState)(false);
49
+ const paymentLogger = (0, import_usePaymentLogger.default)({
50
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
51
+ step: "2"
52
+ });
45
53
  const init = async ({ payGroup }) => {
54
+ paymentLogger.addLog({
55
+ key: "GlobePayPaypalH5初始化开始",
56
+ value: ""
57
+ });
46
58
  setOpen(true);
47
59
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
48
60
  if (!values) {
61
+ paymentLogger.addLog({
62
+ key: "GlobePayPaypalH5获取支付参数失败",
63
+ value: {
64
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
65
+ data: {
66
+ payGroup
67
+ }
68
+ }
69
+ });
70
+ paymentLogger.sendLogs("GlobePayPaypalH5获取支付参数失败");
49
71
  setOpen(false);
50
72
  return;
51
73
  }
74
+ paymentLogger.addLog({
75
+ key: "GlobePayPaypalH5获取支付参数成功",
76
+ value: ""
77
+ });
52
78
  try {
79
+ paymentLogger.addLog({
80
+ key: "GlobePayPaypalH5开始获取支付链接",
81
+ value: ""
82
+ });
53
83
  const data = await (0, import_serve.getAliPayUrl)(payGroup.order_id, values);
54
84
  const url = data.url || (data == null ? void 0 : data.pay_url);
55
85
  if (url) {
86
+ paymentLogger.addLog({
87
+ key: "GlobePayPaypalH5获取支付链接成功",
88
+ value: ""
89
+ });
56
90
  (0, import_payGroup.setPayNumber)(payGroup == null ? void 0 : payGroup.order_id, data == null ? void 0 : data.pay_number);
91
+ paymentLogger.addLog({
92
+ key: "GlobePayPaypalH5准备跳转Paypal",
93
+ value: ""
94
+ });
95
+ paymentLogger.sendLogs("GlobePayPaypalH5跳转成功");
57
96
  window.location.href = url;
58
97
  } else {
98
+ paymentLogger.addLog({
99
+ key: "GlobePayPaypalH5未获取到支付链接",
100
+ value: {
101
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未获取到有效的支付链接`,
102
+ data: {
103
+ payGroup,
104
+ response: data
105
+ }
106
+ }
107
+ });
108
+ paymentLogger.sendLogs("GlobePayPaypalH5未获取到支付链接");
59
109
  setOpen(false);
60
110
  }
61
111
  } catch (err) {
112
+ paymentLogger.addLog({
113
+ key: "GlobePayPaypalH5处理错误",
114
+ value: {
115
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} GlobePayPaypalH5处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
116
+ data: {
117
+ payGroup,
118
+ values
119
+ }
120
+ }
121
+ });
122
+ paymentLogger.sendLogs("GlobePayPaypalH5处理失败", err);
62
123
  setOpen(false);
63
124
  }
64
125
  };
@@ -35,19 +35,48 @@ module.exports = __toCommonJS(GlobePayQrcode_exports);
35
35
  var import_react = require("react");
36
36
  var import_model = require("../../model");
37
37
  var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
38
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
38
39
  var import_index = require("./index.less");
39
40
  var GlobePayQrcode = (props, ref) => {
41
+ var _a;
40
42
  const { state } = (0, import_react.useContext)(import_model.Context);
41
43
  const context = (0, import_useEngineContext.default)();
44
+ const paymentLogger = (0, import_usePaymentLogger.default)({
45
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
46
+ step: "2"
47
+ });
42
48
  const init = async ({ payGroup }) => {
49
+ paymentLogger.addLog({
50
+ key: "GlobePayQrcode初始化开始",
51
+ value: ""
52
+ });
43
53
  try {
44
54
  let _item = payGroup == null ? void 0 : payGroup.otherPayment;
55
+ paymentLogger.addLog({
56
+ key: "GlobePayQrcode获取支付配置",
57
+ value: ""
58
+ });
59
+ paymentLogger.addLog({
60
+ key: "GlobePayQrcode准备回调",
61
+ value: ""
62
+ });
63
+ paymentLogger.sendLogs("GlobePayQrcode处理成功");
45
64
  state.payCallback({
46
65
  key: _item.service,
47
66
  data: payGroup
48
67
  });
49
68
  return;
50
69
  } catch (err) {
70
+ paymentLogger.addLog({
71
+ key: "GlobePayQrcode处理错误",
72
+ value: {
73
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} GlobePayQrcode处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
74
+ data: {
75
+ payGroup
76
+ }
77
+ }
78
+ });
79
+ paymentLogger.sendLogs("GlobePayQrcode处理失败", err);
51
80
  }
52
81
  };
53
82
  (0, import_react.useImperativeHandle)(
@@ -37,28 +37,89 @@ var import_materials = require("@pisell/materials");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoading"));
39
39
  var import_serve = require("./serve");
40
+ var import_model = require("../../model");
40
41
  var import_payGroup = require("../../payGroup");
42
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
41
43
  var import_index = require("./index.less");
42
44
  var GlobePayWxH5 = (props, ref) => {
45
+ var _a;
46
+ const { state } = (0, import_react.useContext)(import_model.Context);
43
47
  const { onChange } = props;
44
48
  const [open, setOpen] = (0, import_react.useState)(false);
49
+ const paymentLogger = (0, import_usePaymentLogger.default)({
50
+ orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
51
+ step: "2"
52
+ });
45
53
  const init = async ({ payGroup }) => {
54
+ paymentLogger.addLog({
55
+ key: "GlobePayWxH5初始化开始",
56
+ value: ""
57
+ });
46
58
  setOpen(true);
47
59
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
48
60
  if (!values) {
61
+ paymentLogger.addLog({
62
+ key: "GlobePayWxH5获取支付参数失败",
63
+ value: {
64
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
65
+ data: {
66
+ payGroup
67
+ }
68
+ }
69
+ });
70
+ paymentLogger.sendLogs("GlobePayWxH5获取支付参数失败");
49
71
  setOpen(false);
50
72
  return;
51
73
  }
74
+ paymentLogger.addLog({
75
+ key: "GlobePayWxH5获取支付参数成功",
76
+ value: ""
77
+ });
52
78
  try {
79
+ paymentLogger.addLog({
80
+ key: "GlobePayWxH5开始获取支付链接",
81
+ value: ""
82
+ });
53
83
  const data = await (0, import_serve.getAliPayUrl)(payGroup.order_id, values);
54
84
  const url = data.url || (data == null ? void 0 : data.pay_url);
55
85
  if (url) {
86
+ paymentLogger.addLog({
87
+ key: "GlobePayWxH5获取支付链接成功",
88
+ value: ""
89
+ });
56
90
  (0, import_payGroup.setPayNumber)(payGroup == null ? void 0 : payGroup.order_id, data == null ? void 0 : data.pay_number);
91
+ paymentLogger.addLog({
92
+ key: "GlobePayWxH5准备跳转微信",
93
+ value: ""
94
+ });
95
+ paymentLogger.sendLogs("GlobePayWxH5跳转成功");
57
96
  window.location.href = url;
58
97
  } else {
98
+ paymentLogger.addLog({
99
+ key: "GlobePayWxH5未获取到支付链接",
100
+ value: {
101
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未获取到有效的支付链接`,
102
+ data: {
103
+ payGroup,
104
+ response: data
105
+ }
106
+ }
107
+ });
108
+ paymentLogger.sendLogs("GlobePayWxH5未获取到支付链接");
59
109
  setOpen(false);
60
110
  }
61
111
  } catch (err) {
112
+ paymentLogger.addLog({
113
+ key: "GlobePayWxH5处理错误",
114
+ value: {
115
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} GlobePayWxH5处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
116
+ data: {
117
+ payGroup,
118
+ values
119
+ }
120
+ }
121
+ });
122
+ paymentLogger.sendLogs("GlobePayWxH5处理失败", err);
62
123
  setOpen(false);
63
124
  }
64
125
  };