@pisell/private-materials 6.6.62 → 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 +8 -8
- 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/checkout/hooks/useWalletPass.d.ts +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 +4 -8
- 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/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/checkout/hooks/useWalletPass.d.ts +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 +4 -8
- 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/package.json +2 -2
- 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
|
@@ -23,7 +23,7 @@ __export(locales_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(locales_exports);
|
|
25
25
|
var locales_default = {
|
|
26
|
-
|
|
26
|
+
en: {
|
|
27
27
|
"page.eftpos.text.manufacturer": "Manufacturer",
|
|
28
28
|
"page.eftpos.text.description": "Description",
|
|
29
29
|
"page.eftpos.text.status": "status",
|
|
@@ -45,6 +45,7 @@ var locales_default = {
|
|
|
45
45
|
"page.eftpos.text.edit": "Edit",
|
|
46
46
|
"page.eftpos.text.delete": "Delete",
|
|
47
47
|
"page.eftpos.text.save": "Save",
|
|
48
|
+
"page.eftpos.text.pair": "Pair",
|
|
48
49
|
"page.eftpos.text.confim.delete": "Confirm delete",
|
|
49
50
|
"page.eftpos.text.confirm_delete-message": (x) => `Confirm delete ${x} Device`,
|
|
50
51
|
"page.eftpos.text.confim.cancel": "Cancel",
|
|
@@ -57,9 +58,50 @@ var locales_default = {
|
|
|
57
58
|
"page.eftpos.text.table.del.delete": "Delete",
|
|
58
59
|
"page.eftpos.text.table.del.cancel": "Cancel",
|
|
59
60
|
"page.eftpos.text.log": "Log",
|
|
61
|
+
"page.eftpos.text.settlement": "Settlement",
|
|
62
|
+
"page.eftpos.text.settlement_enquiry": "Settlement enquiry",
|
|
63
|
+
"page.eftpos.text.simple.cloud.integration": "Simple Cloud Integration",
|
|
64
|
+
"page.eftpos.text.simple.cloud.integration.steps": [
|
|
65
|
+
"1. On the terminal, open “Manage POS Pairing” and create a new pairing.",
|
|
66
|
+
"2. Select “Simple Cloud Integration”.",
|
|
67
|
+
"3. Enter the pairing code shown on the terminal.",
|
|
68
|
+
"4. Enter a pairing name for the terminal.",
|
|
69
|
+
"5. Tap “Pair” to start pairing."
|
|
70
|
+
],
|
|
60
71
|
"page.eftpos.text.setting": "Setting",
|
|
61
72
|
"page.eftpos.text.setting.tip": "You have not configured the necessary parameters, which may affect the normal use of your POS! ",
|
|
62
|
-
"page.eftpos.text.setting.btn": "Go to configure"
|
|
73
|
+
"page.eftpos.text.setting.btn": "Go to configure",
|
|
74
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
75
|
+
if (status === "pairing") {
|
|
76
|
+
return {
|
|
77
|
+
title: "Pairing",
|
|
78
|
+
description: "Confirm the code on the EFTPOS terminal to continue.",
|
|
79
|
+
codeTitle: "Code",
|
|
80
|
+
cancenButtonText: "Cancel",
|
|
81
|
+
okButtonText: "Check status"
|
|
82
|
+
};
|
|
83
|
+
} else if (status === "success") {
|
|
84
|
+
return {
|
|
85
|
+
title: "Pairing is active",
|
|
86
|
+
description: "You are ready to go!",
|
|
87
|
+
codeTitle: "",
|
|
88
|
+
cancenButtonText: "Unpair",
|
|
89
|
+
okButtonText: "Confirm"
|
|
90
|
+
};
|
|
91
|
+
} else if (status === "failed") {
|
|
92
|
+
return {
|
|
93
|
+
title: "Pairing not active",
|
|
94
|
+
description: "Check the terminal, confirm the pairing code, then try again.",
|
|
95
|
+
codeTitle: "Code",
|
|
96
|
+
cancenButtonText: "Cancel",
|
|
97
|
+
okButtonText: "Check status"
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"page.eftpos.text.repair.message.warning": "Device is already connected. No need to reconnect.",
|
|
102
|
+
"page.eftpos.text.settlement.failed": "Please check network and terminal connections and try again",
|
|
103
|
+
"page.eftpos.text.settlement.button.done": "Done",
|
|
104
|
+
"page.eftpos.text.pair.error": "Please check network and terminal connections and try again"
|
|
63
105
|
},
|
|
64
106
|
"zh-CN": {
|
|
65
107
|
"page.eftpos.text.manufacturer": "厂商",
|
|
@@ -83,6 +125,7 @@ var locales_default = {
|
|
|
83
125
|
"page.eftpos.text.edit": "编辑",
|
|
84
126
|
"page.eftpos.text.delete": "删除",
|
|
85
127
|
"page.eftpos.text.save": "保存",
|
|
128
|
+
"page.eftpos.text.pair": "配对",
|
|
86
129
|
"page.eftpos.text.confim.delete": "确认删除",
|
|
87
130
|
"page.eftpos.text.confirm_delete-message": (x) => `确认删除 ${x} 设备吗?`,
|
|
88
131
|
"page.eftpos.text.confim.cancel": "取消",
|
|
@@ -95,9 +138,50 @@ var locales_default = {
|
|
|
95
138
|
"page.eftpos.text.table.del.delete": "删除",
|
|
96
139
|
"page.eftpos.text.table.del.cancel": "取消",
|
|
97
140
|
"page.eftpos.text.log": "日志",
|
|
141
|
+
"page.eftpos.text.settlement": "结算",
|
|
142
|
+
"page.eftpos.text.settlement_enquiry": "结算查询",
|
|
143
|
+
"page.eftpos.text.simple.cloud.integration": "云端集成",
|
|
144
|
+
"page.eftpos.text.simple.cloud.integration.steps": [
|
|
145
|
+
"1. 在刷卡机上打开“POS配对管理”,创建新的配对。",
|
|
146
|
+
"2. 选择“云端集成”。",
|
|
147
|
+
"3. 输入刷卡机显示的配对码。",
|
|
148
|
+
"4. 为刷卡机输入配对名称。",
|
|
149
|
+
"5. 点击“配对”开始连接。"
|
|
150
|
+
],
|
|
98
151
|
"page.eftpos.text.setting": "设置",
|
|
99
152
|
"page.eftpos.text.setting.tip": "您尚未配置必要参数,这可能会影响您Pos的正常使用!",
|
|
100
|
-
"page.eftpos.text.setting.btn": "前往配置"
|
|
153
|
+
"page.eftpos.text.setting.btn": "前往配置",
|
|
154
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
155
|
+
if (status === "pairing") {
|
|
156
|
+
return {
|
|
157
|
+
title: "正在配对",
|
|
158
|
+
description: "请在刷卡机上确认配对码以继续。",
|
|
159
|
+
codeTitle: "配对码",
|
|
160
|
+
cancenButtonText: "取消",
|
|
161
|
+
okButtonText: "检查状态"
|
|
162
|
+
};
|
|
163
|
+
} else if (status === "success") {
|
|
164
|
+
return {
|
|
165
|
+
title: "配对成功",
|
|
166
|
+
description: "设备已成功连接,可开始使用。",
|
|
167
|
+
codeTitle: "",
|
|
168
|
+
cancenButtonText: "解除配对",
|
|
169
|
+
okButtonText: "确认"
|
|
170
|
+
};
|
|
171
|
+
} else if (status === "failed") {
|
|
172
|
+
return {
|
|
173
|
+
title: "配对未生效",
|
|
174
|
+
description: "请检查刷卡机并确认配对码后重试。",
|
|
175
|
+
codeTitle: "配对码",
|
|
176
|
+
cancenButtonText: "取消",
|
|
177
|
+
okButtonText: "检查状态"
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"page.eftpos.text.repair.message.warning": "设备已连接,无需重新连接。",
|
|
182
|
+
"page.eftpos.text.settlement.failed": "请检查网络和终端连接并重试",
|
|
183
|
+
"page.eftpos.text.settlement.button.done": "完成",
|
|
184
|
+
"page.eftpos.text.pair.error": "请检查网络与设备连接后重试"
|
|
101
185
|
},
|
|
102
186
|
"zh-HK": {
|
|
103
187
|
"page.eftpos.text.manufacturer": "廠商",
|
|
@@ -121,6 +205,7 @@ var locales_default = {
|
|
|
121
205
|
"page.eftpos.text.edit": "編輯",
|
|
122
206
|
"page.eftpos.text.delete": "删除",
|
|
123
207
|
"page.eftpos.text.save": "保存",
|
|
208
|
+
"page.eftpos.text.pair": "配對",
|
|
124
209
|
"page.eftpos.text.confim.delete": "確認刪除",
|
|
125
210
|
"page.eftpos.text.confirm_delete-message": (x) => `確認刪除 ${x} 設備嗎?`,
|
|
126
211
|
"page.eftpos.text.confim.cancel": "取消",
|
|
@@ -133,9 +218,50 @@ var locales_default = {
|
|
|
133
218
|
"page.eftpos.text.table.del.delete": "刪除",
|
|
134
219
|
"page.eftpos.text.table.del.cancel": "取消",
|
|
135
220
|
"page.eftpos.text.log": "日誌",
|
|
221
|
+
"page.eftpos.text.settlement": "結算",
|
|
222
|
+
"page.eftpos.text.settlement_enquiry": "結算查詢",
|
|
223
|
+
"page.eftpos.text.simple.cloud.integration": "雲端整合",
|
|
224
|
+
"page.eftpos.text.simple.cloud.integration.steps": [
|
|
225
|
+
"1. 在刷卡機上開啟「POS配對管理」,建立新的配對。",
|
|
226
|
+
"2. 選擇「雲端整合」。",
|
|
227
|
+
"3. 輸入刷卡機顯示的配對碼。",
|
|
228
|
+
"4. 為刷卡機輸入配對名稱。",
|
|
229
|
+
"5. 點擊「配對」開始連線。"
|
|
230
|
+
],
|
|
136
231
|
"page.eftpos.text.setting": "设置",
|
|
137
232
|
"page.eftpos.text.setting.tip": "您尚未配置必要參數,這可能會影響您Pos的正常使用!",
|
|
138
|
-
"page.eftpos.text.setting.btn": "前往配置"
|
|
233
|
+
"page.eftpos.text.setting.btn": "前往配置",
|
|
234
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
235
|
+
if (status === "pairing") {
|
|
236
|
+
return {
|
|
237
|
+
title: "正在配對",
|
|
238
|
+
description: "請在刷卡機上確認配對碼以繼續。",
|
|
239
|
+
codeTitle: "配對碼",
|
|
240
|
+
cancenButtonText: "取消",
|
|
241
|
+
okButtonText: "檢查狀態"
|
|
242
|
+
};
|
|
243
|
+
} else if (status === "success") {
|
|
244
|
+
return {
|
|
245
|
+
title: "配對成功",
|
|
246
|
+
description: "設備已成功連接,可開始使用。",
|
|
247
|
+
codeTitle: "",
|
|
248
|
+
cancenButtonText: "解除配對",
|
|
249
|
+
okButtonText: "確認"
|
|
250
|
+
};
|
|
251
|
+
} else if (status === "failed") {
|
|
252
|
+
return {
|
|
253
|
+
title: "配對未生效",
|
|
254
|
+
description: "請檢查刷卡機並確認配對碼後重試。",
|
|
255
|
+
codeTitle: "配對碼",
|
|
256
|
+
cancenButtonText: "取消",
|
|
257
|
+
okButtonText: "檢查狀態"
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"page.eftpos.text.repair.message.warning": "設備已連接,無需重新連接。",
|
|
262
|
+
"page.eftpos.text.settlement.failed": "請檢查網絡和終端連接並重試",
|
|
263
|
+
"page.eftpos.text.settlement.button.done": "完成",
|
|
264
|
+
"page.eftpos.text.pair.error": "請檢查網絡與設備連接後重試"
|
|
139
265
|
},
|
|
140
266
|
ja: {
|
|
141
267
|
"page.eftpos.text.manufacturer": "メーカー",
|
|
@@ -148,69 +274,153 @@ var locales_default = {
|
|
|
148
274
|
return `デバイスを追加`;
|
|
149
275
|
}
|
|
150
276
|
const action = status == "add" ? "追加" : status == "edit" ? "編集" : "再設定";
|
|
151
|
-
return `${
|
|
277
|
+
return `${name} デバイスを${action}`;
|
|
152
278
|
},
|
|
153
|
-
"page.eftpos.text.device.list": "
|
|
279
|
+
"page.eftpos.text.device.list": "デバイス一覧",
|
|
154
280
|
"page.eftpos.text.device.name": "デバイス名",
|
|
155
|
-
"page.eftpos.text.sucahrge": "
|
|
281
|
+
"page.eftpos.text.sucahrge": "サーチャージ",
|
|
156
282
|
"page.eftpos.text.paired": "ペアリング済み",
|
|
157
283
|
"page.eftpos.text.unpaired": "未ペアリング",
|
|
158
284
|
"page.eftpos.text.repair": "再設定",
|
|
159
285
|
"page.eftpos.text.edit": "編集",
|
|
160
286
|
"page.eftpos.text.delete": "削除",
|
|
161
287
|
"page.eftpos.text.save": "保存",
|
|
162
|
-
"page.eftpos.text.
|
|
288
|
+
"page.eftpos.text.pair": "ペアリング",
|
|
289
|
+
"page.eftpos.text.confim.delete": "削除の確認",
|
|
163
290
|
"page.eftpos.text.confirm_delete-message": (x) => `${x} デバイスを削除してもよろしいですか?`,
|
|
164
291
|
"page.eftpos.text.confim.cancel": "キャンセル",
|
|
165
292
|
"page.eftpos.text.table.name": "デバイス名",
|
|
166
293
|
"page.eftpos.text.table.status": "ステータス",
|
|
167
|
-
"page.eftpos.text.table.surcharge": "
|
|
294
|
+
"page.eftpos.text.table.surcharge": "サーチャージ",
|
|
168
295
|
"page.eftpos.text.table.opeartion": "操作",
|
|
169
296
|
"page.eftpos.text.table.del.title": "デバイスを削除",
|
|
170
|
-
"page.eftpos.text.table.del.text": "
|
|
297
|
+
"page.eftpos.text.table.del.text": "このデバイスを削除してもよろしいですか?",
|
|
171
298
|
"page.eftpos.text.table.del.delete": "削除",
|
|
172
299
|
"page.eftpos.text.table.del.cancel": "キャンセル",
|
|
173
300
|
"page.eftpos.text.log": "ログ",
|
|
301
|
+
"page.eftpos.text.settlement": "精算",
|
|
302
|
+
"page.eftpos.text.settlement_enquiry": "精算照会",
|
|
303
|
+
"page.eftpos.text.simple.cloud.integration": "クラウド連携",
|
|
304
|
+
"page.eftpos.text.simple.cloud.integration.steps": [
|
|
305
|
+
"1. 端末で「POSペアリング管理」を開き、新しいペアリングを作成します。",
|
|
306
|
+
"2. 「クラウド連携」を選択します。",
|
|
307
|
+
"3. 端末に表示されたペアリングコードを入力します。",
|
|
308
|
+
"4. 端末の配対名前を入力します。",
|
|
309
|
+
"5. 「ペアリング」をタップして接続を開始します。"
|
|
310
|
+
],
|
|
174
311
|
"page.eftpos.text.setting": "設定",
|
|
175
|
-
"page.eftpos.text.setting.tip": "
|
|
176
|
-
"page.eftpos.text.setting.btn": "
|
|
312
|
+
"page.eftpos.text.setting.tip": "必要なパラメータが設定されていません。POS の正常な利用に影響する場合があります。",
|
|
313
|
+
"page.eftpos.text.setting.btn": "設定へ進む",
|
|
314
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
315
|
+
if (status === "pairing") {
|
|
316
|
+
return {
|
|
317
|
+
title: "ペアリング",
|
|
318
|
+
description: "続行するには、EFTPOS 端末でコードを確認してください。",
|
|
319
|
+
codeTitle: "コード",
|
|
320
|
+
cancenButtonText: "キャンセル",
|
|
321
|
+
okButtonText: "状態を確認"
|
|
322
|
+
};
|
|
323
|
+
} else if (status === "success") {
|
|
324
|
+
return {
|
|
325
|
+
title: "ペアリングは有効です",
|
|
326
|
+
description: "準備ができました。",
|
|
327
|
+
codeTitle: "",
|
|
328
|
+
cancenButtonText: "ペア解除",
|
|
329
|
+
okButtonText: "確認"
|
|
330
|
+
};
|
|
331
|
+
} else if (status === "failed") {
|
|
332
|
+
return {
|
|
333
|
+
title: "ペアリングは無効です",
|
|
334
|
+
description: "端末を確認し、ペアリングコードを確認してから再度お試しください。",
|
|
335
|
+
codeTitle: "コード",
|
|
336
|
+
cancenButtonText: "キャンセル",
|
|
337
|
+
okButtonText: "状態を確認"
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"page.eftpos.text.repair.message.warning": "デバイスはすでに接続されています。再接続の必要はありません。",
|
|
342
|
+
"page.eftpos.text.settlement.failed": "ネットワークと端末の接続を確認してから再度お試しください",
|
|
343
|
+
"page.eftpos.text.settlement.button.done": "完了",
|
|
344
|
+
"page.eftpos.text.pair.error": "ネットワークと端末の接続を確認してから再度お試しください"
|
|
177
345
|
},
|
|
178
346
|
pt: {
|
|
179
347
|
"page.eftpos.text.manufacturer": "Fabricante",
|
|
180
348
|
"page.eftpos.text.description": "Descrição",
|
|
181
|
-
"page.eftpos.text.status": "
|
|
349
|
+
"page.eftpos.text.status": "Status",
|
|
182
350
|
"page.eftpos.text.operation": "Operação",
|
|
183
351
|
"page.eftpos.text.device": "Dispositivo",
|
|
184
352
|
"page.eftpos.text.device.add": (status, name) => {
|
|
185
353
|
if (!name) {
|
|
186
354
|
return `Adicionar dispositivo`;
|
|
187
355
|
}
|
|
188
|
-
const action = status == "add" ? "Adicionar" : status == "edit" ? "Editar" : "
|
|
356
|
+
const action = status == "add" ? "Adicionar" : status == "edit" ? "Editar" : "Reconfigurar";
|
|
189
357
|
return `${action} dispositivo ${name}`;
|
|
190
358
|
},
|
|
191
359
|
"page.eftpos.text.device.list": "Lista de dispositivos",
|
|
192
360
|
"page.eftpos.text.device.name": "Nome do dispositivo",
|
|
193
|
-
"page.eftpos.text.sucahrge": "Taxa",
|
|
361
|
+
"page.eftpos.text.sucahrge": "Taxa adicional",
|
|
194
362
|
"page.eftpos.text.paired": "Emparelhado",
|
|
195
363
|
"page.eftpos.text.unpaired": "Não emparelhado",
|
|
196
|
-
"page.eftpos.text.repair": "
|
|
364
|
+
"page.eftpos.text.repair": "Reconfigurar",
|
|
197
365
|
"page.eftpos.text.edit": "Editar",
|
|
198
366
|
"page.eftpos.text.delete": "Excluir",
|
|
199
367
|
"page.eftpos.text.save": "Salvar",
|
|
368
|
+
"page.eftpos.text.pair": "Emparelhar",
|
|
200
369
|
"page.eftpos.text.confim.delete": "Confirmar exclusão",
|
|
201
|
-
"page.eftpos.text.confirm_delete-message": (x) => `Confirmar exclusão do dispositivo ${x}
|
|
370
|
+
"page.eftpos.text.confirm_delete-message": (x) => `Confirmar exclusão do dispositivo ${x}?`,
|
|
202
371
|
"page.eftpos.text.confim.cancel": "Cancelar",
|
|
203
372
|
"page.eftpos.text.table.name": "Nome do dispositivo",
|
|
204
373
|
"page.eftpos.text.table.status": "Status",
|
|
205
|
-
"page.eftpos.text.table.surcharge": "Taxa",
|
|
374
|
+
"page.eftpos.text.table.surcharge": "Taxa adicional",
|
|
206
375
|
"page.eftpos.text.table.opeartion": "Operação",
|
|
207
376
|
"page.eftpos.text.table.del.title": "Excluir dispositivo",
|
|
208
377
|
"page.eftpos.text.table.del.text": "Tem certeza de que deseja excluir o dispositivo?",
|
|
209
378
|
"page.eftpos.text.table.del.delete": "Excluir",
|
|
210
379
|
"page.eftpos.text.table.del.cancel": "Cancelar",
|
|
211
|
-
"page.eftpos.text.log": "
|
|
380
|
+
"page.eftpos.text.log": "Registro",
|
|
381
|
+
"page.eftpos.text.settlement": "Liquidação",
|
|
382
|
+
"page.eftpos.text.settlement_enquiry": "Consulta de liquidação",
|
|
383
|
+
"page.eftpos.text.simple.cloud.integration": "Integração na Nuvem",
|
|
384
|
+
"page.eftpos.text.simple.cloud.integration.steps": [
|
|
385
|
+
"1. No terminal, abra “Gerir emparelhamento POS” e crie um novo emparelhamento.",
|
|
386
|
+
"2. Selecione “Integração na Nuvem”.",
|
|
387
|
+
"3. Introduza o código de emparelhamento apresentado no terminal.",
|
|
388
|
+
"4. Introduza um nome de emparelhamento para o terminal.",
|
|
389
|
+
"5. Toque em “Emparelhar” para iniciar a ligação."
|
|
390
|
+
],
|
|
212
391
|
"page.eftpos.text.setting": "Configurações",
|
|
213
|
-
"page.eftpos.text.setting.tip": "Você não configurou os parâmetros necessários, o que pode afetar o uso normal do seu POS
|
|
214
|
-
"page.eftpos.text.setting.btn": "Ir para configurar"
|
|
392
|
+
"page.eftpos.text.setting.tip": "Você não configurou os parâmetros necessários, o que pode afetar o uso normal do seu POS.",
|
|
393
|
+
"page.eftpos.text.setting.btn": "Ir para configurar",
|
|
394
|
+
"page.eftpos.text.pair.modal.content.text-info": (status) => {
|
|
395
|
+
if (status === "pairing") {
|
|
396
|
+
return {
|
|
397
|
+
title: "Emparelhamento",
|
|
398
|
+
description: "Confirme o código no terminal EFTPOS para continuar.",
|
|
399
|
+
codeTitle: "Código",
|
|
400
|
+
cancenButtonText: "Cancelar",
|
|
401
|
+
okButtonText: "Verificar status"
|
|
402
|
+
};
|
|
403
|
+
} else if (status === "success") {
|
|
404
|
+
return {
|
|
405
|
+
title: "Emparelhamento ativo",
|
|
406
|
+
description: "Tudo pronto para usar.",
|
|
407
|
+
codeTitle: "",
|
|
408
|
+
cancenButtonText: "Desemparelhar",
|
|
409
|
+
okButtonText: "Confirmar"
|
|
410
|
+
};
|
|
411
|
+
} else if (status === "failed") {
|
|
412
|
+
return {
|
|
413
|
+
title: "Emparelhamento inativo",
|
|
414
|
+
description: "Verifique o terminal, confirme o código de emparelhamento e tente novamente.",
|
|
415
|
+
codeTitle: "Código",
|
|
416
|
+
cancenButtonText: "Cancelar",
|
|
417
|
+
okButtonText: "Verificar status"
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
"page.eftpos.text.repair.message.warning": "O dispositivo já está conectado. Não é necessário reconectar.",
|
|
422
|
+
"page.eftpos.text.settlement.failed": "Verifique a rede e as conexões do terminal e tente novamente",
|
|
423
|
+
"page.eftpos.text.settlement.button.done": "Concluído",
|
|
424
|
+
"page.eftpos.text.pair.error": "Verifique a rede e as conexões do terminal e tente novamente"
|
|
215
425
|
}
|
|
216
426
|
};
|
|
@@ -36,6 +36,8 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_const = require("./const");
|
|
40
|
+
var import_SettlementModal = __toESM(require("./SettlementModal"));
|
|
39
41
|
var { Column } = import_antd.Table;
|
|
40
42
|
var { Title, Text } = import_antd.Typography;
|
|
41
43
|
var App = ({
|
|
@@ -78,6 +80,8 @@ var App = ({
|
|
|
78
80
|
total: 0
|
|
79
81
|
});
|
|
80
82
|
const [data, setData] = (0, import_react.useState)([]);
|
|
83
|
+
const [settlementModalOpen, setSettlementModalOpen] = (0, import_react.useState)(false);
|
|
84
|
+
const [settlementModalData, setSettlementModalData] = (0, import_react.useState)(null);
|
|
81
85
|
const loadData = async (current) => {
|
|
82
86
|
if (typeof getList !== "function") {
|
|
83
87
|
return Promise.reject(`getList ${getList} is not function`);
|
|
@@ -146,6 +150,16 @@ var App = ({
|
|
|
146
150
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
147
151
|
loadData
|
|
148
152
|
}));
|
|
153
|
+
const onSettlement = (device) => {
|
|
154
|
+
console.log("onSettlement", device);
|
|
155
|
+
setSettlementModalOpen(true);
|
|
156
|
+
setSettlementModalData({ type: "SETTLEMENT", card_reader_id: device.id });
|
|
157
|
+
};
|
|
158
|
+
const onSettlementEnquiry = (device) => {
|
|
159
|
+
console.log("onSettlementEnquiry", device);
|
|
160
|
+
setSettlementModalOpen(true);
|
|
161
|
+
setSettlementModalData({ type: "ENQUIRY", card_reader_id: device.id });
|
|
162
|
+
};
|
|
149
163
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
150
164
|
"div",
|
|
151
165
|
{
|
|
@@ -239,10 +253,17 @@ var App = ({
|
|
|
239
253
|
Column,
|
|
240
254
|
{
|
|
241
255
|
title: import_utils.locales.getText("page.eftpos.text.table.opeartion"),
|
|
242
|
-
width: size[3],
|
|
256
|
+
width: type === import_const.Eftpos.MX51 ? 600 : size[3],
|
|
243
257
|
key: "opeartion",
|
|
244
258
|
className: "pisell-lowcode__pos-table-col",
|
|
245
|
-
render: (record) => /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: "middle" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onRepairDevice(record) }, import_utils.locales.getText("page.eftpos.text.repair")), useTyroLog && type === "tyro" ? /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onLogDevice(record) }, import_utils.locales.getText("page.eftpos.text.log")) : null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onEditDevice(record) }, import_utils.locales.getText("page.eftpos.text.edit")), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onDelDevice(record) }, import_utils.locales.getText("page.eftpos.text.delete")))
|
|
259
|
+
render: (record) => /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { size: "middle" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onRepairDevice(record) }, import_utils.locales.getText("page.eftpos.text.repair")), useTyroLog && type === "tyro" ? /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onLogDevice(record) }, import_utils.locales.getText("page.eftpos.text.log")) : null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onEditDevice(record) }, import_utils.locales.getText("page.eftpos.text.edit")), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onDelDevice(record) }, import_utils.locales.getText("page.eftpos.text.delete")), type === import_const.Eftpos.MX51 ? /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "link", onClick: () => onSettlement(record) }, import_utils.locales.getText("page.eftpos.text.settlement")), /* @__PURE__ */ import_react.default.createElement(
|
|
260
|
+
import_antd.Button,
|
|
261
|
+
{
|
|
262
|
+
type: "link",
|
|
263
|
+
onClick: () => onSettlementEnquiry(record)
|
|
264
|
+
},
|
|
265
|
+
import_utils.locales.getText("page.eftpos.text.settlement_enquiry")
|
|
266
|
+
)) : null)
|
|
246
267
|
}
|
|
247
268
|
)
|
|
248
269
|
),
|
|
@@ -287,6 +308,13 @@ var App = ({
|
|
|
287
308
|
/* @__PURE__ */ import_react.default.createElement("div", { style: { height: "34px" } }),
|
|
288
309
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__pos-table-del-title" }, import_utils.locales.getText("page.eftpos.text.table.del.title")),
|
|
289
310
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__pos-table-del-text" }, import_utils.locales.getText("page.eftpos.text.table.del.text"))
|
|
311
|
+
), settlementModalOpen && /* @__PURE__ */ import_react.default.createElement(
|
|
312
|
+
import_SettlementModal.default,
|
|
313
|
+
{
|
|
314
|
+
open: settlementModalOpen,
|
|
315
|
+
onClose: () => setSettlementModalOpen(false),
|
|
316
|
+
data: settlementModalData
|
|
317
|
+
}
|
|
290
318
|
));
|
|
291
319
|
};
|
|
292
320
|
var table_default = import_react.default.forwardRef(App);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaymentMethodOptions } from '../types';
|
|
2
2
|
declare const useMicropay: (options: PaymentMethodOptions) => {
|
|
3
|
-
run: (runParams?:
|
|
3
|
+
run: (runParams?: any) => void;
|
|
4
4
|
query: () => void;
|
|
5
5
|
action: (data: Record<string, any>) => void;
|
|
6
6
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import PaymentMethod from '../utils/payment';
|
|
2
|
+
import { PaymentMethodOptions } from '../types';
|
|
3
|
+
export declare const usePayment: (options: PaymentMethodOptions) => {
|
|
4
|
+
run: () => void;
|
|
5
|
+
query: () => void;
|
|
6
|
+
action: (data: Record<string, any>, config?: Record<string, any>) => void;
|
|
7
|
+
_instance: PaymentMethod | null;
|
|
8
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
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
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eftposPay/aggregatePayment/hooks/usePayment.ts
|
|
30
|
+
var usePayment_exports = {};
|
|
31
|
+
__export(usePayment_exports, {
|
|
32
|
+
usePayment: () => usePayment
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(usePayment_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_payment = __toESM(require("../utils/payment"));
|
|
37
|
+
var import_const = require("../../const");
|
|
38
|
+
var import_hooks = require("../../hooks");
|
|
39
|
+
var import_helper = require("../../helper");
|
|
40
|
+
var import_store = require("../../store");
|
|
41
|
+
var import_store2 = require("../../store");
|
|
42
|
+
var usePayment = (options) => {
|
|
43
|
+
const { custom, originalParams } = (0, import_store2.useContextData)();
|
|
44
|
+
const {
|
|
45
|
+
modeRef,
|
|
46
|
+
payRef,
|
|
47
|
+
orderIdRef,
|
|
48
|
+
eftposRef,
|
|
49
|
+
deviceRef,
|
|
50
|
+
dataRef,
|
|
51
|
+
amountRef
|
|
52
|
+
} = (0, import_hooks.useStoreRef)();
|
|
53
|
+
const paymentMethodRef = (0, import_react.useRef)(null);
|
|
54
|
+
const dispatch = (0, import_store.useDispatch)();
|
|
55
|
+
const uniquePaymentNumberRef = (0, import_react.useRef)(null);
|
|
56
|
+
const isPay = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay;
|
|
57
|
+
(0, import_react.useEffect)(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
if (!paymentMethodRef.current) {
|
|
60
|
+
if (!options.paymentNum) {
|
|
61
|
+
const paymentNum = (0, import_helper.getUuid)();
|
|
62
|
+
dispatch((0, import_store.updateState)({ number: paymentNum }));
|
|
63
|
+
options.paymentNum = paymentNum;
|
|
64
|
+
uniquePaymentNumberRef.current = paymentNum;
|
|
65
|
+
} else {
|
|
66
|
+
uniquePaymentNumberRef.current = options.paymentNum;
|
|
67
|
+
}
|
|
68
|
+
options.orderId = orderIdRef.current;
|
|
69
|
+
options.deviceId = (_a = deviceRef.current) == null ? void 0 : _a.id;
|
|
70
|
+
paymentMethodRef.current = new import_payment.default(options);
|
|
71
|
+
}
|
|
72
|
+
return () => {
|
|
73
|
+
var _a2, _b;
|
|
74
|
+
(_b = (_a2 = paymentMethodRef.current) == null ? void 0 : _a2.destroy) == null ? void 0 : _b.call(_a2);
|
|
75
|
+
paymentMethodRef.current = null;
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
78
|
+
const run = () => {
|
|
79
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
80
|
+
const params = {
|
|
81
|
+
order_id: orderIdRef.current,
|
|
82
|
+
unique_payment_number: uniquePaymentNumberRef.current,
|
|
83
|
+
payment_code: options.paymentCode,
|
|
84
|
+
amount: isPay ? (_a = payRef.current) == null ? void 0 : _a.total : amountRef.current,
|
|
85
|
+
operator_id: custom == null ? void 0 : custom.operator_id,
|
|
86
|
+
operator_type: custom == null ? void 0 : custom.operator_type,
|
|
87
|
+
platform: custom == null ? void 0 : custom.platform,
|
|
88
|
+
eftpos: {
|
|
89
|
+
card_reader_type: eftposRef.current,
|
|
90
|
+
card_reader_id: (_b = deviceRef.current) == null ? void 0 : _b.id,
|
|
91
|
+
pay_param_base64: encodeURIComponent(
|
|
92
|
+
btoa(
|
|
93
|
+
encodeURIComponent(
|
|
94
|
+
JSON.stringify({
|
|
95
|
+
...dataRef.current,
|
|
96
|
+
number: uniquePaymentNumberRef.current
|
|
97
|
+
})
|
|
98
|
+
)
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
if ((_c = options == null ? void 0 : options.config) == null ? void 0 : _c.requestDelaySeconds) {
|
|
104
|
+
params.delay_seconds = options.config.requestDelaySeconds;
|
|
105
|
+
}
|
|
106
|
+
if (isPay) {
|
|
107
|
+
params.payment = {
|
|
108
|
+
original_amount: (_d = payRef.current) == null ? void 0 : _d.amount,
|
|
109
|
+
order_payment_type: "normal",
|
|
110
|
+
// TODO: 需要使用方提供
|
|
111
|
+
custom_payment_id: custom == null ? void 0 : custom.custom_payment_id,
|
|
112
|
+
custom_payment_code: custom == null ? void 0 : custom.custom_payment_code,
|
|
113
|
+
custom_payment_name: custom == null ? void 0 : custom.custom_payment_name,
|
|
114
|
+
custom_payment_type: custom == null ? void 0 : custom.custom_payment_type,
|
|
115
|
+
service_charge: {
|
|
116
|
+
amount: (_e = payRef.current) == null ? void 0 : _e.surMoney,
|
|
117
|
+
percentage: (_f = payRef.current) == null ? void 0 : _f.surPercentRate
|
|
118
|
+
},
|
|
119
|
+
metadata: {
|
|
120
|
+
unique_payment_number: uniquePaymentNumberRef.current
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
(_g = paymentMethodRef.current) == null ? void 0 : _g.pay(params);
|
|
124
|
+
} else {
|
|
125
|
+
const refundPaymentContext = originalParams == null ? void 0 : originalParams.refund_payment_context;
|
|
126
|
+
if (refundPaymentContext) {
|
|
127
|
+
const payments = (_h = refundPaymentContext == null ? void 0 : refundPaymentContext.payments) == null ? void 0 : _h.map((payment) => {
|
|
128
|
+
return {
|
|
129
|
+
...payment,
|
|
130
|
+
metadata: {
|
|
131
|
+
...(payment == null ? void 0 : payment.metadata) || {},
|
|
132
|
+
unique_refund_number: uniquePaymentNumberRef.current
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
params.refund_payment_context = {
|
|
137
|
+
...refundPaymentContext || {},
|
|
138
|
+
payments
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
(_i = paymentMethodRef.current) == null ? void 0 : _i.refund(params);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const query = () => {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
if (isPay) {
|
|
147
|
+
(_a = paymentMethodRef.current) == null ? void 0 : _a.payQuery();
|
|
148
|
+
} else {
|
|
149
|
+
(_b = paymentMethodRef.current) == null ? void 0 : _b.refundQuery();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const action = (data, config) => {
|
|
153
|
+
var _a, _b;
|
|
154
|
+
const params = {
|
|
155
|
+
order_id: orderIdRef.current,
|
|
156
|
+
unique_payment_number: uniquePaymentNumberRef.current,
|
|
157
|
+
payment_code: options.paymentCode,
|
|
158
|
+
data
|
|
159
|
+
};
|
|
160
|
+
if (isPay) {
|
|
161
|
+
(_a = paymentMethodRef.current) == null ? void 0 : _a.payAction(params, config);
|
|
162
|
+
} else {
|
|
163
|
+
(_b = paymentMethodRef.current) == null ? void 0 : _b.refundAction(params, config);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return { run, query, action, _instance: paymentMethodRef.current };
|
|
167
|
+
};
|
|
168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
+
0 && (module.exports = {
|
|
170
|
+
usePayment
|
|
171
|
+
});
|
|
@@ -30,13 +30,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
var aggregatePayment_exports = {};
|
|
31
31
|
__export(aggregatePayment_exports, {
|
|
32
32
|
EActionStatus: () => import_types.EActionStatus,
|
|
33
|
-
useMicropay: () => import_useMicropay.default
|
|
33
|
+
useMicropay: () => import_useMicropay.default,
|
|
34
|
+
usePayment: () => import_usePayment.usePayment
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(aggregatePayment_exports);
|
|
36
37
|
var import_types = require("./types");
|
|
37
38
|
var import_useMicropay = __toESM(require("./hooks/useMicropay"));
|
|
39
|
+
var import_usePayment = require("./hooks/usePayment");
|
|
38
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
41
|
0 && (module.exports = {
|
|
40
42
|
EActionStatus,
|
|
41
|
-
useMicropay
|
|
43
|
+
useMicropay,
|
|
44
|
+
usePayment
|
|
42
45
|
});
|