@pisell/private-materials 6.5.10 → 6.5.12
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 +2 -2
- package/build/lowcode/preview.js +148 -164
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Services/index.js +36 -18
- package/es/components/appointmentBooking/hooks.js +6 -0
- package/es/components/booking/components/footer/index.js +24 -5
- package/es/components/booking/editBookingModal/index.js +8 -2
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/locales.d.ts +6 -0
- package/es/components/booking/locales.js +12 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +145 -101
- package/es/components/checkout/components/AmountSummary/index.js +6 -4
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +14 -10
- package/es/components/checkout/components/PaymentDetailModal/index.js +76 -27
- package/es/components/checkout/components/PaymentDetailModal/index.less +23 -2
- package/es/components/checkout/components/PaymentOptionsModule/index.js +4 -1
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +1 -0
- 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/linkly/hooks/normal.js +3 -3
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +60 -17
- package/es/components/eftposPay/payo/config.js +10 -10
- package/es/components/eftposPay/serve.js +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
- package/es/components/pay/toC/utils.js +1 -1
- package/es/components/pinModal/hooks.d.ts +7 -0
- package/es/components/pinModal/hooks.js +65 -0
- package/es/components/pinModal/index.d.ts +4 -0
- package/es/components/pinModal/index.js +98 -0
- package/es/components/pinModal/index.less +44 -0
- package/es/components/pinModal/locales.d.ts +27 -0
- package/es/components/pinModal/locales.js +26 -0
- package/es/components/pinModal/serve.d.ts +6 -0
- package/es/components/pinModal/serve.js +11 -0
- package/es/components/pinModal/types.d.ts +0 -0
- package/es/components/pinModal/types.js +0 -0
- package/es/components/pinVerifyModal/hooks.d.ts +7 -0
- package/es/components/pinVerifyModal/hooks.js +80 -0
- package/es/components/pinVerifyModal/index.d.ts +5 -0
- package/es/components/pinVerifyModal/index.js +218 -0
- package/es/components/pinVerifyModal/index.less +92 -0
- package/es/components/pinVerifyModal/locales.d.ts +24 -0
- package/es/components/pinVerifyModal/locales.js +23 -0
- package/es/components/pinVerifyModal/types.d.ts +33 -0
- package/es/components/pinVerifyModal/types.js +1 -0
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +7 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +56 -10
- package/es/components/ticketBooking/components/timeBar/index.js +2 -1
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/walletList/index.js +20 -2
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Services/index.js +13 -3
- package/lib/components/appointmentBooking/hooks.js +6 -0
- package/lib/components/booking/components/footer/index.js +21 -3
- package/lib/components/booking/editBookingModal/index.js +6 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/locales.d.ts +6 -0
- package/lib/components/booking/locales.js +6 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +37 -9
- package/lib/components/checkout/components/AmountSummary/index.js +4 -4
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +6 -3
- package/lib/components/checkout/components/PaymentDetailModal/index.js +47 -14
- package/lib/components/checkout/components/PaymentDetailModal/index.less +23 -2
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +3 -1
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +1 -0
- 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/linkly/hooks/normal.js +3 -3
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +59 -15
- package/lib/components/eftposPay/payo/config.js +9 -9
- package/lib/components/eftposPay/serve.js +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
- package/lib/components/pay/toC/utils.js +1 -1
- package/lib/components/pinModal/hooks.d.ts +7 -0
- package/lib/components/pinModal/hooks.js +85 -0
- package/lib/components/pinModal/index.d.ts +4 -0
- package/lib/components/pinModal/index.js +88 -0
- package/lib/components/pinModal/index.less +44 -0
- package/lib/components/pinModal/locales.d.ts +27 -0
- package/lib/components/pinModal/locales.js +50 -0
- package/lib/components/pinModal/serve.d.ts +6 -0
- package/lib/components/pinModal/serve.js +37 -0
- package/lib/components/pinModal/types.d.ts +0 -0
- package/lib/components/pinModal/types.js +0 -0
- package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
- package/lib/components/pinVerifyModal/hooks.js +93 -0
- package/lib/components/pinVerifyModal/index.d.ts +5 -0
- package/lib/components/pinVerifyModal/index.js +230 -0
- package/lib/components/pinVerifyModal/index.less +92 -0
- package/lib/components/pinVerifyModal/locales.d.ts +24 -0
- package/lib/components/pinVerifyModal/locales.js +47 -0
- package/lib/components/pinVerifyModal/types.d.ts +33 -0
- package/lib/components/pinVerifyModal/types.js +17 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +7 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +52 -5
- package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/walletList/index.js +19 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/pin-modal/meta.ts +37 -0
- package/lowcode/pin-verify-modal/meta.ts +80 -0
- package/package.json +1 -1
@@ -52,7 +52,9 @@ function CashPaymentModule({
|
|
52
52
|
// 禁用状态
|
53
53
|
roundingFunction,
|
54
54
|
balanceDueAmount = "0",
|
55
|
-
//
|
55
|
+
// 当前阶段剩余支付金额(定金或普通支付)
|
56
|
+
balanceDueTotalAmount = "0",
|
57
|
+
// 完整订单剩余待付金额
|
56
58
|
syncingLock = false
|
57
59
|
// 是否锁定
|
58
60
|
}) {
|
@@ -71,7 +73,7 @@ function CashPaymentModule({
|
|
71
73
|
};
|
72
74
|
(0, import_react.useEffect)(() => {
|
73
75
|
handleKeyboardConfirm(customAmount || "");
|
74
|
-
}, [customAmount, balanceDueAmount]);
|
76
|
+
}, [customAmount, balanceDueAmount, orderInfo == null ? void 0 : orderInfo.isDeposit]);
|
75
77
|
const isAmountButtonsDisabled = disabled || Number(customAmount || 0) === 0;
|
76
78
|
const isInputDisabled = disabled || Number(customAmount || 0) === 0;
|
77
79
|
const handleAmountClick = (clickedAmount) => {
|
@@ -126,7 +128,8 @@ function CashPaymentModule({
|
|
126
128
|
} else {
|
127
129
|
const cleanValue = finalValue.replace(/[$\s]/g, "");
|
128
130
|
const numValue = parseFloat(cleanValue);
|
129
|
-
|
131
|
+
debugger;
|
132
|
+
const balanceDue = parseFloat((orderInfo == null ? void 0 : orderInfo.isDeposit) ? balanceDueTotalAmount || "0" : balanceDueAmount);
|
130
133
|
const shouldApplyRounding = Math.abs(numValue - balanceDue) < 0.01;
|
131
134
|
let finalAmount = numValue;
|
132
135
|
let roundingDiff = 0;
|
@@ -88,10 +88,11 @@ function PaymentDetailModal({
|
|
88
88
|
return (item.code === "cash" || item.type === "custom") && !item.isSynced;
|
89
89
|
};
|
90
90
|
const getTotalPaidAmount = () => {
|
91
|
-
return paymentItems.filter((item) => !item.voucher_id || item.isSynced).reduce((total, item) =>
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
return paymentItems.filter((item) => !item.voucher_id || item.isSynced).reduce((total, item) => {
|
92
|
+
const amount = new import_decimal.default(Math.abs(item.amount));
|
93
|
+
const roundingAmount = new import_decimal.default(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
|
94
|
+
return new import_decimal.default(total).plus(amount).plus(roundingAmount).toNumber();
|
95
|
+
}, 0);
|
95
96
|
};
|
96
97
|
const getBalanceDueAmount = () => {
|
97
98
|
return new import_decimal.default(orderInfo.totalAmount || 0).sub(new import_decimal.default(getTotalPaidAmount())).toNumber().toFixed(2);
|
@@ -103,16 +104,54 @@ function PaymentDetailModal({
|
|
103
104
|
}
|
104
105
|
};
|
105
106
|
const renderPaymentItems = () => {
|
106
|
-
const
|
107
|
-
|
107
|
+
const depositPayments = paymentItems.filter((item) => item.order_payment_type === "deposit" && item.isSynced);
|
108
|
+
const regularPayments = paymentItems.filter((item) => item.isSynced && item.order_payment_type !== "deposit");
|
109
|
+
if (!paymentItems || paymentItems.length === 0 || regularPayments.length === 0 && depositPayments.length === 0) {
|
108
110
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("section-content") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("no-payment-text") }, getText("no.payments.recorded") || "No payments recorded"));
|
109
111
|
}
|
110
|
-
|
112
|
+
const depositPaymentSummary = depositPayments.reduce((acc, item) => {
|
113
|
+
return new import_decimal.default(acc).plus(new import_decimal.default(item.amount)).plus(new import_decimal.default(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0)).toNumber();
|
114
|
+
}, 0);
|
115
|
+
const regularPaymentSummary = regularPayments.reduce((acc, item) => {
|
116
|
+
return new import_decimal.default(acc).plus(new import_decimal.default(item.amount)).plus(new import_decimal.default(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0)).toNumber();
|
117
|
+
}, 0);
|
118
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("section-content") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-record-container") }, depositPayments.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-header") }, /* @__PURE__ */ import_react.default.createElement("div", null, getText("pisell2.subtotal.deposit") || "Deposit"), /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_utils.formatAmountWithOptions)(depositPaymentSummary, amountSymbol, {
|
119
|
+
precision: 2,
|
120
|
+
hideDecimalForWholeNumbers: false,
|
121
|
+
useThousandsSeparator: true,
|
122
|
+
showCurrencySymbol: true
|
123
|
+
}))), depositPayments.map((item) => /* @__PURE__ */ import_react.default.createElement("div", { key: item.uuid, className: (0, import_classnames.default)("payment-item") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-bullet") }), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-content") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-text") }, item.name, " - ", (/* @__PURE__ */ new Date()).toLocaleDateString(), " ", getText("pisell2.checkout.payment-detail.by") || "by", " ", getCustomerInfo().nickname), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-actions") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-amount") }, "-", (0, import_utils.formatAmountWithOptions)(
|
124
|
+
new import_decimal.default(Math.abs(item.amount)).plus(new import_decimal.default(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0)).toNumber(),
|
125
|
+
amountSymbol,
|
126
|
+
{
|
127
|
+
precision: 2,
|
128
|
+
hideDecimalForWholeNumbers: false,
|
129
|
+
useThousandsSeparator: true,
|
130
|
+
showCurrencySymbol: true
|
131
|
+
}
|
132
|
+
)), shouldShowVoidButton(item) && /* @__PURE__ */ import_react.default.createElement(
|
133
|
+
"button",
|
134
|
+
{
|
135
|
+
className: (0, import_classnames.default)("void-button"),
|
136
|
+
onClick: () => handleVoidPayment(item),
|
137
|
+
type: "button"
|
138
|
+
},
|
139
|
+
getText("void") || "Void"
|
140
|
+
))))), regularPayments.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-header") }, /* @__PURE__ */ import_react.default.createElement("div", null, getText("payment.text") || "Payment"), /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_utils.formatAmountWithOptions)(regularPaymentSummary, amountSymbol, {
|
111
141
|
precision: 2,
|
112
142
|
hideDecimalForWholeNumbers: false,
|
113
143
|
useThousandsSeparator: true,
|
114
144
|
showCurrencySymbol: true
|
115
|
-
})),
|
145
|
+
}))), regularPayments.map((item) => /* @__PURE__ */ import_react.default.createElement("div", { key: item.uuid, className: (0, import_classnames.default)("payment-item") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-bullet") }), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-content") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-text") }, item.name, " - ", (/* @__PURE__ */ new Date()).toLocaleDateString(), " ", getText("pisell2.checkout.payment-detail.by") || "by", " ", getCustomerInfo().nickname), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-actions") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-item-amount") }, "-", (0, import_utils.formatAmountWithOptions)(
|
146
|
+
new import_decimal.default(Math.abs(item.amount)).plus(new import_decimal.default(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0)).toNumber(),
|
147
|
+
amountSymbol,
|
148
|
+
{
|
149
|
+
precision: 2,
|
150
|
+
hideDecimalForWholeNumbers: false,
|
151
|
+
useThousandsSeparator: true,
|
152
|
+
showCurrencySymbol: true
|
153
|
+
}
|
154
|
+
)), shouldShowVoidButton(item) && /* @__PURE__ */ import_react.default.createElement(
|
116
155
|
"button",
|
117
156
|
{
|
118
157
|
className: (0, import_classnames.default)("void-button"),
|
@@ -125,12 +164,6 @@ function PaymentDetailModal({
|
|
125
164
|
const renderVoucherItems = () => {
|
126
165
|
var _a;
|
127
166
|
const items = [];
|
128
|
-
const voucherPayments = paymentItems.filter((item) => item.voucher_id && item.isSynced);
|
129
|
-
voucherPayments.forEach((item) => {
|
130
|
-
items.push(
|
131
|
-
/* @__PURE__ */ import_react.default.createElement("div", { key: `payment-${item.uuid}`, className: (0, import_classnames.default)("balance-item-row") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("balance-item-text") }, item.name, " - ", item.voucher_id), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("balance-item-amount") }, "-$", Math.abs(item.amount).toFixed(2)))
|
132
|
-
);
|
133
|
-
});
|
134
167
|
if ((_a = walletPassData == null ? void 0 : walletPassData.selectedWallet) == null ? void 0 : _a.length) {
|
135
168
|
walletPassData.selectedWallet.forEach((wallet) => {
|
136
169
|
items.push(
|
@@ -263,7 +263,7 @@
|
|
263
263
|
flex-direction: column;
|
264
264
|
justify-content: flex-start;
|
265
265
|
align-items: flex-start;
|
266
|
-
gap:
|
266
|
+
gap: 8px;
|
267
267
|
}
|
268
268
|
|
269
269
|
.payment-record-header {
|
@@ -299,12 +299,33 @@
|
|
299
299
|
line-height: 20px;
|
300
300
|
word-wrap: break-word;
|
301
301
|
}
|
302
|
+
.payment-item-header {
|
303
|
+
width: 100%;
|
304
|
+
color: black;
|
305
|
+
font-size: 14px;
|
306
|
+
font-weight: 500;
|
307
|
+
line-height: 20px;
|
308
|
+
word-wrap: break-word;
|
309
|
+
display: flex;
|
310
|
+
justify-content: space-between;
|
311
|
+
}
|
302
312
|
|
303
313
|
.payment-item {
|
304
314
|
align-self: stretch;
|
305
315
|
display: flex;
|
306
|
-
justify-content:
|
316
|
+
justify-content: flex-start;
|
307
317
|
align-items: center;
|
318
|
+
gap: 8px;
|
319
|
+
margin-left: 10px;
|
320
|
+
margin-right: 64px;
|
321
|
+
}
|
322
|
+
|
323
|
+
.payment-item-bullet {
|
324
|
+
width: 6px;
|
325
|
+
height: 6px;
|
326
|
+
background-color: #475467;
|
327
|
+
border-radius: 50%;
|
328
|
+
flex-shrink: 0;
|
308
329
|
}
|
309
330
|
|
310
331
|
.payment-item-content {
|
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
|
|
17
17
|
cardData: any;
|
18
18
|
handleSelectWallet: (value: number[]) => void;
|
19
19
|
selectedWalletIds: any[];
|
20
|
-
expiredWalletIds: any
|
20
|
+
expiredWalletIds: any;
|
21
21
|
expiredWalletData: any;
|
22
22
|
disabledWalletData: any[];
|
23
23
|
clearAllSelectedWallet: () => void;
|
@@ -272,6 +272,7 @@ var useWalletPass = (props) => {
|
|
272
272
|
} else {
|
273
273
|
setWalletSelect([]);
|
274
274
|
notSetWalletSelectRef.current = false;
|
275
|
+
onSelectChange == null ? void 0 : onSelectChange([]);
|
275
276
|
}
|
276
277
|
const originalDiscountList = shopDiscount.getDiscountList();
|
277
278
|
const sortedDiscountList = sortDiscountListWithInitialOrder(originalDiscountList);
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
8
8
|
*/
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
10
10
|
className?: string | undefined;
|
11
|
-
onChange?: ((status: "
|
11
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
12
12
|
[keys: string]: unknown;
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
14
14
|
onClose: () => void;
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
|
12
12
|
api: PayProps['api'];
|
13
13
|
className?: string | undefined;
|
14
|
-
onChange?: ((status: "
|
14
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
15
15
|
[keys: string]: unknown;
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
17
17
|
onClose: () => void;
|
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
18
|
+
readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
@@ -63,18 +63,18 @@ var useLinklyPayOrRefund = (handleCheck) => {
|
|
63
63
|
content: [{ key: "response", value: JSON.stringify(res) }]
|
64
64
|
});
|
65
65
|
const status = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.status;
|
66
|
-
if (status
|
66
|
+
if (status == 0) {
|
67
67
|
numRef.current = (_b = res == null ? void 0 : res.data) == null ? void 0 : _b.session_id;
|
68
68
|
dispatch((0, import_store.updateState)({ number: numRef.current }));
|
69
69
|
dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.Cancel }));
|
70
70
|
setTimeout(() => {
|
71
71
|
var _a2;
|
72
72
|
(_a2 = resultQueryRef.current) == null ? void 0 : _a2.call(resultQueryRef);
|
73
|
-
});
|
73
|
+
}, 300);
|
74
74
|
return;
|
75
75
|
}
|
76
76
|
dispatch((0, import_store.updateCustom)({ actionStatus: import_const2.LinklyActionStatus.Empty }));
|
77
|
-
if (status
|
77
|
+
if (status == 1) {
|
78
78
|
(_c = handleLinklySuccessRef.current) == null ? void 0 : _c.call(handleLinklySuccessRef, res);
|
79
79
|
return;
|
80
80
|
}
|
@@ -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/useTimeQuery.ts
|
@@ -24,15 +34,16 @@ __export(useTimeQuery_exports, {
|
|
24
34
|
module.exports = __toCommonJS(useTimeQuery_exports);
|
25
35
|
var import_react = require("react");
|
26
36
|
var import_utils = require("@pisell/utils");
|
37
|
+
var import_dayjs = __toESM(require("dayjs"));
|
27
38
|
var import_store = require("../../store");
|
28
39
|
var import_hooks = require("../../hooks");
|
29
40
|
var import_const = require("../../const");
|
30
41
|
var import_const2 = require("../const");
|
31
|
-
var GlobalTimeout = 1e3 * 60;
|
42
|
+
var GlobalTimeout = 1e3 * 60 * 2;
|
32
43
|
var RequestTimeout = 1e3 * 5;
|
33
44
|
var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
34
45
|
const dispatch = (0, import_store.useDispatch)();
|
35
|
-
const { numRef, modeRef, deviceRef } = (0, import_hooks.useStoreRef)();
|
46
|
+
const { numRef, modeRef, deviceRef, orderIdRef } = (0, import_hooks.useStoreRef)();
|
36
47
|
const fail = (0, import_hooks.useFail)(0);
|
37
48
|
const failRef = (0, import_react.useRef)(fail);
|
38
49
|
const isPay = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay;
|
@@ -80,30 +91,44 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
80
91
|
console.log("Success: 全局超时或不需要处理结果,终止查询");
|
81
92
|
return;
|
82
93
|
}
|
83
|
-
_log("Success" /* Success */, result);
|
84
94
|
isQueryFinishedRef.current = true;
|
85
95
|
const data = (result == null ? void 0 : result.data) || {};
|
86
|
-
if (data.status
|
96
|
+
if (data.status == 1) {
|
87
97
|
console.log("交易成功,终止查询");
|
98
|
+
(0, import_utils.sendWarningLog)({
|
99
|
+
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易成功`,
|
100
|
+
content: [{ key: "response", value: JSON.stringify(result) }]
|
101
|
+
});
|
88
102
|
reset();
|
89
103
|
handleLinklySuccess(result);
|
90
104
|
return;
|
91
105
|
}
|
92
|
-
if (data
|
106
|
+
if ((data == null ? void 0 : data.status) == 0 && (data == null ? void 0 : data.signature_flag) != 1) {
|
93
107
|
console.log("交易状态为0需要继续查询");
|
108
|
+
_log("Querying" /* Querying */, result);
|
94
109
|
isQueryFinishedRef.current = false;
|
95
|
-
|
110
|
+
setTimeout(() => {
|
111
|
+
_resultQuery();
|
112
|
+
}, 1500);
|
96
113
|
return;
|
97
114
|
}
|
98
115
|
if (data.status < 0) {
|
99
116
|
console.log("交易失败,终止查询");
|
117
|
+
(0, import_utils.sendWarningLog)({
|
118
|
+
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易失败`,
|
119
|
+
content: [{ key: "response", value: JSON.stringify(result) }]
|
120
|
+
});
|
100
121
|
reset();
|
101
122
|
result.code = import_const.PayStatus.Unknown;
|
102
123
|
(_a2 = failRef.current) == null ? void 0 : _a2.call(failRef, result, false);
|
103
124
|
return;
|
104
125
|
}
|
105
|
-
if (data.signature_flag
|
126
|
+
if (data.signature_flag == 1) {
|
106
127
|
console.log("交易需要签名,终止查询");
|
128
|
+
(0, import_utils.sendWarningLog)({
|
129
|
+
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易需要签名`,
|
130
|
+
content: [{ key: "response", value: JSON.stringify(result) }]
|
131
|
+
});
|
107
132
|
reset();
|
108
133
|
gotoSignature();
|
109
134
|
return;
|
@@ -120,7 +145,18 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
120
145
|
_log("AbortError" /* AbortError */);
|
121
146
|
console.log("Error: 请求被取消,将继续查询");
|
122
147
|
isQueryFinishedRef.current = false;
|
123
|
-
|
148
|
+
setTimeout(() => {
|
149
|
+
_resultQuery();
|
150
|
+
}, 1500);
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
if (!(error == null ? void 0 : error.code) || `${error.code}` === import_const.PayStatus.Timeout) {
|
154
|
+
_log("NetworkError" /* NetworkError */);
|
155
|
+
console.log("Error: 网关类报错,将继续查询");
|
156
|
+
isQueryFinishedRef.current = false;
|
157
|
+
setTimeout(() => {
|
158
|
+
_resultQuery();
|
159
|
+
}, 1500);
|
124
160
|
return;
|
125
161
|
}
|
126
162
|
_log("Error" /* Error */, error);
|
@@ -185,23 +221,29 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
185
221
|
session_id: numRef.current
|
186
222
|
};
|
187
223
|
const content = [
|
188
|
-
{
|
224
|
+
{
|
225
|
+
key: "description",
|
226
|
+
value: JSON.stringify({
|
227
|
+
queryId: queryIdRef.current,
|
228
|
+
orderId: orderIdRef.current,
|
229
|
+
type,
|
230
|
+
date: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
231
|
+
})
|
232
|
+
},
|
189
233
|
{ key: "params", value: JSON.stringify(params) }
|
190
234
|
];
|
191
|
-
if (type === "
|
192
|
-
content.push({ key: "response", value: JSON.stringify(res) });
|
193
|
-
} else if (type === "Error" /* Error */) {
|
235
|
+
if (type === "Error" /* Error */) {
|
194
236
|
content.push({ key: "error", value: JSON.stringify(res) });
|
237
|
+
} else {
|
238
|
+
content.push({ key: "response", value: JSON.stringify(res) });
|
195
239
|
}
|
196
240
|
(0, import_utils.sendWarningLog)({
|
197
|
-
title: `Linkly-${isPay ? "Pay" : "Refund"}
|
241
|
+
title: `Linkly-${isPay ? "Pay" : "Refund"}-交易结果轮询`,
|
198
242
|
content
|
199
243
|
});
|
200
244
|
};
|
201
245
|
const run = () => {
|
202
246
|
reset();
|
203
|
-
console.log("开始查询linkly结果---->>>>>>>");
|
204
|
-
_log("Start" /* Start */);
|
205
247
|
globalTimeoutIdRef.current = setTimeout(() => {
|
206
248
|
var _a;
|
207
249
|
console.log("全局超时,终止所有重试");
|
@@ -212,6 +254,8 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
212
254
|
startTimeRef.current = Date.now();
|
213
255
|
isQueryFinishedRef.current = false;
|
214
256
|
queryIdRef.current = (0, import_utils.getUniqueId)();
|
257
|
+
console.log("开始查询linkly结果---->>>>>>>");
|
258
|
+
_log("Start" /* Start */);
|
215
259
|
return _resultQuery();
|
216
260
|
};
|
217
261
|
return { run, stop: reset };
|
@@ -148,15 +148,15 @@ var POS = ({
|
|
148
148
|
const resultPromise = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay ? api.pay(
|
149
149
|
{
|
150
150
|
...(custom == null ? void 0 : custom.platform) ? {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
151
|
+
operator_id: custom.operator_id,
|
152
|
+
operator_type: custom.operator_type,
|
153
|
+
platform: custom.platform,
|
154
|
+
custom_payment_id: custom.custom_payment_id,
|
155
|
+
service_charge: {
|
156
|
+
amount: payRef.current.surMoney,
|
157
|
+
percentage: payRef.current.surPercentRate
|
158
158
|
},
|
159
|
-
|
159
|
+
original_amount: payRef.current.amount
|
160
160
|
} : {},
|
161
161
|
order_id: orderIdRef.current,
|
162
162
|
amount: payRef.current.total,
|
@@ -215,7 +215,7 @@ var POS = ({
|
|
215
215
|
if (unloadRef.current || !netRef.current) {
|
216
216
|
return;
|
217
217
|
}
|
218
|
-
if (err
|
218
|
+
if (!(err == null ? void 0 : err.code) || `${err.code}` === import_const.PayStatus.Timeout) {
|
219
219
|
checkApi();
|
220
220
|
return;
|
221
221
|
}
|
@@ -52,7 +52,7 @@ var payData = async (params, config) => import_utils.request.getRequest().post("
|
|
52
52
|
var refundData = async (params, config) => import_utils.request.getRequest().post("/shop/pay/card-reader/refund", params, config);
|
53
53
|
var addTransaction = async (params, config) => import_utils.request.getRequest().post("/shop/pay/card-reader/transaction", params, config);
|
54
54
|
var editTransaction = async (id, params, config) => import_utils.request.getRequest().put(`/shop/pay/card-reader/transaction/${id}`, params, config);
|
55
|
-
var linklyPayQuery = async (params, config) => import_utils.request.getRequest().get("/shop/
|
55
|
+
var linklyPayQuery = async (params, config) => import_utils.request.getRequest().get("/shop/linkly/pay/query", params, config);
|
56
56
|
var linklyRefundQuery = async (params, config) => import_utils.request.getRequest().get("/shop/linkly/refund/query", params, config);
|
57
57
|
// Annotate the CommonJS export names for ESM import in node:
|
58
58
|
0 && (module.exports = {
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
175
175
|
type: EActionTypes;
|
176
176
|
payload: {
|
177
|
-
status: "
|
177
|
+
status: "loading" | "warn" | "success" | "fail" | "question";
|
178
178
|
};
|
179
179
|
};
|
180
180
|
/**
|
@@ -295,7 +295,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
295
295
|
name?: string | undefined;
|
296
296
|
symbol?: string | undefined;
|
297
297
|
amount?: string | number | undefined;
|
298
|
-
mode?: "refund" | "
|
298
|
+
mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
300
|
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
308
308
|
net?: boolean | undefined;
|
309
309
|
component?: string | undefined;
|
310
310
|
form?: string | undefined;
|
311
|
-
status?: "
|
311
|
+
status?: "loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
312
312
|
warn?: string | undefined;
|
313
313
|
steps?: {
|
314
314
|
/** 用于重置当前步骤 */
|
@@ -17,4 +17,6 @@ import PisellSelectCustomerModal from './pisellSelectCustomerModal';
|
|
17
17
|
import SubTotal from './subTotal';
|
18
18
|
import EditBookingModal from './booking/editBookingModal';
|
19
19
|
import StepController from './stepController';
|
20
|
-
|
20
|
+
import PinModal from './pinModal';
|
21
|
+
import PinVerifyModal from './pinVerifyModal';
|
22
|
+
export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension, RuleSetting, TaxSelect, ToCPay, PisellSelectCustomerModal, Wallet, WalletList, WorkspaceList, WorkspaceListDetail, SubTotal, EditBookingModal, StepController, PinModal, PinVerifyModal, };
|
package/lib/components/index.js
CHANGED
@@ -36,6 +36,8 @@ __export(components_exports, {
|
|
36
36
|
BookingNotes: () => import_notes.default,
|
37
37
|
EditBookingModal: () => import_editBookingModal.default,
|
38
38
|
Login: () => import_login.default,
|
39
|
+
PinModal: () => import_pinModal.default,
|
40
|
+
PinVerifyModal: () => import_pinVerifyModal.default,
|
39
41
|
PisellSelectCustomerModal: () => import_pisellSelectCustomerModal.default,
|
40
42
|
ProductExtension: () => import_productExtension.default,
|
41
43
|
RuleSetting: () => import_ruleSetting.default,
|
@@ -69,6 +71,8 @@ var import_pisellSelectCustomerModal = __toESM(require("./pisellSelectCustomerMo
|
|
69
71
|
var import_subTotal = __toESM(require("./subTotal"));
|
70
72
|
var import_editBookingModal = __toESM(require("./booking/editBookingModal"));
|
71
73
|
var import_stepController = __toESM(require("./stepController"));
|
74
|
+
var import_pinModal = __toESM(require("./pinModal"));
|
75
|
+
var import_pinVerifyModal = __toESM(require("./pinVerifyModal"));
|
72
76
|
// Annotate the CommonJS export names for ESM import in node:
|
73
77
|
0 && (module.exports = {
|
74
78
|
Booking,
|
@@ -78,6 +82,8 @@ var import_stepController = __toESM(require("./stepController"));
|
|
78
82
|
BookingNotes,
|
79
83
|
EditBookingModal,
|
80
84
|
Login,
|
85
|
+
PinModal,
|
86
|
+
PinVerifyModal,
|
81
87
|
PisellSelectCustomerModal,
|
82
88
|
ProductExtension,
|
83
89
|
RuleSetting,
|
@@ -171,6 +171,7 @@ var createThreeDSMethodIframe = async (threeDSMethodData, callback) => {
|
|
171
171
|
return defaultReturnParams;
|
172
172
|
}
|
173
173
|
const displayBox = document.getElementById("threeds-container");
|
174
|
+
displayBox.innerHTML = "";
|
174
175
|
let iframe = document.createElement("iframe");
|
175
176
|
iframe.classList.add("hidden_TDS_From");
|
176
177
|
iframe.name = "threeDSMethodIframe";
|
@@ -286,6 +287,7 @@ var checkTDSAuth = async (step2, step3, callback) => {
|
|
286
287
|
};
|
287
288
|
var createChallengeIframe = (challengeData, callback) => {
|
288
289
|
const displayBox = document.getElementById("threeds-container");
|
290
|
+
displayBox.innerHTML = "";
|
289
291
|
let iframe = document.createElement("iframe");
|
290
292
|
iframe.classList.add("tdsv2challengeIframe");
|
291
293
|
iframe.name = "challengeIframe";
|
@@ -11,6 +11,8 @@ export interface WalletPassListProps {
|
|
11
11
|
name: string;
|
12
12
|
};
|
13
13
|
onChangeDebounce?: boolean;
|
14
|
+
loading?: boolean;
|
15
|
+
onLoadingChange?: (loading: boolean) => void;
|
14
16
|
}
|
15
17
|
export declare type WalletPassListRef = {
|
16
18
|
init: (params: MachineCodeListParams, formatList?: (val: WalletPassDataType[]) => WalletPassDataType[]) => void;
|