@pisell/private-materials 6.3.14 → 6.3.16

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 (83) 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/addons/model.d.ts +10 -1
  10. package/es/components/booking/forms/model.d.ts +10 -1
  11. package/es/components/booking/info/model.d.ts +10 -1
  12. package/es/components/booking/model.d.ts +9 -1
  13. package/es/components/booking/notes/model.d.ts +10 -1
  14. package/es/components/booking/payments/model.d.ts +10 -1
  15. package/es/components/eftposPay/hooks.d.ts +1 -1
  16. package/es/components/eftposPay/store/index.d.ts +1 -1
  17. package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
  18. package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
  19. package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
  20. package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
  21. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
  22. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
  23. package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
  24. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
  25. package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
  26. package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
  27. package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
  28. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
  29. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
  30. package/es/components/pay/toC/index.js +278 -118
  31. package/es/components/pay/toC/model.d.ts +9 -1
  32. package/es/components/schedules/model.d.ts +9 -1
  33. package/es/components/schedules/utils.d.ts +1 -1
  34. package/es/components/ticketBooking/components/ticketBooking/index.js +2 -0
  35. package/es/components/wallet/Detail/index.js +3 -1
  36. package/es/components/wallet/Detail/model.d.ts +13 -1
  37. package/es/components/wallet/DiscountCard/model.d.ts +14 -1
  38. package/es/components/wallet/PointCard/model.d.ts +13 -1
  39. package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
  40. package/es/components/wallet/Voucher/model.d.ts +13 -1
  41. package/es/components/wallet/components/WalletCard.js +8 -3
  42. package/es/components/wallet/model.d.ts +9 -1
  43. package/es/hooks/usePaymentLogger.d.ts +22 -0
  44. package/es/hooks/usePaymentLogger.js +78 -0
  45. package/es/utils/index.d.ts +1 -1
  46. package/lib/components/booking/addons/model.d.ts +10 -1
  47. package/lib/components/booking/forms/model.d.ts +10 -1
  48. package/lib/components/booking/info/model.d.ts +10 -1
  49. package/lib/components/booking/model.d.ts +9 -1
  50. package/lib/components/booking/notes/model.d.ts +10 -1
  51. package/lib/components/booking/payments/model.d.ts +10 -1
  52. package/lib/components/eftposPay/hooks.d.ts +1 -1
  53. package/lib/components/eftposPay/store/index.d.ts +1 -1
  54. package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
  55. package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
  56. package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
  57. package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
  58. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
  59. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
  60. package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
  61. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
  62. package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
  63. package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
  64. package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
  65. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
  66. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
  67. package/lib/components/pay/toC/index.js +183 -48
  68. package/lib/components/pay/toC/model.d.ts +9 -1
  69. package/lib/components/schedules/model.d.ts +9 -1
  70. package/lib/components/schedules/utils.d.ts +1 -1
  71. package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -0
  72. package/lib/components/wallet/Detail/index.js +18 -5
  73. package/lib/components/wallet/Detail/model.d.ts +13 -1
  74. package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
  75. package/lib/components/wallet/PointCard/model.d.ts +13 -1
  76. package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
  77. package/lib/components/wallet/Voucher/model.d.ts +13 -1
  78. package/lib/components/wallet/components/WalletCard.js +3 -1
  79. package/lib/components/wallet/model.d.ts +9 -1
  80. package/lib/hooks/usePaymentLogger.d.ts +22 -0
  81. package/lib/hooks/usePaymentLogger.js +69 -0
  82. package/lib/utils/index.d.ts +1 -1
  83. package/package.json +3 -3
@@ -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
  };
@@ -39,27 +39,55 @@ var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoadi
39
39
  var import_model = require("../../model");
40
40
  var import_payGroup = require("../../payGroup");
41
41
  var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
42
+ var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
42
43
  var import_utils2 = require("../../utils");
