@pisell/private-materials 6.3.123 → 6.3.125
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 +4 -4
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -1
- package/es/components/eftposPay/component/fail/failCustom.js +12 -4
- package/es/components/eftposPay/component/fail/index.js +14 -6
- package/es/components/eftposPay/component/fail/network.js +3 -0
- package/es/components/eftposPay/component/fail/unknow.js +8 -0
- package/es/components/eftposPay/component/manual/index.js +13 -1
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/device.js +33 -22
- package/es/components/eftposPay/index.js +48 -11
- package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
- package/es/components/eftposPay/linkly/index.js +10 -23
- package/es/components/eftposPay/pay.js +14 -7
- package/es/components/eftposPay/payo/config.js +38 -5
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/tyro/index.js +44 -11
- package/es/components/eftposPay/utils/payLog.d.ts +81 -0
- package/es/components/eftposPay/utils/payLog.js +430 -0
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +28 -29
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +142 -165
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
- package/es/components/pay/toC/WalletPassBlock/index.js +1 -3
- package/es/components/pay/toC/index.js +31 -65
- package/es/components/pay/toC/model.d.ts +9 -2
- package/es/components/pay/toC/serve.d.ts +0 -18
- package/es/components/pay/toC/serve.js +15 -42
- package/es/components/pay/toC/utils.d.ts +2 -2
- package/es/components/pay/toC/utils.js +0 -4
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/pro/Login2.0/components/phoneValidation.js +65 -58
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +2 -1
- package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
- package/lib/components/eftposPay/component/fail/index.js +10 -2
- package/lib/components/eftposPay/component/fail/network.js +3 -0
- package/lib/components/eftposPay/component/fail/unknow.js +8 -0
- package/lib/components/eftposPay/component/manual/index.js +10 -0
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/device.js +11 -10
- package/lib/components/eftposPay/index.js +36 -11
- package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
- package/lib/components/eftposPay/linkly/index.js +7 -10
- package/lib/components/eftposPay/pay.js +9 -1
- package/lib/components/eftposPay/payo/config.js +15 -8
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/tyro/index.js +21 -17
- package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
- package/lib/components/eftposPay/utils/payLog.js +320 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +18 -20
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +0 -5
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +100 -90
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +0 -6
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
- package/lib/components/pay/toC/WalletPassBlock/index.js +1 -3
- package/lib/components/pay/toC/index.js +19 -52
- package/lib/components/pay/toC/model.d.ts +9 -2
- package/lib/components/pay/toC/serve.d.ts +0 -18
- package/lib/components/pay/toC/serve.js +0 -6
- package/lib/components/pay/toC/utils.d.ts +2 -2
- package/lib/components/pay/toC/utils.js +2 -6
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/pro/Login2.0/components/phoneValidation.js +4 -2
- package/package.json +2 -2
|
@@ -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/eftposPay/linkly/hooks/normal.ts
|
|
@@ -32,6 +42,7 @@ var import_hooks = require("../../hooks");
|
|
|
32
42
|
var import_const = require("../../const");
|
|
33
43
|
var import_store = require("../../store");
|
|
34
44
|
var import_const2 = require("../const");
|
|
45
|
+
var import_payLog = __toESM(require("../../utils/payLog"));
|
|
35
46
|
var useLinklyPayOrRefund = (handleCheck) => {
|
|
36
47
|
const dispatch = (0, import_store.useDispatch)();
|
|
37
48
|
const { numRef, modeRef, orderIdRef, deviceRef, payRef, amountRef } = (0, import_hooks.useStoreRef)();
|
|
@@ -58,10 +69,7 @@ var useLinklyPayOrRefund = (handleCheck) => {
|
|
|
58
69
|
if (!handleCheck()) {
|
|
59
70
|
return;
|
|
60
71
|
}
|
|
61
|
-
(
|
|
62
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-接口成功`,
|
|
63
|
-
content: [{ key: "response", value: JSON.stringify(res) }]
|
|
64
|
-
});
|
|
72
|
+
import_payLog.default.log(`Linkly:${isPay ? "支付" : "退款"}接口成功`, { res });
|
|
65
73
|
const status = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.status;
|
|
66
74
|
if (status == 0) {
|
|
67
75
|
numRef.current = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.session_id;
|
|
@@ -89,9 +97,8 @@ var useLinklyPayOrRefund = (handleCheck) => {
|
|
|
89
97
|
if (!handleCheck()) {
|
|
90
98
|
return;
|
|
91
99
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
content: [{ key: "error", value: JSON.stringify(error) }]
|
|
100
|
+
import_payLog.default.log(`Linkly:${isPay ? "支付" : "退款"}接口失败`, {
|
|
101
|
+
error: JSON.stringify(error || {})
|
|
95
102
|
});
|
|
96
103
|
(_a = failRef.current) == null ? void 0 : _a.call(failRef, error, false);
|
|
97
104
|
};
|
|
@@ -107,10 +114,8 @@ var useLinklyPayOrRefund = (handleCheck) => {
|
|
|
107
114
|
// 交易金额, 包含选择的订单金额+手续费,订单金额+手续费=交易金额
|
|
108
115
|
amount: isPay ? (_c = payRef.current) == null ? void 0 : _c.total : amountRef.current
|
|
109
116
|
};
|
|
110
|
-
(
|
|
111
|
-
|
|
112
|
-
content: [{ key: "params", value: JSON.stringify(param) }]
|
|
113
|
-
});
|
|
117
|
+
import_payLog.default.setContext({ transactionNumber: String(orderIdRef.current) });
|
|
118
|
+
import_payLog.default.log(`Linkly:发起${isPay ? "支付" : "退款"}`, { param });
|
|
114
119
|
_pay.run(param);
|
|
115
120
|
};
|
|
116
121
|
return {
|
|
@@ -129,17 +134,7 @@ var useLinklyCancel = (handleCheck) => {
|
|
|
129
134
|
if (!handleCheck()) {
|
|
130
135
|
return;
|
|
131
136
|
}
|
|
132
|
-
|
|
133
|
-
(0, import_utils.sendWarningLog)({
|
|
134
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-取消成功`,
|
|
135
|
-
content: [{ key: "response", value: JSON.stringify(res) }]
|
|
136
|
-
});
|
|
137
|
-
} else {
|
|
138
|
-
(0, import_utils.sendWarningLog)({
|
|
139
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-取消失败`,
|
|
140
|
-
content: [{ key: "error", value: JSON.stringify(res) }]
|
|
141
|
-
});
|
|
142
|
-
}
|
|
137
|
+
import_payLog.default.log(`Linkly:取消${type === "success" ? "成功" : "失败"}`, { res });
|
|
143
138
|
(_a = resultQueryRef.current) == null ? void 0 : _a.call(resultQueryRef);
|
|
144
139
|
};
|
|
145
140
|
const _cancel = (0, import_ahooks.useRequest)(
|
|
@@ -155,15 +150,10 @@ var useLinklyCancel = (handleCheck) => {
|
|
|
155
150
|
resultQueryRef.current = resultQuery;
|
|
156
151
|
dispatch((0, import_store.updateCustom)({ buttonDisabled: true }));
|
|
157
152
|
const param = {
|
|
158
|
-
// 设备id
|
|
159
153
|
pinpad_id: (_b = (_a = deviceRef == null ? void 0 : deviceRef.current) == null ? void 0 : _a.metadata) == null ? void 0 : _b.linkly_pinpad_id,
|
|
160
|
-
// 交易流水号
|
|
161
154
|
session_id: numRef.current
|
|
162
155
|
};
|
|
163
|
-
(
|
|
164
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-取消`,
|
|
165
|
-
content: [{ key: "params", value: JSON.stringify(param) }]
|
|
166
|
-
});
|
|
156
|
+
import_payLog.default.log("Linkly:发起取消", { param });
|
|
167
157
|
_cancel.run(param);
|
|
168
158
|
dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.CancelWaiting }));
|
|
169
159
|
};
|
|
@@ -183,17 +173,9 @@ var useLinklySignature = (handleCheck) => {
|
|
|
183
173
|
if (!handleCheck()) {
|
|
184
174
|
return;
|
|
185
175
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
content: [{ key: "response", value: JSON.stringify(res) }]
|
|
190
|
-
});
|
|
191
|
-
} else {
|
|
192
|
-
(0, import_utils.sendWarningLog)({
|
|
193
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-签名失败`,
|
|
194
|
-
content: [{ key: "error", value: JSON.stringify(res) }]
|
|
195
|
-
});
|
|
196
|
-
}
|
|
176
|
+
import_payLog.default.log(`Linkly:签名接口${type === "success" ? "成功" : "失败"}`, {
|
|
177
|
+
res
|
|
178
|
+
});
|
|
197
179
|
(_a = resultQueryRef.current) == null ? void 0 : _a.call(resultQueryRef);
|
|
198
180
|
};
|
|
199
181
|
const _signature = (0, import_ahooks.useRequest)(
|
|
@@ -223,10 +205,7 @@ var useLinklySignature = (handleCheck) => {
|
|
|
223
205
|
dispatch(
|
|
224
206
|
(0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.SignatureWaiting })
|
|
225
207
|
);
|
|
226
|
-
(
|
|
227
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-签名`,
|
|
228
|
-
content: [{ key: "params", value: JSON.stringify(param) }]
|
|
229
|
-
});
|
|
208
|
+
import_payLog.default.log("Linkly:发起签名", { param });
|
|
230
209
|
_signature.run(param);
|
|
231
210
|
};
|
|
232
211
|
return {
|
|
@@ -34,17 +34,17 @@ __export(useTimeQuery_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(useTimeQuery_exports);
|
|
35
35
|
var import_react = require("react");
|
|
36
36
|
var import_utils = require("@pisell/utils");
|
|
37
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
38
37
|
var import_store = require("../../store");
|
|
39
38
|
var import_hooks = require("../../hooks");
|
|
40
39
|
var import_const = require("../../const");
|
|
41
40
|
var import_const2 = require("../const");
|
|
41
|
+
var import_payLog = __toESM(require("../../utils/payLog"));
|
|
42
42
|
var GlobalTimeout = 1e3 * 60 * 2;
|
|
43
43
|
var RequestTimeout = 1e3 * 5;
|
|
44
44
|
var QUERY_INTERVAL = 1e3 * 2;
|
|
45
45
|
var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
46
46
|
const dispatch = (0, import_store.useDispatch)();
|
|
47
|
-
const { numRef, modeRef, deviceRef
|
|
47
|
+
const { numRef, modeRef, deviceRef } = (0, import_hooks.useStoreRef)();
|
|
48
48
|
const fail = (0, import_hooks.useFail)(0);
|
|
49
49
|
const failRef = (0, import_react.useRef)(fail);
|
|
50
50
|
const isPay = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay;
|
|
@@ -56,7 +56,6 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
56
56
|
const isRequestCanceledRef = (0, import_react.useRef)(false);
|
|
57
57
|
const startTimeRef = (0, import_react.useRef)(null);
|
|
58
58
|
const isQueryFinishedRef = (0, import_react.useRef)(true);
|
|
59
|
-
const queryIdRef = (0, import_react.useRef)(null);
|
|
60
59
|
const queryIntervalTimerRef = (0, import_react.useRef)(null);
|
|
61
60
|
const _resultQuery = async () => {
|
|
62
61
|
var _a, _b;
|
|
@@ -73,8 +72,7 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
73
72
|
isRequestCanceledRef.current = false;
|
|
74
73
|
requestTimeoutIdRef.current = setTimeout(() => {
|
|
75
74
|
var _a2;
|
|
76
|
-
|
|
77
|
-
_log("RequestTimeout" /* RequestTimeout */);
|
|
75
|
+
import_payLog.default.log("Linkly轮询:单次请求超时");
|
|
78
76
|
(_a2 = controllerRef.current) == null ? void 0 : _a2.abort();
|
|
79
77
|
isRequestCanceledRef.current = true;
|
|
80
78
|
}, RequestTimeout);
|
|
@@ -96,18 +94,13 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
96
94
|
isQueryFinishedRef.current = true;
|
|
97
95
|
const data = (result == null ? void 0 : result.data) || {};
|
|
98
96
|
if (data.status == 1) {
|
|
99
|
-
|
|
100
|
-
(0, import_utils.sendWarningLog)({
|
|
101
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易成功`,
|
|
102
|
-
content: [{ key: "response", value: JSON.stringify(result) }]
|
|
103
|
-
});
|
|
97
|
+
import_payLog.default.log("Linkly轮询:交易成功");
|
|
104
98
|
reset();
|
|
105
99
|
handleLinklySuccess(result);
|
|
106
100
|
return;
|
|
107
101
|
}
|
|
108
102
|
if ((data == null ? void 0 : data.status) == 0 && (data == null ? void 0 : data.signature_flag) != 1) {
|
|
109
|
-
|
|
110
|
-
_log("Querying" /* Querying */, result);
|
|
103
|
+
import_payLog.default.log("Linkly轮询:继续查询", { data });
|
|
111
104
|
isQueryFinishedRef.current = false;
|
|
112
105
|
queryIntervalTimerRef.current = setTimeout(() => {
|
|
113
106
|
_resultQuery();
|
|
@@ -115,22 +108,14 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
115
108
|
return;
|
|
116
109
|
}
|
|
117
110
|
if (data.status < 0) {
|
|
118
|
-
|
|
119
|
-
(0, import_utils.sendWarningLog)({
|
|
120
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易失败`,
|
|
121
|
-
content: [{ key: "response", value: JSON.stringify(result) }]
|
|
122
|
-
});
|
|
111
|
+
import_payLog.default.log("Linkly轮询:交易失败", { data });
|
|
123
112
|
reset();
|
|
124
113
|
result.code = import_const.PayStatus.Unknown;
|
|
125
114
|
(_a2 = failRef.current) == null ? void 0 : _a2.call(failRef, result, false);
|
|
126
115
|
return;
|
|
127
116
|
}
|
|
128
117
|
if (data.signature_flag == 1) {
|
|
129
|
-
|
|
130
|
-
(0, import_utils.sendWarningLog)({
|
|
131
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易需要签名`,
|
|
132
|
-
content: [{ key: "response", value: JSON.stringify(result) }]
|
|
133
|
-
});
|
|
118
|
+
import_payLog.default.log("Linkly轮询:需要签名", { data });
|
|
134
119
|
reset();
|
|
135
120
|
gotoSignature();
|
|
136
121
|
return;
|
|
@@ -144,8 +129,7 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
144
129
|
}
|
|
145
130
|
isQueryFinishedRef.current = true;
|
|
146
131
|
if ((error == null ? void 0 : error.name) === "AbortError" /* AbortError */ || isRequestCanceledRef.current) {
|
|
147
|
-
|
|
148
|
-
console.log("Error: 请求被取消,将继续查询");
|
|
132
|
+
import_payLog.default.log("Linkly轮询:请求被取消,继续查询");
|
|
149
133
|
isQueryFinishedRef.current = false;
|
|
150
134
|
queryIntervalTimerRef.current = setTimeout(() => {
|
|
151
135
|
_resultQuery();
|
|
@@ -153,15 +137,14 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
153
137
|
return;
|
|
154
138
|
}
|
|
155
139
|
if (!(error == null ? void 0 : error.code) || `${error.code}` === import_const.PayStatus.Timeout) {
|
|
156
|
-
|
|
157
|
-
console.log("Error: 网关类报错,将继续查询");
|
|
140
|
+
import_payLog.default.log("Linkly轮询:网关报错,继续查询");
|
|
158
141
|
isQueryFinishedRef.current = false;
|
|
159
142
|
queryIntervalTimerRef.current = setTimeout(() => {
|
|
160
143
|
_resultQuery();
|
|
161
144
|
}, QUERY_INTERVAL);
|
|
162
145
|
return;
|
|
163
146
|
}
|
|
164
|
-
|
|
147
|
+
import_payLog.default.log("Linkly轮询:查询失败", { error });
|
|
165
148
|
reset();
|
|
166
149
|
(_a2 = failRef.current) == null ? void 0 : _a2.call(failRef, error, true);
|
|
167
150
|
}).finally(() => {
|
|
@@ -195,8 +178,7 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
195
178
|
return false;
|
|
196
179
|
};
|
|
197
180
|
const reset = () => {
|
|
198
|
-
|
|
199
|
-
_log("Reset" /* Reset */);
|
|
181
|
+
import_payLog.default.log("Linkly轮询:重置查询状态");
|
|
200
182
|
if (globalTimeoutIdRef.current) {
|
|
201
183
|
clearTimeout(globalTimeoutIdRef.current);
|
|
202
184
|
globalTimeoutIdRef.current = null;
|
|
@@ -216,52 +198,18 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
216
198
|
startTimeRef.current = null;
|
|
217
199
|
isRequestCanceledRef.current = false;
|
|
218
200
|
isQueryFinishedRef.current = true;
|
|
219
|
-
queryIdRef.current = null;
|
|
220
|
-
};
|
|
221
|
-
const _log = (type, res) => {
|
|
222
|
-
var _a, _b;
|
|
223
|
-
const params = {
|
|
224
|
-
// 设备id
|
|
225
|
-
pinpad_id: (_b = (_a = deviceRef == null ? void 0 : deviceRef.current) == null ? void 0 : _a.metadata) == null ? void 0 : _b.linkly_pinpad_id,
|
|
226
|
-
// 交易流水号
|
|
227
|
-
session_id: numRef.current
|
|
228
|
-
};
|
|
229
|
-
const content = [
|
|
230
|
-
{
|
|
231
|
-
key: "description",
|
|
232
|
-
value: JSON.stringify({
|
|
233
|
-
queryId: queryIdRef.current,
|
|
234
|
-
orderId: orderIdRef.current,
|
|
235
|
-
type,
|
|
236
|
-
date: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
|
237
|
-
})
|
|
238
|
-
},
|
|
239
|
-
{ key: "params", value: JSON.stringify(params) }
|
|
240
|
-
];
|
|
241
|
-
if (type === "Error" /* Error */) {
|
|
242
|
-
content.push({ key: "error", value: JSON.stringify(res) });
|
|
243
|
-
} else {
|
|
244
|
-
content.push({ key: "response", value: JSON.stringify(res) });
|
|
245
|
-
}
|
|
246
|
-
(0, import_utils.sendWarningLog)({
|
|
247
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易结果轮询`,
|
|
248
|
-
content
|
|
249
|
-
});
|
|
250
201
|
};
|
|
251
202
|
const run = () => {
|
|
252
203
|
reset();
|
|
253
204
|
globalTimeoutIdRef.current = setTimeout(() => {
|
|
254
205
|
var _a;
|
|
255
|
-
|
|
256
|
-
_log("GlobalTimeout" /* GlobalTimeout */);
|
|
206
|
+
import_payLog.default.log("Linkly轮询:全局超时");
|
|
257
207
|
setTimeout(reset, 0);
|
|
258
208
|
(_a = failRef.current) == null ? void 0 : _a.call(failRef, { code: import_const.PayStatus.Timeout }, false);
|
|
259
209
|
}, GlobalTimeout);
|
|
260
210
|
startTimeRef.current = Date.now();
|
|
261
211
|
isQueryFinishedRef.current = false;
|
|
262
|
-
|
|
263
|
-
console.log("开始查询linkly结果---->>>>>>>");
|
|
264
|
-
_log("Start" /* Start */);
|
|
212
|
+
import_payLog.default.log("Linkly轮询:开始查询");
|
|
265
213
|
return _resultQuery();
|
|
266
214
|
};
|
|
267
215
|
return { run, stop: reset };
|
|
@@ -44,6 +44,7 @@ var import_const = require("../const");
|
|
|
44
44
|
var import_hooks2 = require("./hooks");
|
|
45
45
|
var import_const2 = require("./const");
|
|
46
46
|
var import_helper = require("../helper");
|
|
47
|
+
var import_payLog = __toESM(require("../utils/payLog"));
|
|
47
48
|
var Linkly = ({ api, onChange }) => {
|
|
48
49
|
const context = (0, import_useEngineContext.default)();
|
|
49
50
|
const utils = context.appHelper.utils || {};
|
|
@@ -69,6 +70,7 @@ var Linkly = ({ api, onChange }) => {
|
|
|
69
70
|
const clearRef = (0, import_react.useRef)();
|
|
70
71
|
const handleCheck = () => !(unloadRef.current || !netRef.current);
|
|
71
72
|
const handleLinklySuccess = (res) => {
|
|
73
|
+
import_payLog.default.log("Linkly:最终支付成功");
|
|
72
74
|
const resData = (res == null ? void 0 : res.data) || {};
|
|
73
75
|
let receipt = Array.isArray(resData == null ? void 0 : resData.receipt) ? resData.receipt : [resData.receipt];
|
|
74
76
|
receipt = receipt.filter((item) => typeof item === "string").filter(Boolean);
|
|
@@ -148,18 +150,10 @@ var Linkly = ({ api, onChange }) => {
|
|
|
148
150
|
if (activeStatus !== "unActive") {
|
|
149
151
|
payOrRefund(resultQuery, handleLinklySuccess);
|
|
150
152
|
} else {
|
|
151
|
-
(
|
|
152
|
-
title: "Linkly-支付-当前页面非活跃状态,无法进行支付",
|
|
153
|
-
content: [
|
|
154
|
-
{ key: "response", value: JSON.stringify({ activeStatus }) }
|
|
155
|
-
]
|
|
156
|
-
});
|
|
153
|
+
import_payLog.default.log("Linkly:页面非活跃状态,阻断支付", { activeStatus });
|
|
157
154
|
}
|
|
158
155
|
} catch (error) {
|
|
159
|
-
(
|
|
160
|
-
title: "Linkly-支付-获取当前页面活跃状态失败",
|
|
161
|
-
content: [{ key: "error", value: JSON.stringify(error) }]
|
|
162
|
-
});
|
|
156
|
+
import_payLog.default.log("Linkly:获取页面活跃状态失败", { error });
|
|
163
157
|
payOrRefund(resultQuery, handleLinklySuccess);
|
|
164
158
|
}
|
|
165
159
|
};
|
|
@@ -179,14 +173,17 @@ var Linkly = ({ api, onChange }) => {
|
|
|
179
173
|
};
|
|
180
174
|
}, []);
|
|
181
175
|
const onCancel = () => {
|
|
176
|
+
import_payLog.default.log("Linkly:点击取消支付");
|
|
182
177
|
stopResultQuery();
|
|
183
178
|
linklyCancel(resultQuery);
|
|
184
179
|
};
|
|
185
180
|
const onDecline = () => {
|
|
181
|
+
import_payLog.default.log("Linkly:签名-点击拒绝");
|
|
186
182
|
stopResultQuery();
|
|
187
183
|
linklySignature(2, resultQuery);
|
|
188
184
|
};
|
|
189
185
|
const onAccept = () => {
|
|
186
|
+
import_payLog.default.log("Linkly:签名-点击接受");
|
|
190
187
|
stopResultQuery();
|
|
191
188
|
linklySignature(3, resultQuery);
|
|
192
189
|
};
|
|
@@ -46,6 +46,7 @@ var import_const = require("./const");
|
|
|
46
46
|
var import_manufacturer = require("./manufacturer");
|
|
47
47
|
var import_store = require("./store");
|
|
48
48
|
var import_index = require("./index.less");
|
|
49
|
+
var import_payLog = __toESM(require("./utils/payLog"));
|
|
49
50
|
var Mapping = {
|
|
50
51
|
Fail: import_fail.default,
|
|
51
52
|
Network: import_network.default,
|
|
@@ -73,7 +74,10 @@ var Pay = ({
|
|
|
73
74
|
const statusRef = (0, import_react.useRef)(data.status);
|
|
74
75
|
const comonentRef = (0, import_react.useRef)(data.component);
|
|
75
76
|
const backupRef = (0, import_react.useRef)(data.backup);
|
|
76
|
-
const clearRef = (0, import_react.useRef)(
|
|
77
|
+
const clearRef = (0, import_react.useRef)(null);
|
|
78
|
+
(0, import_react.useEffect)(() => {
|
|
79
|
+
import_payLog.default.log("支付组件初始化");
|
|
80
|
+
}, []);
|
|
77
81
|
(0, import_react.useEffect)(() => {
|
|
78
82
|
comonentRef.current = data.component;
|
|
79
83
|
}, [data.component]);
|
|
@@ -107,6 +111,7 @@ var Pay = ({
|
|
|
107
111
|
if (!ref.current) {
|
|
108
112
|
ref.current = true;
|
|
109
113
|
if (backupRef.current && net) {
|
|
114
|
+
import_payLog.default.log("网络恢复:从备份恢复", { hasBackup: true });
|
|
110
115
|
const { ...data2 } = backupRef.current;
|
|
111
116
|
dispatch((0, import_store.backUpFree)({ key: Date.now() }));
|
|
112
117
|
dispatch((0, import_store.updateState)({ net }));
|
|
@@ -121,6 +126,7 @@ var Pay = ({
|
|
|
121
126
|
return;
|
|
122
127
|
}
|
|
123
128
|
if (net) {
|
|
129
|
+
import_payLog.default.log("网络恢复", { hasBackup: !!backupRef.current });
|
|
124
130
|
const { ...data2 } = backupRef.current;
|
|
125
131
|
dispatch((0, import_store.backUpFree)({ key: Date.now() }));
|
|
126
132
|
dispatch((0, import_store.updateState)({ net }));
|
|
@@ -133,6 +139,7 @@ var Pay = ({
|
|
|
133
139
|
}
|
|
134
140
|
return;
|
|
135
141
|
}
|
|
142
|
+
import_payLog.default.log("网络断开,备份数据");
|
|
136
143
|
dispatch((0, import_store.updateState)({ form: "Network" }));
|
|
137
144
|
dispatch((0, import_store.backUpProduction)({}));
|
|
138
145
|
dispatch((0, import_store.updateState)({ net, status: "warn" }));
|
|
@@ -142,6 +149,7 @@ var Pay = ({
|
|
|
142
149
|
return () => {
|
|
143
150
|
if (clearRef.current) {
|
|
144
151
|
clearTimeout(clearRef.current);
|
|
152
|
+
clearRef.current = null;
|
|
145
153
|
}
|
|
146
154
|
};
|
|
147
155
|
}, []);
|
|
@@ -43,6 +43,7 @@ var import_hooks = require("../hooks");
|
|
|
43
43
|
var import_store = require("../store");
|
|
44
44
|
var import_hooks2 = require("./hooks");
|
|
45
45
|
var import_payment = require("./payment");
|
|
46
|
+
var import_payLog = __toESM(require("../utils/payLog"));
|
|
46
47
|
var POS = ({
|
|
47
48
|
api,
|
|
48
49
|
onChange
|
|
@@ -65,7 +66,7 @@ var POS = ({
|
|
|
65
66
|
const fail = (0, import_hooks.useFail)(0);
|
|
66
67
|
const failRef = (0, import_react.useRef)(fail);
|
|
67
68
|
const controllerRef = (0, import_react.useRef)();
|
|
68
|
-
const clearRef = (0, import_react.useRef)();
|
|
69
|
+
const clearRef = (0, import_react.useRef)(null);
|
|
69
70
|
const initRef = (0, import_react.useRef)(false);
|
|
70
71
|
const unloadRef = (0, import_react.useRef)(false);
|
|
71
72
|
const [check] = (0, import_hooks2.useValidate)(1e3 * 60);
|
|
@@ -199,7 +200,9 @@ var POS = ({
|
|
|
199
200
|
)
|
|
200
201
|
)
|
|
201
202
|
};
|
|
203
|
+
import_payLog.default.setContext({ transactionNumber: numRef.current });
|
|
202
204
|
if (isPay) {
|
|
205
|
+
import_payLog.default.log("Payo:发起支付", { isPay, number: numRef.current });
|
|
203
206
|
paymentRun({
|
|
204
207
|
paymentType: import_payment.ActionType.Pay,
|
|
205
208
|
paymentNum: numRef.current,
|
|
@@ -208,41 +211,42 @@ var POS = ({
|
|
|
208
211
|
params: apiParams,
|
|
209
212
|
callbacks: {
|
|
210
213
|
onSuccess: (res) => {
|
|
214
|
+
import_payLog.default.log("Payo:支付成功", { code: res == null ? void 0 : res.code });
|
|
211
215
|
success(res);
|
|
212
216
|
},
|
|
213
217
|
onError: (err) => {
|
|
214
|
-
|
|
218
|
+
import_payLog.default.log("Payo:支付失败", { code: err == null ? void 0 : err.code });
|
|
215
219
|
failRef.current(err, true);
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
222
|
});
|
|
219
223
|
return;
|
|
220
224
|
} else {
|
|
225
|
+
import_payLog.default.log("Payo:发起退款", { isPay, number: numRef.current });
|
|
221
226
|
const resultPromise = api.refund(apiParams, { signal: controllerRef.current.signal });
|
|
222
227
|
resultPromise.then((res) => {
|
|
223
228
|
console.log("netRef.current111 = ", netRef.current);
|
|
224
229
|
if (unloadRef.current || !netRef.current) {
|
|
230
|
+
import_payLog.default.log("Payo:退款拦截", { isUnload: unloadRef.current, isNet: netRef.current });
|
|
225
231
|
return;
|
|
226
232
|
}
|
|
227
233
|
if (res && `${res.code}` === "200") {
|
|
234
|
+
import_payLog.default.log("Payo:退款成功", { res: JSON.stringify(res) });
|
|
228
235
|
success(res);
|
|
229
236
|
return;
|
|
230
237
|
}
|
|
231
238
|
return Promise.reject(res);
|
|
232
239
|
}).catch((err) => {
|
|
233
|
-
console.log(
|
|
234
|
-
"netRef.current222 = ",
|
|
235
|
-
netRef.current,
|
|
236
|
-
unloadRef.current,
|
|
237
|
-
err
|
|
238
|
-
);
|
|
239
240
|
if (unloadRef.current || !netRef.current) {
|
|
241
|
+
import_payLog.default.log("Payo:退款失败拦截", { isUnload: unloadRef.current, isNet: netRef.current });
|
|
240
242
|
return;
|
|
241
243
|
}
|
|
242
244
|
if (!(err == null ? void 0 : err.code) || `${err.code}` === import_const.PayStatus.Timeout) {
|
|
245
|
+
import_payLog.default.log("Payo:退款超时,转查询");
|
|
243
246
|
checkApi();
|
|
244
247
|
return;
|
|
245
248
|
}
|
|
249
|
+
import_payLog.default.log("Payo:退款失败", { code: err == null ? void 0 : err.code, message: err == null ? void 0 : err.message });
|
|
246
250
|
failRef.current(err, true);
|
|
247
251
|
});
|
|
248
252
|
}
|
|
@@ -268,12 +272,14 @@ var Action = ({ onChange }) => {
|
|
|
268
272
|
(0, import_react.useEffect)(() => {
|
|
269
273
|
const timer = setTimeout(() => {
|
|
270
274
|
setIsShowCancel(true);
|
|
275
|
+
import_payLog.default.log("Payo:30秒后显示取消按钮");
|
|
271
276
|
}, 30 * 1e3);
|
|
272
277
|
return () => {
|
|
273
278
|
clearTimeout(timer);
|
|
274
279
|
};
|
|
275
280
|
}, []);
|
|
276
281
|
const onManually = () => {
|
|
282
|
+
import_payLog.default.log("Payo:点击手动标记");
|
|
277
283
|
dispatch(
|
|
278
284
|
(0, import_store.updateState)({
|
|
279
285
|
manual: {
|
|
@@ -285,6 +291,7 @@ var Action = ({ onChange }) => {
|
|
|
285
291
|
dispatch((0, import_store.updateComponent)("Manual", true));
|
|
286
292
|
};
|
|
287
293
|
const onCancel = () => {
|
|
294
|
+
import_payLog.default.log("Payo:点击取消");
|
|
288
295
|
onChange("fail", { number, uniquePaymentNumber: number, device, order_id });
|
|
289
296
|
};
|
|
290
297
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, client !== import_const.ClientEnum.Merchant && isShowCancel && /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -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/eftposPay/payo/hooks.tsx
|
|
@@ -25,7 +35,7 @@ module.exports = __toCommonJS(hooks_exports);
|
|
|
25
35
|
var import_react = require("react");
|
|
26
36
|
var import_const = require("../const");
|
|
27
37
|
var import_helper = require("../helper");
|
|
28
|
-
var
|
|
38
|
+
var import_payLog = __toESM(require("../utils/payLog"));
|
|
29
39
|
var useValidate = (timeout) => {
|
|
30
40
|
const controllerRef = (0, import_react.useRef)();
|
|
31
41
|
const ref = (0, import_react.useRef)(true);
|
|
@@ -79,15 +89,7 @@ var useValidate = (timeout) => {
|
|
|
79
89
|
TimeoutRef.current && clearTimeout(TimeoutRef.current);
|
|
80
90
|
TimeoutRef.current = setTimeout(() => {
|
|
81
91
|
isTimeoutCloseRef.current = true;
|
|
82
|
-
(
|
|
83
|
-
title: "支付状态查询超时",
|
|
84
|
-
content: [
|
|
85
|
-
{
|
|
86
|
-
key: "params",
|
|
87
|
-
value: JSON.stringify(params)
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
});
|
|
92
|
+
import_payLog.default.log("Payo:支付状态查询超时");
|
|
91
93
|
close();
|
|
92
94
|
}, timeout);
|
|
93
95
|
return checkApi(...params);
|