@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
- package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
- package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
- package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
- package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
- package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
- package/es/components/pay/toC/index.js +278 -118
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/hooks/useComponents.js +1 -1
- package/es/hooks/usePaymentLogger.d.ts +22 -0
- package/es/hooks/usePaymentLogger.js +78 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
- package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
- package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
- package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
- package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
- package/lib/components/pay/toC/index.js +183 -48
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/hooks/usePaymentLogger.d.ts +22 -0
- package/lib/hooks/usePaymentLogger.js +69 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
@@ -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,
|
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
|
};
|
@@ -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/OfflinePayment/index.tsx
|
@@ -26,21 +36,73 @@ 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 OfflinePayment = (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
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
49
|
+
var _a2, _b;
|
50
|
+
try {
|
51
|
+
paymentLogger.addLog({
|
52
|
+
key: "OfflinePayment初始化开始",
|
53
|
+
value: ""
|
54
|
+
});
|
55
|
+
const _item = payGroup == null ? void 0 : payGroup.otherPayment;
|
56
|
+
const params = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup == null ? void 0 : payGroup.order_id, {
|
57
|
+
order_id: payGroup == null ? void 0 : payGroup.order_id,
|
58
|
+
payment_method: (_a2 = _item == null ? void 0 : _item.params) == null ? void 0 : _a2.payment_method
|
59
|
+
});
|
60
|
+
if (!params) {
|
61
|
+
paymentLogger.addLog({
|
62
|
+
key: "OfflinePayment获取支付参数失败",
|
63
|
+
value: {
|
64
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
|
65
|
+
data: {
|
66
|
+
payGroup
|
67
|
+
}
|
68
|
+
}
|
69
|
+
});
|
70
|
+
paymentLogger.sendLogs("OfflinePayment获取支付参数失败");
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
paymentLogger.addLog({
|
74
|
+
key: "OfflinePayment获取支付参数成功",
|
75
|
+
value: ""
|
76
|
+
});
|
77
|
+
paymentLogger.addLog({
|
78
|
+
key: "OfflinePayment开始执行支付",
|
79
|
+
value: {
|
80
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 开始执行线下支付`,
|
81
|
+
data: {
|
82
|
+
params,
|
83
|
+
paymentMethod: (_b = _item == null ? void 0 : _item.params) == null ? void 0 : _b.payment_method
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
await (0, import_serve.offlinePayment)(params);
|
88
|
+
paymentLogger.addLog({
|
89
|
+
key: "OfflinePayment支付成功",
|
90
|
+
value: ""
|
91
|
+
});
|
92
|
+
paymentLogger.sendLogs("OfflinePayment支付成功");
|
93
|
+
state.payCallback({ key: "success" });
|
94
|
+
} catch (err) {
|
95
|
+
paymentLogger.addLog({
|
96
|
+
key: "OfflinePayment处理错误",
|
97
|
+
value: {
|
98
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} OfflinePayment处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
99
|
+
data: {
|
100
|
+
payGroup
|
101
|
+
}
|
102
|
+
}
|
103
|
+
});
|
104
|
+
paymentLogger.sendLogs("OfflinePayment处理失败", err);
|
41
105
|
}
|
42
|
-
await (0, import_serve.offlinePayment)(params);
|
43
|
-
state.payCallback({ key: "success" });
|
44
106
|
};
|
45
107
|
(0, import_react.useImperativeHandle)(
|
46
108
|
ref,
|
@@ -35,16 +35,41 @@ module.exports = __toCommonJS(StripePay_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 StripePay = (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 == null ? void 0 : state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
|
46
|
+
step: "2"
|
47
|
+
});
|
42
48
|
const init = async ({ payGroup }) => {
|
43
|
-
var
|
49
|
+
var _a2, _b;
|
50
|
+
paymentLogger.addLog({
|
51
|
+
key: "StripePay初始化开始",
|
52
|
+
value: ""
|
53
|
+
});
|
44
54
|
try {
|
45
55
|
let _item = payGroup == null ? void 0 : payGroup.otherPayment;
|
46
|
-
const platform = ((_b = (
|
56
|
+
const platform = ((_b = (_a2 = context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b.platform) || "h5";
|
57
|
+
paymentLogger.addLog({
|
58
|
+
key: "StripePay平台检测",
|
59
|
+
value: {
|
60
|
+
platform,
|
61
|
+
paymentItem: _item
|
62
|
+
}
|
63
|
+
});
|
47
64
|
if (platform === "pc") {
|
65
|
+
paymentLogger.addLog({
|
66
|
+
key: "StripePay PC端回调准备",
|
67
|
+
value: {
|
68
|
+
service: _item.service,
|
69
|
+
orderId: payGroup.order_id,
|
70
|
+
paymentMethod: _item.title
|
71
|
+
}
|
72
|
+
});
|
48
73
|
state.payCallback({
|
49
74
|
key: _item.service,
|
50
75
|
data: {
|
@@ -52,12 +77,29 @@ var StripePay = (props, ref) => {
|
|
52
77
|
payment_method: _item.title
|
53
78
|
}
|
54
79
|
});
|
80
|
+
paymentLogger.sendLogs("StripePay PC端回调成功");
|
55
81
|
return;
|
56
82
|
}
|
57
|
-
|
58
|
-
|
59
|
-
|
83
|
+
const redirectUrl = `/pay/stripe?order_id=${payGroup.order_id}&payment_method=${encodeURIComponent(_item.title)}`;
|
84
|
+
paymentLogger.addLog({
|
85
|
+
key: "StripePay H5端跳转准备",
|
86
|
+
value: {
|
87
|
+
redirectUrl
|
88
|
+
}
|
89
|
+
});
|
90
|
+
state.history.push(redirectUrl);
|
91
|
+
paymentLogger.sendLogs("StripePay H5端跳转成功");
|
60
92
|
} catch (err) {
|
93
|
+
paymentLogger.addLog({
|
94
|
+
key: "StripePay处理错误",
|
95
|
+
value: {
|
96
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} StripePay处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
97
|
+
data: {
|
98
|
+
payGroup
|
99
|
+
}
|
100
|
+
}
|
101
|
+
});
|
102
|
+
paymentLogger.sendLogs("StripePay处理失败", err);
|
61
103
|
}
|
62
104
|
};
|
63
105
|
(0, import_react.useImperativeHandle)(
|
@@ -41,36 +41,94 @@ var import_model = require("../../model");
|
|
41
41
|
var import_payGroup = require("../../payGroup");
|
42
42
|
var import_index = require("./index.less");
|
43
43
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
44
|
+
var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
|
44
45
|
var import_utils2 = require("../../utils");
|
45
46
|
var SuperPayAliPayH5 = (props, ref) => {
|
46
|
-
var _a;
|
47
|
+
var _a, _b;
|
47
48
|
const { state } = (0, import_react.useContext)(import_model.Context);
|
48
49
|
const { onChange } = props;
|
49
50
|
const [open, setOpen] = (0, import_react.useState)(false);
|
50
51
|
const [showSuccessBackButton, setShowSuccessBackButton] = (0, import_react.useState)(false);
|
51
52
|
const context = (0, import_useEngineContext.default)();
|
52
53
|
const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
54
|
+
const paymentLogger = (0, import_usePaymentLogger.default)({
|
55
|
+
orderId: ((_b = state.payGroup) == null ? void 0 : _b.order_id) || "unknown",
|
56
|
+
step: "2"
|
57
|
+
});
|
53
58
|
const init = async ({ payGroup }) => {
|
54
|
-
var _a2,
|
59
|
+
var _a2, _b2;
|
60
|
+
paymentLogger.addLog({
|
61
|
+
key: "SuperPayAliPayH5初始化开始",
|
62
|
+
value: ""
|
63
|
+
});
|
55
64
|
const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
|
56
|
-
if ((
|
65
|
+
if ((_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b2.call(_a2)) {
|
66
|
+
paymentLogger.addLog({
|
67
|
+
key: "SuperPayAliPayH5App环境检测",
|
68
|
+
value: "检测到App环境,调用客户端支付"
|
69
|
+
});
|
70
|
+
paymentLogger.sendLogs("SuperPayAliPayH5App环境支付");
|
57
71
|
return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "aliPay", values, interaction });
|
58
72
|
}
|
59
73
|
setOpen(true);
|
60
74
|
if (!values) {
|
75
|
+
paymentLogger.addLog({
|
76
|
+
key: "SuperPayAliPayH5获取支付参数失败",
|
77
|
+
value: {
|
78
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
|
79
|
+
data: {
|
80
|
+
payGroup
|
81
|
+
}
|
82
|
+
}
|
83
|
+
});
|
84
|
+
paymentLogger.sendLogs("SuperPayAliPayH5获取支付参数失败");
|
61
85
|
setOpen(false);
|
62
86
|
return;
|
63
87
|
}
|
88
|
+
paymentLogger.addLog({
|
89
|
+
key: "SuperPayAliPayH5获取支付参数成功",
|
90
|
+
value: ""
|
91
|
+
});
|
64
92
|
try {
|
65
93
|
const data = await (0, import_serve.getAliPayUrl)(payGroup.order_id, values);
|
66
94
|
if (data == null ? void 0 : data.pay_url) {
|
95
|
+
paymentLogger.addLog({
|
96
|
+
key: "SuperPayAliPayH5获取支付链接成功",
|
97
|
+
value: ""
|
98
|
+
});
|
67
99
|
(0, import_payGroup.setPayNumber)(payGroup == null ? void 0 : payGroup.order_id, data == null ? void 0 : data.pay_number);
|
68
100
|
setShowSuccessBackButton(true);
|
101
|
+
paymentLogger.addLog({
|
102
|
+
key: "SuperPayAliPayH5准备跳转支付宝",
|
103
|
+
value: ""
|
104
|
+
});
|
105
|
+
paymentLogger.sendLogs("SuperPayAliPayH5跳转成功");
|
69
106
|
window.location.href = data == null ? void 0 : data.pay_url;
|
70
107
|
} else {
|
108
|
+
paymentLogger.addLog({
|
109
|
+
key: "SuperPayAliPayH5支付链接为空",
|
110
|
+
value: {
|
111
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 支付宝支付链接为空`,
|
112
|
+
data: {
|
113
|
+
response_data: data
|
114
|
+
}
|
115
|
+
}
|
116
|
+
});
|
117
|
+
paymentLogger.sendLogs("SuperPayAliPayH5支付链接为空");
|
71
118
|
setOpen(false);
|
72
119
|
}
|
73
120
|
} catch (err) {
|
121
|
+
paymentLogger.addLog({
|
122
|
+
key: "SuperPayAliPayH5处理错误",
|
123
|
+
value: {
|
124
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} SuperPayAliPayH5处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
125
|
+
data: {
|
126
|
+
payGroup,
|
127
|
+
values
|
128
|
+
}
|
129
|
+
}
|
130
|
+
});
|
131
|
+
paymentLogger.sendLogs("SuperPayAliPayH5处理失败", err);
|
74
132
|
setOpen(false);
|
75
133
|
}
|
76
134
|
};
|
@@ -36,36 +36,96 @@ var import_react = __toESM(require("react"));
|
|
36
36
|
var import_materials = require("@pisell/materials");
|
37
37
|
var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoading"));
|
38
38
|
var import_serve = require("./serve");
|
39
|
+
var import_model = require("../../model");
|
39
40
|
var import_payGroup = require("../../payGroup");
|
40
41
|
var import_index = require("./index.less");
|
41
42
|
var import_utils = require("@pisell/utils");
|
42
43
|
var import_utils2 = require("../../utils");
|
43
44
|
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
45
|
+
var import_usePaymentLogger = __toESM(require("../../../../../hooks/usePaymentLogger"));
|
44
46
|
var SuperPayWxPayH5 = (props, ref) => {
|
45
|
-
var _a;
|
47
|
+
var _a, _b;
|
48
|
+
const { state } = (0, import_react.useContext)(import_model.Context);
|
46
49
|
const [open, setOpen] = (0, import_react.useState)(false);
|
47
50
|
const context = (0, import_useEngineContext.default)();
|
48
51
|
const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
52
|
+
const paymentLogger = (0, import_usePaymentLogger.default)({
|
53
|
+
orderId: ((_b = state.payGroup) == null ? void 0 : _b.order_id) || "unknown",
|
54
|
+
step: "2"
|
55
|
+
});
|
49
56
|
const init = async ({ payGroup }) => {
|
50
|
-
var _a2,
|
57
|
+
var _a2, _b2;
|
58
|
+
paymentLogger.addLog({
|
59
|
+
key: "SuperPayWxPayH5初始化开始",
|
60
|
+
value: ""
|
61
|
+
});
|
51
62
|
const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
|
52
|
-
if ((
|
63
|
+
if ((_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b2.call(_a2)) {
|
64
|
+
paymentLogger.addLog({
|
65
|
+
key: "SuperPayWxPayH5App环境检测",
|
66
|
+
value: "检测到App环境,调用客户端支付"
|
67
|
+
});
|
68
|
+
paymentLogger.sendLogs("SuperPayWxPayH5App环境支付");
|
53
69
|
return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "wxPay", values, interaction });
|
54
70
|
}
|
55
71
|
setOpen(true);
|
56
72
|
if (!values) {
|
73
|
+
paymentLogger.addLog({
|
74
|
+
key: "SuperPayWxPayH5获取支付参数失败",
|
75
|
+
value: {
|
76
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 未找到存储的支付参数`,
|
77
|
+
data: {
|
78
|
+
payGroup
|
79
|
+
}
|
80
|
+
}
|
81
|
+
});
|
82
|
+
paymentLogger.sendLogs("SuperPayWxPayH5获取支付参数失败");
|
57
83
|
setOpen(false);
|
58
84
|
return;
|
59
85
|
}
|
86
|
+
paymentLogger.addLog({
|
87
|
+
key: "SuperPayWxPayH5获取支付参数成功",
|
88
|
+
value: ""
|
89
|
+
});
|
60
90
|
try {
|
61
91
|
const data = await (0, import_serve.getWxPayUrl)(payGroup.order_id, values);
|
62
92
|
if (data == null ? void 0 : data.pay_url) {
|
93
|
+
paymentLogger.addLog({
|
94
|
+
key: "SuperPayWxPayH5获取支付链接成功",
|
95
|
+
value: ""
|
96
|
+
});
|
63
97
|
(0, import_payGroup.setPayNumber)(payGroup == null ? void 0 : payGroup.order_id, data == null ? void 0 : data.pay_number);
|
98
|
+
paymentLogger.addLog({
|
99
|
+
key: "SuperPayWxPayH5准备跳转微信支付",
|
100
|
+
value: ""
|
101
|
+
});
|
102
|
+
paymentLogger.sendLogs("SuperPayWxPayH5跳转成功");
|
64
103
|
window.location.href = data == null ? void 0 : data.pay_url;
|
65
104
|
} else {
|
105
|
+
paymentLogger.addLog({
|
106
|
+
key: "SuperPayWxPayH5支付链接为空",
|
107
|
+
value: {
|
108
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} 微信支付链接为空`,
|
109
|
+
data: {
|
110
|
+
response_data: data
|
111
|
+
}
|
112
|
+
}
|
113
|
+
});
|
114
|
+
paymentLogger.sendLogs("SuperPayWxPayH5支付链接为空");
|
66
115
|
setOpen(false);
|
67
116
|
}
|
68
117
|
} catch (err) {
|
118
|
+
paymentLogger.addLog({
|
119
|
+
key: "SuperPayWxPayH5处理错误",
|
120
|
+
value: {
|
121
|
+
title: `订单${payGroup == null ? void 0 : payGroup.order_id} SuperPayWxPayH5处理失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
122
|
+
data: {
|
123
|
+
payGroup,
|
124
|
+
values
|
125
|
+
}
|
126
|
+
}
|
127
|
+
});
|
128
|
+
paymentLogger.sendLogs("SuperPayWxPayH5处理失败", err);
|
69
129
|
setOpen(false);
|
70
130
|
}
|
71
131
|
};
|