@pisell/private-materials 6.6.61 → 6.6.63
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/info2/service/editService/index.js +76 -8
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/es/components/eftpos/PairModal/hooks.js +67 -0
- package/es/components/eftpos/PairModal/index.d.ts +11 -0
- package/es/components/eftpos/PairModal/index.js +246 -0
- package/es/components/eftpos/PairModal/index.less +70 -0
- package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/Action.js +141 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/index.js +135 -0
- package/es/components/eftpos/SettlementModal/index.less +33 -0
- package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/es/components/eftpos/SettlementModal/serve.js +171 -0
- package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/es/components/eftpos/SettlementModal/types.js +35 -0
- package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/es/components/eftpos/SettlementModal/utils.js +351 -0
- package/es/components/eftpos/assets/mx51SCI.svg +15 -0
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +14 -3
- package/es/components/eftpos/hooks.d.ts +13 -0
- package/es/components/eftpos/hooks.js +35 -0
- package/es/components/eftpos/index.js +198 -24
- package/es/components/eftpos/index.less +32 -1
- package/es/components/eftpos/locales.d.ts +80 -0
- package/es/components/eftpos/locales.js +205 -25
- package/es/components/eftpos/table.js +47 -3
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/es/components/eftposPay/aggregatePayment/index.js +2 -1
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.js +1 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/es/components/eftposPay/aggregatePayment/types.js +4 -8
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -3
- package/es/components/eftposPay/component/fail/failCustom.js +13 -4
- package/es/components/eftposPay/component/fail/index.js +12 -5
- 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 +17 -3
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/const.d.ts +8 -3
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/device.js +225 -38
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +2 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.js +50 -13
- package/es/components/eftposPay/linkly/const.js +1 -1
- 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 +11 -23
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +30 -15
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +144 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +498 -0
- package/es/components/eftposPay/mx51/types.d.ts +142 -0
- package/es/components/eftposPay/mx51/types.js +35 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +121 -0
- package/es/components/eftposPay/pay.js +21 -9
- package/es/components/eftposPay/payo/config.js +39 -5
- package/es/components/eftposPay/payo/const.js +1 -1
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/store/index.d.ts +5 -9
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/const.js +1 -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 +458 -0
- package/es/components/eftposPay/windcave/const.js +1 -1
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +37 -38
- package/es/components/ticketBooking/utils/formatProductMessage.js +47 -2
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/info2/service/editService/index.js +56 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/lib/components/eftpos/PairModal/hooks.js +70 -0
- package/lib/components/eftpos/PairModal/index.d.ts +11 -0
- package/lib/components/eftpos/PairModal/index.js +197 -0
- package/lib/components/eftpos/PairModal/index.less +70 -0
- package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/Action.js +153 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/index.js +170 -0
- package/lib/components/eftpos/SettlementModal/index.less +33 -0
- package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/lib/components/eftpos/SettlementModal/serve.js +45 -0
- package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/lib/components/eftpos/SettlementModal/types.js +43 -0
- package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/lib/components/eftpos/SettlementModal/utils.js +248 -0
- package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +13 -3
- package/lib/components/eftpos/hooks.d.ts +13 -0
- package/lib/components/eftpos/hooks.js +30 -0
- package/lib/components/eftpos/index.js +121 -8
- package/lib/components/eftpos/index.less +32 -1
- package/lib/components/eftpos/locales.d.ts +80 -0
- package/lib/components/eftpos/locales.js +231 -21
- package/lib/components/eftpos/table.js +30 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +4 -5
- 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 +16 -2
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/const.d.ts +8 -3
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/device.js +114 -25
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +2 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.js +38 -13
- package/lib/components/eftposPay/linkly/const.js +1 -1
- 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 +8 -10
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +30 -15
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +154 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +433 -0
- package/lib/components/eftposPay/mx51/types.d.ts +142 -0
- package/lib/components/eftposPay/mx51/types.js +43 -0
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +115 -0
- package/lib/components/eftposPay/pay.js +13 -3
- package/lib/components/eftposPay/payo/config.js +16 -8
- package/lib/components/eftposPay/payo/const.js +1 -1
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/store/index.d.ts +5 -9
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/const.js +1 -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 +321 -0
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +27 -29
- package/lib/components/ticketBooking/utils/formatProductMessage.js +44 -2
- package/package.json +4 -4
- package/es/components/eftposPay/utils/log/index.d.ts +0 -110
- package/es/components/eftposPay/utils/log/index.js +0 -371
- package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
- package/lib/components/eftposPay/utils/log/index.js +0 -294
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useRequest } from 'ahooks';
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
import { locales
|
|
3
|
+
import { locales } from '@pisell/utils';
|
|
4
4
|
import { linklyPayCancelApi, linklyPayApi, linklyRefundCancelApi, linklyRefundApi, linklyPaySignatureApi, linklyRefundSignatureApi } from "../service";
|
|
5
5
|
import { useFail, useStoreRef } from "../../hooks";
|
|
6
6
|
import { ModeEnum, PayStatus, StatusEnum } from "../../const";
|
|
7
7
|
import { useDispatch, updateState, updateCustom, updateStatus } from "../../store";
|
|
8
8
|
import { LinklyActionStatus } from "../const";
|
|
9
|
+
import payLog from "../../utils/payLog";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* 支付或退款
|
|
@@ -61,12 +62,8 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
|
61
62
|
if (!handleCheck()) {
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
content: [{
|
|
67
|
-
key: 'response',
|
|
68
|
-
value: JSON.stringify(res)
|
|
69
|
-
}]
|
|
65
|
+
payLog.log("Linkly\uFF1A".concat(isPay ? '支付' : '退款', "\u63A5\u53E3\u6210\u529F"), {
|
|
66
|
+
res: res
|
|
70
67
|
});
|
|
71
68
|
|
|
72
69
|
// status 交易状态 0:未知,继续查询 1:成功 -1:失败 -2:交易错误
|
|
@@ -120,12 +117,8 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
|
120
117
|
if (!handleCheck()) {
|
|
121
118
|
return;
|
|
122
119
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
content: [{
|
|
126
|
-
key: 'error',
|
|
127
|
-
value: JSON.stringify(error)
|
|
128
|
-
}]
|
|
120
|
+
payLog.log("Linkly\uFF1A".concat(isPay ? '支付' : '退款', "\u63A5\u53E3\u5931\u8D25"), {
|
|
121
|
+
error: JSON.stringify(error || {})
|
|
129
122
|
});
|
|
130
123
|
(_failRef$current2 = failRef.current) === null || _failRef$current2 === void 0 || _failRef$current2.call(failRef, error, false);
|
|
131
124
|
};
|
|
@@ -141,12 +134,11 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
|
|
|
141
134
|
// 交易金额, 包含选择的订单金额+手续费,订单金额+手续费=交易金额
|
|
142
135
|
amount: isPay ? (_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total : amountRef.current
|
|
143
136
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}]
|
|
137
|
+
payLog.setContext({
|
|
138
|
+
transactionNumber: String(orderIdRef.current)
|
|
139
|
+
});
|
|
140
|
+
payLog.log("Linkly\uFF1A\u53D1\u8D77".concat(isPay ? '支付' : '退款'), {
|
|
141
|
+
param: param
|
|
150
142
|
});
|
|
151
143
|
_pay.run(param);
|
|
152
144
|
};
|
|
@@ -179,23 +171,9 @@ export var useLinklyCancel = function useLinklyCancel(handleCheck) {
|
|
|
179
171
|
if (!handleCheck()) {
|
|
180
172
|
return;
|
|
181
173
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
content: [{
|
|
186
|
-
key: 'response',
|
|
187
|
-
value: JSON.stringify(res)
|
|
188
|
-
}]
|
|
189
|
-
});
|
|
190
|
-
} else {
|
|
191
|
-
sendWarningLog({
|
|
192
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u53D6\u6D88\u5931\u8D25"),
|
|
193
|
-
content: [{
|
|
194
|
-
key: 'error',
|
|
195
|
-
value: JSON.stringify(res)
|
|
196
|
-
}]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
174
|
+
payLog.log("Linkly\uFF1A\u53D6\u6D88".concat(type === 'success' ? '成功' : '失败'), {
|
|
175
|
+
res: res
|
|
176
|
+
});
|
|
199
177
|
(_resultQueryRef$curre2 = resultQueryRef.current) === null || _resultQueryRef$curre2 === void 0 || _resultQueryRef$curre2.call(resultQueryRef);
|
|
200
178
|
};
|
|
201
179
|
var _cancel = useRequest(isPay ? linklyPayCancelApi : linklyRefundCancelApi, {
|
|
@@ -210,22 +188,15 @@ export var useLinklyCancel = function useLinklyCancel(handleCheck) {
|
|
|
210
188
|
var linklyCancel = function linklyCancel(resultQuery) {
|
|
211
189
|
var _deviceRef$current2;
|
|
212
190
|
resultQueryRef.current = resultQuery;
|
|
213
|
-
// 需要将按钮状态锁定,防止重复点击
|
|
214
191
|
dispatch(updateCustom({
|
|
215
192
|
buttonDisabled: true
|
|
216
193
|
}));
|
|
217
194
|
var param = {
|
|
218
|
-
// 设备id
|
|
219
195
|
pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 || (_deviceRef$current2 = _deviceRef$current2.metadata) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.linkly_pinpad_id,
|
|
220
|
-
// 交易流水号
|
|
221
196
|
session_id: numRef.current
|
|
222
197
|
};
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
content: [{
|
|
226
|
-
key: 'params',
|
|
227
|
-
value: JSON.stringify(param)
|
|
228
|
-
}]
|
|
198
|
+
payLog.log('Linkly:发起取消', {
|
|
199
|
+
param: param
|
|
229
200
|
});
|
|
230
201
|
_cancel.run(param);
|
|
231
202
|
dispatch(updateCustom({
|
|
@@ -258,23 +229,9 @@ export var useLinklySignature = function useLinklySignature(handleCheck) {
|
|
|
258
229
|
if (!handleCheck()) {
|
|
259
230
|
return;
|
|
260
231
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
content: [{
|
|
265
|
-
key: 'response',
|
|
266
|
-
value: JSON.stringify(res)
|
|
267
|
-
}]
|
|
268
|
-
});
|
|
269
|
-
} else {
|
|
270
|
-
sendWarningLog({
|
|
271
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7B7E\u540D\u5931\u8D25"),
|
|
272
|
-
content: [{
|
|
273
|
-
key: 'error',
|
|
274
|
-
value: JSON.stringify(res)
|
|
275
|
-
}]
|
|
276
|
-
});
|
|
277
|
-
}
|
|
232
|
+
payLog.log("Linkly\uFF1A\u7B7E\u540D\u63A5\u53E3".concat(type === 'success' ? '成功' : '失败'), {
|
|
233
|
+
res: res
|
|
234
|
+
});
|
|
278
235
|
(_resultQueryRef$curre3 = resultQueryRef.current) === null || _resultQueryRef$curre3 === void 0 || _resultQueryRef$curre3.call(resultQueryRef);
|
|
279
236
|
};
|
|
280
237
|
var _signature = useRequest(isPay ? linklyPaySignatureApi : linklyRefundSignatureApi, {
|
|
@@ -303,12 +260,8 @@ export var useLinklySignature = function useLinklySignature(handleCheck) {
|
|
|
303
260
|
dispatch(updateCustom({
|
|
304
261
|
actionStatus: LinklyActionStatus.SignatureWaiting
|
|
305
262
|
}));
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
content: [{
|
|
309
|
-
key: 'params',
|
|
310
|
-
value: JSON.stringify(param)
|
|
311
|
-
}]
|
|
263
|
+
payLog.log('Linkly:发起签名', {
|
|
264
|
+
param: param
|
|
312
265
|
});
|
|
313
266
|
_signature.run(param);
|
|
314
267
|
};
|
|
@@ -3,12 +3,12 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
import { useRef } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
import dayjs from 'dayjs';
|
|
6
|
+
import { locales } from '@pisell/utils';
|
|
8
7
|
import { useDispatch, updateCustom, updateStatus, updateState } from "../../store";
|
|
9
8
|
import { useFail, useStoreRef } from "../../hooks";
|
|
10
9
|
import { ModeEnum, PayStatus, StatusEnum } from "../../const";
|
|
11
10
|
import { LinklyActionStatus } from "../const";
|
|
11
|
+
import payLog from "../../utils/payLog";
|
|
12
12
|
|
|
13
13
|
// 全局超时时间
|
|
14
14
|
var GlobalTimeout = 1000 * 60 * 2;
|
|
@@ -21,8 +21,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
21
21
|
var _useStoreRef = useStoreRef(),
|
|
22
22
|
numRef = _useStoreRef.numRef,
|
|
23
23
|
modeRef = _useStoreRef.modeRef,
|
|
24
|
-
deviceRef = _useStoreRef.deviceRef
|
|
25
|
-
orderIdRef = _useStoreRef.orderIdRef;
|
|
24
|
+
deviceRef = _useStoreRef.deviceRef;
|
|
26
25
|
var fail = useFail(0);
|
|
27
26
|
var failRef = useRef(fail);
|
|
28
27
|
var isPay = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay;
|
|
@@ -38,8 +37,6 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
38
37
|
var startTimeRef = useRef(null);
|
|
39
38
|
// 查询是否结束
|
|
40
39
|
var isQueryFinishedRef = useRef(true);
|
|
41
|
-
// 每轮查询的唯一标识
|
|
42
|
-
var queryIdRef = useRef(null);
|
|
43
40
|
// 轮询间隔定时器
|
|
44
41
|
var queryIntervalTimerRef = useRef(null);
|
|
45
42
|
var _resultQuery = /*#__PURE__*/function () {
|
|
@@ -64,8 +61,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
64
61
|
// 设置单次请求超时定时器
|
|
65
62
|
requestTimeoutIdRef.current = setTimeout(function () {
|
|
66
63
|
var _controllerRef$curren;
|
|
67
|
-
|
|
68
|
-
_log("RequestTimeout");
|
|
64
|
+
payLog.log('Linkly轮询:单次请求超时');
|
|
69
65
|
(_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 || _controllerRef$curren.abort();
|
|
70
66
|
isRequestCanceledRef.current = true;
|
|
71
67
|
}, RequestTimeout);
|
|
@@ -92,14 +88,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
92
88
|
var data = (result === null || result === void 0 ? void 0 : result.data) || {};
|
|
93
89
|
// 交易成功,终止查询
|
|
94
90
|
if (data.status == 1) {
|
|
95
|
-
|
|
96
|
-
sendWarningLog({
|
|
97
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u6210\u529F"),
|
|
98
|
-
content: [{
|
|
99
|
-
key: 'response',
|
|
100
|
-
value: JSON.stringify(result)
|
|
101
|
-
}]
|
|
102
|
-
});
|
|
91
|
+
payLog.log('Linkly轮询:交易成功');
|
|
103
92
|
reset();
|
|
104
93
|
handleLinklySuccess(result);
|
|
105
94
|
return;
|
|
@@ -107,8 +96,9 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
107
96
|
|
|
108
97
|
// 交易状态为0,且不需要签名,则继续查询
|
|
109
98
|
if ((data === null || data === void 0 ? void 0 : data.status) == 0 && (data === null || data === void 0 ? void 0 : data.signature_flag) != 1) {
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
payLog.log('Linkly轮询:继续查询', {
|
|
100
|
+
data: data
|
|
101
|
+
});
|
|
112
102
|
isQueryFinishedRef.current = false;
|
|
113
103
|
queryIntervalTimerRef.current = setTimeout(function () {
|
|
114
104
|
_resultQuery();
|
|
@@ -119,13 +109,8 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
119
109
|
// 交易状态为-1,则交易失败,不可前往支付标记页面
|
|
120
110
|
if (data.status < 0) {
|
|
121
111
|
var _failRef$current;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u5931\u8D25"),
|
|
125
|
-
content: [{
|
|
126
|
-
key: 'response',
|
|
127
|
-
value: JSON.stringify(result)
|
|
128
|
-
}]
|
|
112
|
+
payLog.log('Linkly轮询:交易失败', {
|
|
113
|
+
data: data
|
|
129
114
|
});
|
|
130
115
|
reset();
|
|
131
116
|
// 交易失败,code码转换为支付失败code码
|
|
@@ -136,13 +121,8 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
136
121
|
|
|
137
122
|
// 需要签名
|
|
138
123
|
if (data.signature_flag == 1) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u9700\u8981\u7B7E\u540D"),
|
|
142
|
-
content: [{
|
|
143
|
-
key: 'response',
|
|
144
|
-
value: JSON.stringify(result)
|
|
145
|
-
}]
|
|
124
|
+
payLog.log('Linkly轮询:需要签名', {
|
|
125
|
+
data: data
|
|
146
126
|
});
|
|
147
127
|
reset();
|
|
148
128
|
gotoSignature();
|
|
@@ -158,8 +138,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
158
138
|
}
|
|
159
139
|
isQueryFinishedRef.current = true;
|
|
160
140
|
if ((error === null || error === void 0 ? void 0 : error.name) === "AbortError" || isRequestCanceledRef.current) {
|
|
161
|
-
|
|
162
|
-
console.log('Error: 请求被取消,将继续查询');
|
|
141
|
+
payLog.log('Linkly轮询:请求被取消,继续查询');
|
|
163
142
|
isQueryFinishedRef.current = false;
|
|
164
143
|
queryIntervalTimerRef.current = setTimeout(function () {
|
|
165
144
|
_resultQuery();
|
|
@@ -169,15 +148,16 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
169
148
|
|
|
170
149
|
// 网关类报错,继续查询
|
|
171
150
|
if (!(error !== null && error !== void 0 && error.code) || "".concat(error.code) === PayStatus.Timeout) {
|
|
172
|
-
|
|
173
|
-
console.log('Error: 网关类报错,将继续查询');
|
|
151
|
+
payLog.log('Linkly轮询:网关报错,继续查询');
|
|
174
152
|
isQueryFinishedRef.current = false;
|
|
175
153
|
queryIntervalTimerRef.current = setTimeout(function () {
|
|
176
154
|
_resultQuery();
|
|
177
155
|
}, QUERY_INTERVAL);
|
|
178
156
|
return;
|
|
179
157
|
}
|
|
180
|
-
|
|
158
|
+
payLog.log('Linkly轮询:查询失败', {
|
|
159
|
+
error: error
|
|
160
|
+
});
|
|
181
161
|
reset();
|
|
182
162
|
(_failRef$current2 = failRef.current) === null || _failRef$current2 === void 0 || _failRef$current2.call(failRef, error, true);
|
|
183
163
|
}).finally(function () {
|
|
@@ -236,8 +216,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
236
216
|
* 重置查询状态
|
|
237
217
|
*/
|
|
238
218
|
var reset = function reset() {
|
|
239
|
-
|
|
240
|
-
_log("Reset");
|
|
219
|
+
payLog.log('Linkly轮询:重置查询状态');
|
|
241
220
|
if (globalTimeoutIdRef.current) {
|
|
242
221
|
clearTimeout(globalTimeoutIdRef.current);
|
|
243
222
|
globalTimeoutIdRef.current = null;
|
|
@@ -257,43 +236,6 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
257
236
|
startTimeRef.current = null;
|
|
258
237
|
isRequestCanceledRef.current = false;
|
|
259
238
|
isQueryFinishedRef.current = true;
|
|
260
|
-
queryIdRef.current = null;
|
|
261
|
-
};
|
|
262
|
-
var _log = function _log(type, res) {
|
|
263
|
-
var _deviceRef$current2;
|
|
264
|
-
var params = {
|
|
265
|
-
// 设备id
|
|
266
|
-
pinpad_id: deviceRef === null || deviceRef === void 0 || (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 || (_deviceRef$current2 = _deviceRef$current2.metadata) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.linkly_pinpad_id,
|
|
267
|
-
// 交易流水号
|
|
268
|
-
session_id: numRef.current
|
|
269
|
-
};
|
|
270
|
-
var content = [{
|
|
271
|
-
key: 'description',
|
|
272
|
-
value: JSON.stringify({
|
|
273
|
-
queryId: queryIdRef.current,
|
|
274
|
-
orderId: orderIdRef.current,
|
|
275
|
-
type: type,
|
|
276
|
-
date: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
277
|
-
})
|
|
278
|
-
}, {
|
|
279
|
-
key: 'params',
|
|
280
|
-
value: JSON.stringify(params)
|
|
281
|
-
}];
|
|
282
|
-
if (type === "Error") {
|
|
283
|
-
content.push({
|
|
284
|
-
key: 'error',
|
|
285
|
-
value: JSON.stringify(res)
|
|
286
|
-
});
|
|
287
|
-
} else {
|
|
288
|
-
content.push({
|
|
289
|
-
key: 'response',
|
|
290
|
-
value: JSON.stringify(res)
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
sendWarningLog({
|
|
294
|
-
title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u7ED3\u679C\u8F6E\u8BE2"),
|
|
295
|
-
content: content
|
|
296
|
-
});
|
|
297
239
|
};
|
|
298
240
|
var run = function run() {
|
|
299
241
|
// 重置状态
|
|
@@ -302,8 +244,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
302
244
|
// 设置全局超时定时器
|
|
303
245
|
globalTimeoutIdRef.current = setTimeout(function () {
|
|
304
246
|
var _failRef$current3;
|
|
305
|
-
|
|
306
|
-
_log("GlobalTimeout");
|
|
247
|
+
payLog.log('Linkly轮询:全局超时');
|
|
307
248
|
setTimeout(reset, 0);
|
|
308
249
|
// 交易超时,需要手动标记交易状态
|
|
309
250
|
(_failRef$current3 = failRef.current) === null || _failRef$current3 === void 0 || _failRef$current3.call(failRef, {
|
|
@@ -312,9 +253,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
|
|
|
312
253
|
}, GlobalTimeout);
|
|
313
254
|
startTimeRef.current = Date.now();
|
|
314
255
|
isQueryFinishedRef.current = false;
|
|
315
|
-
|
|
316
|
-
console.log('开始查询linkly结果---->>>>>>>');
|
|
317
|
-
_log("Start");
|
|
256
|
+
payLog.log('Linkly轮询:开始查询');
|
|
318
257
|
return _resultQuery();
|
|
319
258
|
};
|
|
320
259
|
return {
|
|
@@ -9,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
import React, { useEffect, useRef } from 'react';
|
|
11
11
|
import { Button } from 'antd';
|
|
12
|
-
import { locales
|
|
12
|
+
import { locales } from '@pisell/utils';
|
|
13
13
|
import { useContextData, useDispatch, updateCustom, updateState, updateNextStep } from "../store";
|
|
14
14
|
import { useFail, useStoreRef } from "../hooks";
|
|
15
15
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
@@ -19,6 +19,7 @@ import { StatusEnum } from "../const";
|
|
|
19
19
|
import { useLinklyCancel, useLinklyPayOrRefund, useTimeResultQuery, useLinklySignature } from "./hooks";
|
|
20
20
|
import { LinklyActionStatus } from "./const";
|
|
21
21
|
import { getPayParams } from "../helper";
|
|
22
|
+
import payLog from "../utils/payLog";
|
|
22
23
|
var Linkly = function Linkly(_ref) {
|
|
23
24
|
var api = _ref.api,
|
|
24
25
|
onChange = _ref.onChange;
|
|
@@ -52,6 +53,7 @@ var Linkly = function Linkly(_ref) {
|
|
|
52
53
|
return !(unloadRef.current || !netRef.current);
|
|
53
54
|
};
|
|
54
55
|
var handleLinklySuccess = function handleLinklySuccess(res) {
|
|
56
|
+
payLog.log('Linkly:最终支付成功');
|
|
55
57
|
var resData = (res === null || res === void 0 ? void 0 : res.data) || {};
|
|
56
58
|
var receipt = Array.isArray(resData === null || resData === void 0 ? void 0 : resData.receipt) ? resData.receipt : [resData.receipt];
|
|
57
59
|
receipt = receipt.filter(function (item) {
|
|
@@ -105,6 +107,7 @@ var Linkly = function Linkly(_ref) {
|
|
|
105
107
|
}, [fail]);
|
|
106
108
|
useEffect(function () {
|
|
107
109
|
var _utils$isTerminal, _utils$interaction;
|
|
110
|
+
console.log('statusRef.current11111', statusRef.current);
|
|
108
111
|
if (statusRef.current === StatusEnum.Success || statusRef.current === StatusEnum.Fail) {
|
|
109
112
|
return;
|
|
110
113
|
}
|
|
@@ -139,14 +142,8 @@ var Linkly = function Linkly(_ref) {
|
|
|
139
142
|
if (activeStatus !== 'unActive') {
|
|
140
143
|
payOrRefund(resultQuery, handleLinklySuccess);
|
|
141
144
|
} else {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
content: [{
|
|
145
|
-
key: 'response',
|
|
146
|
-
value: JSON.stringify({
|
|
147
|
-
activeStatus: activeStatus
|
|
148
|
-
})
|
|
149
|
-
}]
|
|
145
|
+
payLog.log('Linkly:页面非活跃状态,阻断支付', {
|
|
146
|
+
activeStatus: activeStatus
|
|
150
147
|
});
|
|
151
148
|
}
|
|
152
149
|
_context.next = 11;
|
|
@@ -154,12 +151,8 @@ var Linkly = function Linkly(_ref) {
|
|
|
154
151
|
case 7:
|
|
155
152
|
_context.prev = 7;
|
|
156
153
|
_context.t0 = _context["catch"](0);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
content: [{
|
|
160
|
-
key: 'error',
|
|
161
|
-
value: JSON.stringify(_context.t0)
|
|
162
|
-
}]
|
|
154
|
+
payLog.log('Linkly:获取页面活跃状态失败', {
|
|
155
|
+
error: _context.t0
|
|
163
156
|
});
|
|
164
157
|
// 如果获取活跃状态失败,则进行支付,防止流程卡死
|
|
165
158
|
payOrRefund(resultQuery, handleLinklySuccess);
|
|
@@ -193,22 +186,17 @@ var Linkly = function Linkly(_ref) {
|
|
|
193
186
|
* 取消支付
|
|
194
187
|
*/
|
|
195
188
|
var onCancel = function onCancel() {
|
|
189
|
+
payLog.log('Linkly:点击取消支付');
|
|
196
190
|
stopResultQuery();
|
|
197
191
|
linklyCancel(resultQuery);
|
|
198
192
|
};
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 拒绝签名
|
|
202
|
-
*/
|
|
203
193
|
var onDecline = function onDecline() {
|
|
194
|
+
payLog.log('Linkly:签名-点击拒绝');
|
|
204
195
|
stopResultQuery();
|
|
205
196
|
linklySignature(2, resultQuery);
|
|
206
197
|
};
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* 接受签名
|
|
210
|
-
*/
|
|
211
198
|
var onAccept = function onAccept() {
|
|
199
|
+
payLog.log('Linkly:签名-点击接受');
|
|
212
200
|
stopResultQuery();
|
|
213
201
|
linklySignature(3, resultQuery);
|
|
214
202
|
};
|
|
@@ -119,6 +119,9 @@ declare const _default: {
|
|
|
119
119
|
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
120
120
|
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
121
121
|
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
122
|
+
'page.eftpos-pay.text.mx51.result.loading': string;
|
|
123
|
+
'page.eftpos-pay.text.manual.success.toast': string;
|
|
124
|
+
'page.eftpos-pay.text.manual.fail.toast': string;
|
|
122
125
|
};
|
|
123
126
|
'zh-CN': {
|
|
124
127
|
'page.eftpos-pay.text.loading': (mode: string) => string;
|
|
@@ -240,6 +243,9 @@ declare const _default: {
|
|
|
240
243
|
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
241
244
|
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
242
245
|
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
246
|
+
'page.eftpos-pay.text.mx51.result.loading': string;
|
|
247
|
+
'page.eftpos-pay.text.manual.success.toast': string;
|
|
248
|
+
'page.eftpos-pay.text.manual.fail.toast': string;
|
|
243
249
|
};
|
|
244
250
|
'zh-HK': {
|
|
245
251
|
'page.eftpos-pay.text.loading': (mode: string) => string;
|
|
@@ -361,6 +367,9 @@ declare const _default: {
|
|
|
361
367
|
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
362
368
|
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
363
369
|
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
370
|
+
'page.eftpos-pay.text.mx51.result.loading': string;
|
|
371
|
+
'page.eftpos-pay.text.manual.success.toast': string;
|
|
372
|
+
'page.eftpos-pay.text.manual.fail.toast': string;
|
|
364
373
|
};
|
|
365
374
|
ja: {
|
|
366
375
|
'page.eftpos-pay.text.loading': (mode: string) => string;
|
|
@@ -482,6 +491,9 @@ declare const _default: {
|
|
|
482
491
|
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
483
492
|
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
484
493
|
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
494
|
+
'page.eftpos-pay.text.mx51.result.loading': string;
|
|
495
|
+
'page.eftpos-pay.text.manual.success.toast': string;
|
|
496
|
+
'page.eftpos-pay.text.manual.fail.toast': string;
|
|
485
497
|
};
|
|
486
498
|
pt: {
|
|
487
499
|
'page.eftpos-pay.text.loading': (mode: string) => string;
|
|
@@ -603,6 +615,9 @@ declare const _default: {
|
|
|
603
615
|
'page.eftpos-pay.text.huifu.scan.input-tip': string;
|
|
604
616
|
'page.eftpos-pay.text.huifu.scan.cancel': string;
|
|
605
617
|
'page.eftpos-pay.text.huifu.scan.confirm': string;
|
|
618
|
+
'page.eftpos-pay.text.mx51.result.loading': string;
|
|
619
|
+
'page.eftpos-pay.text.manual.success.toast': string;
|
|
620
|
+
'page.eftpos-pay.text.manual.fail.toast': string;
|
|
606
621
|
};
|
|
607
622
|
};
|
|
608
623
|
export default _default;
|
|
@@ -162,7 +162,10 @@ export default {
|
|
|
162
162
|
'page.eftpos-pay.text.huifu.scan.input-placeholder': 'Enter payment code',
|
|
163
163
|
'page.eftpos-pay.text.huifu.scan.input-tip': 'Tip: The payment code is 18 digits',
|
|
164
164
|
'page.eftpos-pay.text.huifu.scan.cancel': 'Cancel',
|
|
165
|
-
'page.eftpos-pay.text.huifu.scan.confirm': 'Confirm Payment'
|
|
165
|
+
'page.eftpos-pay.text.huifu.scan.confirm': 'Confirm Payment',
|
|
166
|
+
'page.eftpos-pay.text.mx51.result.loading': 'Checking transaction result…',
|
|
167
|
+
'page.eftpos-pay.text.manual.success.toast': 'Payment marked as successful',
|
|
168
|
+
'page.eftpos-pay.text.manual.fail.toast': 'Payment marked as failed. Please retry payment.'
|
|
166
169
|
},
|
|
167
170
|
'zh-CN': {
|
|
168
171
|
'page.eftpos-pay.text.loading': function pageEftposPayTextLoading(mode) {
|
|
@@ -473,7 +476,10 @@ export default {
|
|
|
473
476
|
'page.eftpos-pay.text.huifu.scan.input-placeholder': '请输入',
|
|
474
477
|
'page.eftpos-pay.text.huifu.scan.input-tip': '提示:付款码为18位数字',
|
|
475
478
|
'page.eftpos-pay.text.huifu.scan.cancel': '取消',
|
|
476
|
-
'page.eftpos-pay.text.huifu.scan.confirm': '确认支付'
|
|
479
|
+
'page.eftpos-pay.text.huifu.scan.confirm': '确认支付',
|
|
480
|
+
'page.eftpos-pay.text.mx51.result.loading': '正在获取交易结果…',
|
|
481
|
+
'page.eftpos-pay.text.manual.success.toast': '支付标记为成功',
|
|
482
|
+
'page.eftpos-pay.text.manual.fail.toast': '支付标记为失败,请重试支付。'
|
|
477
483
|
},
|
|
478
484
|
'zh-HK': {
|
|
479
485
|
'page.eftpos-pay.text.loading': function pageEftposPayTextLoading(mode) {
|
|
@@ -482,12 +488,12 @@ export default {
|
|
|
482
488
|
'page.eftpos-pay.text.wait': function pageEftposPayTextWait(val, mode) {
|
|
483
489
|
return mode === 'pay' || mode === 'fullPay' ? "\u7B49\u5F85EFTPOS\u63A5\u53D7".concat(val, "\u7684\u4ED8\u6B3E") : "\u8ACB\u6C42EFTPOS\u63A5\u53D7".concat(val, "\u7684\u9000\u6B3E\u3002");
|
|
484
490
|
},
|
|
485
|
-
'page.eftpos-pay.text.surcharge': '
|
|
486
|
-
'page.eftpos-pay.text.card': '
|
|
487
|
-
'page.eftpos-pay.text.account': '
|
|
488
|
-
'page.eftpos-pay.text.pin': '
|
|
489
|
-
'page.eftpos-pay.text.receipt': '
|
|
490
|
-
'page.eftpos-pay.text.receipt.again.title': '
|
|
491
|
+
'page.eftpos-pay.text.surcharge': '等待客戶確認支付手續費',
|
|
492
|
+
'page.eftpos-pay.text.card': '等待客戶出示卡片',
|
|
493
|
+
'page.eftpos-pay.text.account': '等待客戶選擇賬戶',
|
|
494
|
+
'page.eftpos-pay.text.pin': '等待客戶輸入密碼或簽名',
|
|
495
|
+
'page.eftpos-pay.text.receipt': '請客戶在收據上簽名',
|
|
496
|
+
'page.eftpos-pay.text.receipt.again.title': '確認客戶簽名',
|
|
491
497
|
'page.eftpos-pay.text.receipt.again.text': '如果簽名正確,請點擊“接受”。如果簽名錯誤,請點擊“拒絕”。',
|
|
492
498
|
'page.eftpos-pay.text.signature.title': '確認拒絕簽名?',
|
|
493
499
|
'page.eftpos-pay.text.signature.text': function pageEftposPayTextSignatureText(mode) {
|
|
@@ -504,7 +510,7 @@ export default {
|
|
|
504
510
|
return mode === 'pay' || mode === 'fullPay' ? '請您根據刷卡機上的支付狀態,手動標記支付結果,以確保交易的準確性。' : '請根據顯示在刷卡機上的退款狀態,手動標記退款結果,以確保交易準確性。';
|
|
505
511
|
},
|
|
506
512
|
'page.eftpos-pay.text.request.unknown.title': function pageEftposPayTextRequestUnknownTitle(mode) {
|
|
507
|
-
return "\u62B1\u6B49\uFF0C ".concat(mode === 'pay' || mode === 'fullPay' ? '支付' : '退款', " \
|
|
513
|
+
return "\u62B1\u6B49\uFF0C ".concat(mode === 'pay' || mode === 'fullPay' ? '支付' : '退款', " \u904E\u7A0B\u4E2D\u51FA\u73FE\u4E86\u672A\u77E5\u932F\u8AA4");
|
|
508
514
|
},
|
|
509
515
|
'page.eftpos-pay.text.request.unknown.text': function pageEftposPayTextRequestUnknownText(mode) {
|
|
510
516
|
return mode === 'pay' || mode === 'fullPay' ? '請您根據刷卡機上的支付狀態,手動標記支付結果,以確保交易的準確性。' : "\u8ACB\u60A8\u6839\u64DA\u5237\u5361\u6A5F\u4E0A\u7684\u9000\u6B3E\u72C0\u614B\uFF0C\u624B\u52D5\u6A19\u8A18\u9000\u6B3E\u7D50\u679C\uFF0C\u4EE5\u78BA\u4FDD\u4EA4\u6613\u7684\u6E96\u78BA\u6027\u3002";
|
|
@@ -611,7 +617,7 @@ export default {
|
|
|
611
617
|
return mode === 'pay' || mode === 'fullPay' ? '如果您已確認此交易的付款狀態,請點擊手動標記' : '如果您已確認此訂單的退款狀態,請點擊手動標記。';
|
|
612
618
|
},
|
|
613
619
|
'page.eftpos-pay.text.transaction.eftpos.fail.other': '刷卡機支付出現問題,請打印收據後聯繫店員處理。',
|
|
614
|
-
'page.eftpos-pay.text.application': '
|
|
620
|
+
'page.eftpos-pay.text.application': '等待客戶選擇應用',
|
|
615
621
|
'page.eftpos-pay.text.approved': '已接受',
|
|
616
622
|
'page.eftpos-pay.text.device.no.title': '您還沒有添加任何設備。請添加設備後使用',
|
|
617
623
|
'page.eftpos-pay.text.device.no.add': '添加設備方式:',
|
|
@@ -762,10 +768,10 @@ export default {
|
|
|
762
768
|
return ['交易繁忙,刷卡機正在處理另一筆交易。', '請在刷卡機上處理完成上一筆交易後再次發起支付。'];
|
|
763
769
|
}
|
|
764
770
|
if (key === 'DECLINED. Print customer copy?') {
|
|
765
|
-
return '
|
|
771
|
+
return '已拒絕。是否列印客戶副本?';
|
|
766
772
|
}
|
|
767
773
|
if (key === 'APPROVED. Print customer copy?' || key === 'Approved. Print customer copy?') {
|
|
768
|
-
return '
|
|
774
|
+
return '已批准。是否列印客戶副本?';
|
|
769
775
|
}
|
|
770
776
|
if (key === 'Please answer this question with one of the following option/s') {
|
|
771
777
|
return '請使用以下選項之一回答此問題';
|
|
@@ -784,7 +790,10 @@ export default {
|
|
|
784
790
|
'page.eftpos-pay.text.huifu.scan.input-placeholder': '請輸入',
|
|
785
791
|
'page.eftpos-pay.text.huifu.scan.input-tip': '提示:付款碼為18位數字',
|
|
786
792
|
'page.eftpos-pay.text.huifu.scan.cancel': '取消',
|
|
787
|
-
'page.eftpos-pay.text.huifu.scan.confirm': '確認支付'
|
|
793
|
+
'page.eftpos-pay.text.huifu.scan.confirm': '確認支付',
|
|
794
|
+
'page.eftpos-pay.text.mx51.result.loading': '正在獲取交易結果…',
|
|
795
|
+
'page.eftpos-pay.text.manual.success.toast': '支付標記為成功',
|
|
796
|
+
'page.eftpos-pay.text.manual.fail.toast': '支付標記為失敗,請重試支付。'
|
|
788
797
|
},
|
|
789
798
|
ja: {
|
|
790
799
|
'page.eftpos-pay.text.loading': function pageEftposPayTextLoading(mode) {
|
|
@@ -947,7 +956,10 @@ export default {
|
|
|
947
956
|
'page.eftpos-pay.text.huifu.scan.input-placeholder': '支払いコードを入力',
|
|
948
957
|
'page.eftpos-pay.text.huifu.scan.input-tip': 'ヒント:支払いコードは18桁の数字です',
|
|
949
958
|
'page.eftpos-pay.text.huifu.scan.cancel': 'キャンセル',
|
|
950
|
-
'page.eftpos-pay.text.huifu.scan.confirm': '支払いを確認'
|
|
959
|
+
'page.eftpos-pay.text.huifu.scan.confirm': '支払いを確認',
|
|
960
|
+
'page.eftpos-pay.text.mx51.result.loading': '取引結果を確認中…',
|
|
961
|
+
'page.eftpos-pay.text.manual.success.toast': '支払いを成功としてマークしました',
|
|
962
|
+
'page.eftpos-pay.text.manual.fail.toast': '支払いを失敗としてマークしました。再度お支払いください。'
|
|
951
963
|
},
|
|
952
964
|
pt: {
|
|
953
965
|
'page.eftpos-pay.text.loading': function pageEftposPayTextLoading(mode) {
|
|
@@ -1110,6 +1122,9 @@ export default {
|
|
|
1110
1122
|
'page.eftpos-pay.text.huifu.scan.input-placeholder': 'Digite o código de pagamento',
|
|
1111
1123
|
'page.eftpos-pay.text.huifu.scan.input-tip': 'Dica: O código de pagamento tem 18 dígitos',
|
|
1112
1124
|
'page.eftpos-pay.text.huifu.scan.cancel': 'Cancelar',
|
|
1113
|
-
'page.eftpos-pay.text.huifu.scan.confirm': 'Confirmar Pagamento'
|
|
1125
|
+
'page.eftpos-pay.text.huifu.scan.confirm': 'Confirmar Pagamento',
|
|
1126
|
+
'page.eftpos-pay.text.mx51.result.loading': 'Verificando resultado da transação…',
|
|
1127
|
+
'page.eftpos-pay.text.manual.success.toast': 'Pagamento marcado como bem-sucedido',
|
|
1128
|
+
'page.eftpos-pay.text.manual.fail.toast': 'Pagamento marcado como falhou. Por favor, tente pagar novamente.'
|
|
1114
1129
|
}
|
|
1115
1130
|
};
|
|
@@ -5,4 +5,5 @@ export { default as Windcave } from './windcave/windcave';
|
|
|
5
5
|
export { default as Tyro } from './tyro';
|
|
6
6
|
export { default as Linkly } from './linkly';
|
|
7
7
|
export { default as Huifu } from './huifu';
|
|
8
|
+
export { default as Mx51 } from './mx51';
|
|
8
9
|
export declare const getInitState: (type: string, params?: any) => State;
|
|
@@ -4,12 +4,14 @@ import getTyroInitState from "./tyro/const";
|
|
|
4
4
|
import getWindcaveInitState from "./windcave/const";
|
|
5
5
|
import getLinklyInitState from "./linkly/const";
|
|
6
6
|
import getHuifuInitState from "./huifu/const";
|
|
7
|
+
import getMx51InitState from "./mx51/const";
|
|
7
8
|
export { getAmonunt } from "./helper";
|
|
8
9
|
export { default as Payo } from "./payo";
|
|
9
10
|
export { default as Windcave } from "./windcave/windcave";
|
|
10
11
|
export { default as Tyro } from "./tyro";
|
|
11
12
|
export { default as Linkly } from "./linkly";
|
|
12
13
|
export { default as Huifu } from "./huifu";
|
|
14
|
+
export { default as Mx51 } from "./mx51";
|
|
13
15
|
export var getInitState = function getInitState(type, params) {
|
|
14
16
|
console.log('type = ', type);
|
|
15
17
|
switch (type) {
|
|
@@ -23,6 +25,8 @@ export var getInitState = function getInitState(type, params) {
|
|
|
23
25
|
return getLinklyInitState(params);
|
|
24
26
|
case EftposEnum.Huifu:
|
|
25
27
|
return getHuifuInitState(params);
|
|
28
|
+
case EftposEnum.MX51:
|
|
29
|
+
return getMx51InitState(params);
|
|
26
30
|
default:
|
|
27
31
|
throw new Error('未知的厂商类型');
|
|
28
32
|
}
|