@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
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
import { request } from "../../../utils";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 结算发起接口
|
|
11
|
+
*/
|
|
12
|
+
export var settlementApi = function settlementApi(data, config) {
|
|
13
|
+
// return new Promise((resolve, reject) => {
|
|
14
|
+
// setTimeout(() => {
|
|
15
|
+
// resolve({
|
|
16
|
+
// status: true,
|
|
17
|
+
// code: 200,
|
|
18
|
+
// message: '',
|
|
19
|
+
// data: {
|
|
20
|
+
// id: '6cb75d74-b238-4dbb-b03a-4e75fdacefbd',
|
|
21
|
+
// version: 1,
|
|
22
|
+
// status: 'PENDING',
|
|
23
|
+
// message: 'Waiting for terminal to accept settlement enquiry',
|
|
24
|
+
// merchant_receipt: null,
|
|
25
|
+
// pos_instructions: {
|
|
26
|
+
// auto_actions: null,
|
|
27
|
+
// action_form: {
|
|
28
|
+
// layout: null,
|
|
29
|
+
// properties: null,
|
|
30
|
+
// details: {
|
|
31
|
+
// 'Pairing ID': 'pid_eafc66cc-dd4f-450f-b31b-097d93e379d5',
|
|
32
|
+
// 'Settlement ID': '6cb75d74-b238-4dbb-b03a-4e75fdacefbd',
|
|
33
|
+
// 'Settlement Version': '1',
|
|
34
|
+
// TID: '3002200705',
|
|
35
|
+
// },
|
|
36
|
+
// },
|
|
37
|
+
// },
|
|
38
|
+
// },
|
|
39
|
+
// });
|
|
40
|
+
// }, 3000);
|
|
41
|
+
// });
|
|
42
|
+
return request.getRequest().post('/shop/pay/card-reader/settlement', data, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
43
|
+
customMessage: true,
|
|
44
|
+
fullResult: true
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 结算查询接口
|
|
50
|
+
*/
|
|
51
|
+
export var settlementQueryApi = function settlementQueryApi(id, data, config) {
|
|
52
|
+
// return new Promise((resolve, reject) => {
|
|
53
|
+
// setTimeout(() => {
|
|
54
|
+
// resolve({
|
|
55
|
+
// status: true,
|
|
56
|
+
// code: 200,
|
|
57
|
+
// message: '',
|
|
58
|
+
// data: {
|
|
59
|
+
// id: '6cb75d74-b238-4dbb-b03a-4e75fdacefbd',
|
|
60
|
+
// version: 3,
|
|
61
|
+
// status: 'FINALISED',
|
|
62
|
+
// message: '❌ (942) Settlement Not Available',
|
|
63
|
+
// merchant_receipt:
|
|
64
|
+
// '\r\n Gecko Bank\r\n \r\n\r\nterminal 3002200705\r\n\r\n SETTLEMENT ENQUIRY\r\n\r\nTID 3002200705\r\nMID 30022007\r\n\r\n\r\n (942)\r\n Settlement Not\r\n Available\r\n\r\n',
|
|
65
|
+
// pos_instructions: {
|
|
66
|
+
// auto_actions: null,
|
|
67
|
+
// action_form: {
|
|
68
|
+
// layout: [
|
|
69
|
+
// {
|
|
70
|
+
// type: 'horizontal_layout',
|
|
71
|
+
// elements: [
|
|
72
|
+
// {
|
|
73
|
+
// label: 'Done',
|
|
74
|
+
// key: 'settlement_complete',
|
|
75
|
+
// },
|
|
76
|
+
// {
|
|
77
|
+
// label: 'Retry',
|
|
78
|
+
// key: 'retry_settlement',
|
|
79
|
+
// },
|
|
80
|
+
// ],
|
|
81
|
+
// },
|
|
82
|
+
// ],
|
|
83
|
+
// properties: {
|
|
84
|
+
// retry_settlement: {
|
|
85
|
+
// type: 'button',
|
|
86
|
+
// submit_url: null,
|
|
87
|
+
// action: 'RETRY_SETTLEMENT',
|
|
88
|
+
// },
|
|
89
|
+
// settlement_complete: {
|
|
90
|
+
// type: 'button',
|
|
91
|
+
// submit_url: null,
|
|
92
|
+
// action: 'SETTLEMENT_COMPLETE',
|
|
93
|
+
// },
|
|
94
|
+
// },
|
|
95
|
+
// details: {
|
|
96
|
+
// 'Pairing ID': 'pid_eafc66cc-dd4f-450f-b31b-097d93e379d5',
|
|
97
|
+
// 'Settlement ID': '6cb75d74-b238-4dbb-b03a-4e75fdacefbd',
|
|
98
|
+
// 'Settlement Version': '3',
|
|
99
|
+
// TID: '3002200705',
|
|
100
|
+
// },
|
|
101
|
+
// },
|
|
102
|
+
// },
|
|
103
|
+
// },
|
|
104
|
+
// });
|
|
105
|
+
// }, 10000);
|
|
106
|
+
// });
|
|
107
|
+
// return new Promise((resolve, reject) => {
|
|
108
|
+
// setTimeout(() => {
|
|
109
|
+
// resolve({
|
|
110
|
+
// status: true,
|
|
111
|
+
// code: 200,
|
|
112
|
+
// message: '',
|
|
113
|
+
// data: {
|
|
114
|
+
// id: 'e625cdcd-4bc7-495e-b47d-4b8ff393a2d7',
|
|
115
|
+
// version: 3,
|
|
116
|
+
// status: 'FINALISED',
|
|
117
|
+
// message: '✅ (000) SETTLEMENT APPROVED',
|
|
118
|
+
// merchant_receipt:
|
|
119
|
+
// '\r\n Gecko Bank\r\n \r\n\r\nterminal 3002200705\r\n\r\n SETTLEMENT\r\n\r\nTID 3002200705\r\nMID 30022007\r\nFrom 17MAR26 18:16\r\nTo 17MAR26 18:16\r\n\r\nVISA\r\nTOT 0 $0.00\r\n\r\nMASTERCARD\r\nTOT 0 $0.00\r\n\r\nAMEX\r\nTOT 0 $0.00\r\n\r\n\r\n (000)\r\nSETTLEMENT APPROVED\r\n\r\n',
|
|
120
|
+
// pos_instructions: {
|
|
121
|
+
// auto_actions: null,
|
|
122
|
+
// action_form: {
|
|
123
|
+
// layout: [
|
|
124
|
+
// {
|
|
125
|
+
// type: 'horizontal_layout',
|
|
126
|
+
// elements: [
|
|
127
|
+
// {
|
|
128
|
+
// label: 'Print Merchant Receipt',
|
|
129
|
+
// key: 'print_merchant_receipt',
|
|
130
|
+
// },
|
|
131
|
+
// ],
|
|
132
|
+
// },
|
|
133
|
+
// {
|
|
134
|
+
// type: 'horizontal_layout',
|
|
135
|
+
// elements: [
|
|
136
|
+
// {
|
|
137
|
+
// label: 'Done',
|
|
138
|
+
// key: 'settlement_complete',
|
|
139
|
+
// },
|
|
140
|
+
// ],
|
|
141
|
+
// },
|
|
142
|
+
// ],
|
|
143
|
+
// properties: {
|
|
144
|
+
// print_merchant_receipt: {
|
|
145
|
+
// type: 'button',
|
|
146
|
+
// submit_url: null,
|
|
147
|
+
// action: 'PRINT_MERCHANT_RECEIPT',
|
|
148
|
+
// },
|
|
149
|
+
// settlement_complete: {
|
|
150
|
+
// type: 'button',
|
|
151
|
+
// submit_url: null,
|
|
152
|
+
// action: 'SETTLEMENT_COMPLETE',
|
|
153
|
+
// },
|
|
154
|
+
// },
|
|
155
|
+
// details: {
|
|
156
|
+
// 'Pairing ID': 'pid_469119fa-ee67-45ec-8843-3f1dc5cda6e1',
|
|
157
|
+
// 'Settlement ID': 'e625cdcd-4bc7-495e-b47d-4b8ff393a2d7',
|
|
158
|
+
// 'Settlement Version': '3',
|
|
159
|
+
// TID: '3002200705',
|
|
160
|
+
// },
|
|
161
|
+
// },
|
|
162
|
+
// },
|
|
163
|
+
// },
|
|
164
|
+
// });
|
|
165
|
+
// }, 10000);
|
|
166
|
+
// });
|
|
167
|
+
return request.getRequest().get("/shop/pay/card-reader/settlement/".concat(id), data, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
168
|
+
customMessage: true,
|
|
169
|
+
fullResult: true
|
|
170
|
+
}));
|
|
171
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 支付状态
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ESettlementStatus {
|
|
5
|
+
/** 结算中 */
|
|
6
|
+
Processing = "processing",
|
|
7
|
+
/** 结算成功 */
|
|
8
|
+
Success = "success",
|
|
9
|
+
/** 结算失败 */
|
|
10
|
+
Failed = "failed"
|
|
11
|
+
}
|
|
12
|
+
/** 元素类型定义 */
|
|
13
|
+
export interface ElementType {
|
|
14
|
+
label: string;
|
|
15
|
+
key: string;
|
|
16
|
+
}
|
|
17
|
+
/** 布局类型定义 */
|
|
18
|
+
export interface LayoutType {
|
|
19
|
+
type: string;
|
|
20
|
+
elements: ElementType[];
|
|
21
|
+
}
|
|
22
|
+
/** 元素属性定义 */
|
|
23
|
+
export interface ElementProperty {
|
|
24
|
+
type: 'button' | 'text' | 'image' | 'input';
|
|
25
|
+
submit_url: string;
|
|
26
|
+
action: string | null;
|
|
27
|
+
text?: string | null;
|
|
28
|
+
name?: string | null;
|
|
29
|
+
data?: string | null;
|
|
30
|
+
encoding?: string | null;
|
|
31
|
+
}
|
|
32
|
+
/** Action Form 定义 */
|
|
33
|
+
export interface ActionFormType {
|
|
34
|
+
layout: LayoutType[];
|
|
35
|
+
properties: {
|
|
36
|
+
[key: string]: ElementProperty;
|
|
37
|
+
};
|
|
38
|
+
details: {
|
|
39
|
+
[key: string]: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** POS 指令定义 */
|
|
43
|
+
export interface PosInstructions {
|
|
44
|
+
auto_actions: any;
|
|
45
|
+
action_form: ActionFormType | null;
|
|
46
|
+
}
|
|
47
|
+
/** MX51 参数定义 */
|
|
48
|
+
export interface MX51Params {
|
|
49
|
+
id: string;
|
|
50
|
+
version: number;
|
|
51
|
+
status: string;
|
|
52
|
+
message: string;
|
|
53
|
+
merchant_receipt: string | null;
|
|
54
|
+
customer_receipt: string | null;
|
|
55
|
+
result_amounts: any;
|
|
56
|
+
result_financial_status: string | null;
|
|
57
|
+
pos_instructions: PosInstructions | null;
|
|
58
|
+
}
|
|
59
|
+
/** 解析后的按钮配置 */
|
|
60
|
+
export interface ParsedElement {
|
|
61
|
+
/** 元素键 */
|
|
62
|
+
key: string;
|
|
63
|
+
/** 元素标签 */
|
|
64
|
+
label: string;
|
|
65
|
+
/** 提交URL */
|
|
66
|
+
submitUrl: string;
|
|
67
|
+
/** 按钮动作 */
|
|
68
|
+
action: string | null;
|
|
69
|
+
/** 元素类型 */
|
|
70
|
+
type: 'button' | 'text';
|
|
71
|
+
/** 文本信息 */
|
|
72
|
+
text?: string | null;
|
|
73
|
+
/** 小票信息 */
|
|
74
|
+
receipt?: string | null;
|
|
75
|
+
/** 额外信息 */
|
|
76
|
+
_extra?: {
|
|
77
|
+
/** 商户收据 */
|
|
78
|
+
merchantReceipt?: string | null;
|
|
79
|
+
/** 客户收据 */
|
|
80
|
+
customerReceipt?: string | null;
|
|
81
|
+
/** 结算状态 */
|
|
82
|
+
settlementStatus: ESettlementStatus;
|
|
83
|
+
/** 接口返回的原始数据 */
|
|
84
|
+
response: any;
|
|
85
|
+
};
|
|
86
|
+
/** 图片信息 */
|
|
87
|
+
image?: {
|
|
88
|
+
name?: string | null;
|
|
89
|
+
data?: string | null;
|
|
90
|
+
encoding?: string | null;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/** 解析后的布局配置 */
|
|
94
|
+
export interface ParsedLayout {
|
|
95
|
+
/** 布局类型,如 horizontal_layout */
|
|
96
|
+
layoutType: string;
|
|
97
|
+
/** 该布局中的按钮列表 */
|
|
98
|
+
elements: ParsedElement[];
|
|
99
|
+
}
|
|
100
|
+
/** 解析后的结果 */
|
|
101
|
+
export interface ParsedMX51Result {
|
|
102
|
+
/** 交易ID */
|
|
103
|
+
transactionId: string;
|
|
104
|
+
/** 版本号 */
|
|
105
|
+
version: number;
|
|
106
|
+
/** 状态 */
|
|
107
|
+
status: string;
|
|
108
|
+
/** 提示信息 */
|
|
109
|
+
message: string;
|
|
110
|
+
/** 商户收据 */
|
|
111
|
+
merchantReceipt: string | null;
|
|
112
|
+
/** 客户收据 */
|
|
113
|
+
customerReceipt: string | null;
|
|
114
|
+
/** 结果金额 */
|
|
115
|
+
resultAmounts: any;
|
|
116
|
+
/** 结果财务状态 */
|
|
117
|
+
resultFinancialStatus: string | null;
|
|
118
|
+
/** 布局列表,每个布局包含其类型和按钮 */
|
|
119
|
+
layouts: ParsedLayout[];
|
|
120
|
+
/** 详情信息 */
|
|
121
|
+
details: {
|
|
122
|
+
[key: string]: string;
|
|
123
|
+
};
|
|
124
|
+
/** 详情信息 text */
|
|
125
|
+
detailsText: string;
|
|
126
|
+
/** 自动操作 */
|
|
127
|
+
autoAction: Array<string> | null;
|
|
128
|
+
}
|
|
129
|
+
export declare enum EButtonKeyType {
|
|
130
|
+
/** 打印客户收据 */
|
|
131
|
+
PrintCustomerReceipt = "print_customer_receipt",
|
|
132
|
+
/** 打印商户收据 */
|
|
133
|
+
PrintMerchantReceipt = "print_merchant_receipt",
|
|
134
|
+
/** 结算完成 */
|
|
135
|
+
SettlementComplete = "settlement_complete",
|
|
136
|
+
/** 重试结算 */
|
|
137
|
+
RetrySettlement = "retry_settlement"
|
|
138
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 支付状态
|
|
3
|
+
*/
|
|
4
|
+
export var ESettlementStatus = /*#__PURE__*/function (ESettlementStatus) {
|
|
5
|
+
ESettlementStatus["Processing"] = "processing";
|
|
6
|
+
ESettlementStatus["Success"] = "success";
|
|
7
|
+
ESettlementStatus["Failed"] = "failed";
|
|
8
|
+
return ESettlementStatus;
|
|
9
|
+
}({});
|
|
10
|
+
|
|
11
|
+
/** 元素类型定义 */
|
|
12
|
+
|
|
13
|
+
/** 布局类型定义 */
|
|
14
|
+
|
|
15
|
+
/** 元素属性定义 */
|
|
16
|
+
|
|
17
|
+
/** Action Form 定义 */
|
|
18
|
+
|
|
19
|
+
/** POS 指令定义 */
|
|
20
|
+
|
|
21
|
+
/** MX51 参数定义 */
|
|
22
|
+
|
|
23
|
+
/** 解析后的按钮配置 */
|
|
24
|
+
|
|
25
|
+
/** 解析后的布局配置 */
|
|
26
|
+
|
|
27
|
+
/** 解析后的结果 */
|
|
28
|
+
|
|
29
|
+
export var EButtonKeyType = /*#__PURE__*/function (EButtonKeyType) {
|
|
30
|
+
EButtonKeyType["PrintCustomerReceipt"] = "print_customer_receipt";
|
|
31
|
+
EButtonKeyType["PrintMerchantReceipt"] = "print_merchant_receipt";
|
|
32
|
+
EButtonKeyType["SettlementComplete"] = "settlement_complete";
|
|
33
|
+
EButtonKeyType["RetrySettlement"] = "retry_settlement";
|
|
34
|
+
return EButtonKeyType;
|
|
35
|
+
}({});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type MX51Params, type ParsedMX51Result, ESettlementStatus } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 解析MX51参数
|
|
4
|
+
* @param params 接口返回的原始参数
|
|
5
|
+
* @param status 支付状态
|
|
6
|
+
* @param data 接口返回的数据
|
|
7
|
+
* @returns 解析后的结果对象
|
|
8
|
+
*/
|
|
9
|
+
export declare const parseMX51Params: (params: MX51Params, settlementStatus: ESettlementStatus, data: any) => ParsedMX51Result | null;
|
|
10
|
+
/**
|
|
11
|
+
* 结算查询
|
|
12
|
+
* @description 首先调用结算发起接口,然后调用结算查询接口
|
|
13
|
+
* 1. 首先调用结算发起接口,接口调用成功后调用结算查询接口,并设置 2min 的超时
|
|
14
|
+
* 2. 结算查询接口默认有 30s 超时,超时后取消本次请求并继续轮询
|
|
15
|
+
* 3. 如果结算查询接口返回 code === 200 && status === 'FINALISED',则返回成功
|
|
16
|
+
* 4. 其他任何情况只要总超时未到,都继续轮询
|
|
17
|
+
*/
|
|
18
|
+
export declare const settlementQuery: (params: any, callback: (status: ESettlementStatus, res: any) => void) => Promise<any>;
|