43
44
  var GooglePay = (props, ref) => {
44
- var _a, _b;
45
+ var _a, _b, _c;
45
46
  const { state } = (0, import_react.useContext)(import_model.Context);
46
47
  const [open, setOpen] = (0, import_react.useState)(false);
47
48
  const context = (0, import_useEngineContext.default)();
48
49
  const { config } = ((_a = context.appHelper) == null ? void 0 : _a.constants) || {};
49
50
  const { interaction } = (_b = context.appHelper) == null ? void 0 : _b.utils;
51
+ const paymentLogger = (0, import_usePaymentLogger.default)({
52
+ orderId: ((_c = state.payGroup) == null ? void 0 : _c.order_id) || "unknown",
53
+ step: "2"
54
+ });
50
55
  const init = async ({ payGroup }) => {
51
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
56
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
57
+ paymentLogger.addLog({
58
+ key: "GooglePay初始化开始",
59
+ value: ""
60
+ });
52
61
  const utils = context.appHelper.utils || {};
53
62
  const dvaStore = (_b2 = (_a2 = utils == null ? void 0 : utils.getStore) == null ? void 0 : _a2.call(utils)) == null ? void 0 : _b2.getState();
54
63
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
55
- if (((_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.isAppEnv) == null ? void 0 : _d.call(_c)) && ((_f = (_e = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e.isAndroid_ios) == null ? void 0 : _f.call(_e)) === "android") {
56
- return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "google_pay", values, interaction });
57
- }
58
- setOpen(true);
59
64
  if (!values) {
65
+ paymentLogger.addLog({
66
+ key: "GooglePay获取支付参数失败",
67
+ value: {
68
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
69
+ data: {
70
+ payGroup
71
+ }
72
+ }
73
+ });
74
+ paymentLogger.sendLogs("GooglePay获取支付参数失败");
60
75
  setOpen(false);
61
76
  return;
62
77
  }
78
+ paymentLogger.addLog({
79
+ key: "GooglePay获取支付参数成功",
80
+ value: ""
81
+ });
82
+ if (((_d = (_c2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c2.isAppEnv) == null ? void 0 : _d.call(_c2)) && ((_f = (_e = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e.isAndroid_ios) == null ? void 0 : _f.call(_e)) === "android") {
83
+ paymentLogger.addLog({
84
+ key: "GooglePay使用Android客户端支付",
85
+ value: ""
86
+ });
87
+ paymentLogger.sendLogs("GooglePay客户端支付");
88
+ return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "google_pay", values, interaction });
89
+ }
90
+ setOpen(true);
63
91
  try {
64
92
  const locale = ((_g = dvaStore.core) == null ? void 0 : _g.translateLocale) || "en";
65
93
  const shopId = (_j = (_i = (_h = dvaStore.core) == null ? void 0 : _h.core) == null ? void 0 : _i.shop) == null ? void 0 : _j.id;
@@ -71,8 +99,24 @@ var GooglePay = (props, ref) => {
71
99
  `/google-pay?order_id=${(_k = state.payGroup) == null ? void 0 : _k.order_id}&shop_id=${shopId}&locale=${locale}&shop_domain=${shop_domain}&total_amount=${values.amount}&payment_group_id=${values.payment_group_id}`,
72
100
  state.history
73
101
  )}`;
102
+ paymentLogger.addLog({
103
+ key: "GooglePay准备跳转",
104
+ value: ""
105
+ });
106
+ paymentLogger.sendLogs("GooglePay跳转成功");
74
107
  window.location.href = _href;
75
108
  } catch (err) {
109
+ paymentLogger.addLog({
110
+ key: "GooglePay处理错误",
111
+ value: {
112
+ title: `订单${payGroup == null ? void 0 : payGroup.order_id} GooglePay处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
113
+ data: {
114
+ payGroup,
115
+ values
116
+ }
117
+ }
118
+ });
119
+ paymentLogger.sendLogs("GooglePay处理失败", err);
76
120
  setOpen(false);
77
121
  }
78
122
  };