@pisell/pisellos 2.1.3 → 2.1.5
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/dist/core/index.js +2 -1
- package/dist/effects/index.d.ts +4 -3
- package/dist/effects/index.js +15 -6
- package/dist/modules/AccountList/index.d.ts +7 -1
- package/dist/modules/AccountList/index.js +81 -14
- package/dist/modules/AccountList/types.d.ts +28 -0
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/Cart/index.js +1 -1
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +122 -0
- package/dist/modules/Customer/index.js +697 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/Date/index.d.ts +17 -0
- package/dist/modules/Date/index.js +92 -4
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +25 -1
- package/dist/modules/Order/index.js +224 -2
- package/dist/modules/Order/types.d.ts +45 -0
- package/dist/modules/Order/types.js +8 -0
- package/dist/modules/Payment/cash.d.ts +19 -0
- package/dist/modules/Payment/cash.js +97 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
- package/dist/modules/Payment/eftpos.d.ts +11 -0
- package/dist/modules/Payment/eftpos.js +80 -0
- package/dist/modules/Payment/index.d.ts +184 -9
- package/dist/modules/Payment/index.js +2012 -108
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/types.d.ts +750 -30
- package/dist/modules/Payment/types.js +236 -12
- package/dist/modules/Payment/utils.d.ts +17 -0
- package/dist/modules/Payment/utils.js +62 -0
- package/dist/modules/Payment/walletpass.d.ts +99 -0
- package/dist/modules/Payment/walletpass.js +701 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.d.ts +12 -1
- package/dist/modules/ProductList/index.js +27 -3
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +39 -17
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +9 -0
- package/dist/modules/Schedule/index.js +68 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/app-types/app/app.d.ts +83 -0
- package/dist/plugins/app-types/app/const.d.ts +4 -0
- package/dist/plugins/app-types/app/index.d.ts +14 -0
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/dist/plugins/app-types/config.d.ts +3 -0
- package/dist/plugins/app-types/cookie/index.d.ts +13 -0
- package/dist/plugins/app-types/data/index.d.ts +8 -0
- package/dist/plugins/app-types/history/config.d.ts +24 -0
- package/dist/plugins/app-types/history/index.d.ts +20 -0
- package/dist/plugins/app-types/history/type.d.ts +2 -0
- package/dist/plugins/app-types/hooks/index.d.ts +12 -0
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/dist/plugins/app-types/index.d.ts +6 -0
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
- package/dist/plugins/app-types/locales/en.d.ts +3 -0
- package/dist/plugins/app-types/locales/index.d.ts +37 -0
- package/dist/plugins/app-types/locales/original.d.ts +3 -0
- package/dist/plugins/app-types/locales/type.d.ts +19 -0
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
- package/dist/plugins/app-types/logger/index.d.ts +122 -0
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
- package/dist/plugins/app-types/models/global.d.ts +32 -0
- package/dist/plugins/app-types/models/index.d.ts +45 -0
- package/dist/plugins/app-types/models/type.d.ts +2 -0
- package/dist/plugins/app-types/package.json +15 -0
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
- package/dist/plugins/app-types/request/cache.d.ts +46 -0
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/dist/plugins/app-types/request/config.d.ts +3 -0
- package/dist/plugins/app-types/request/constants.d.ts +2 -0
- package/dist/plugins/app-types/request/index.d.ts +24 -0
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/dist/plugins/app-types/request/type.d.ts +41 -0
- package/dist/plugins/app-types/request/utils.d.ts +46 -0
- package/dist/plugins/app-types/routes/config.d.ts +7 -0
- package/dist/plugins/app-types/routes/index.d.ts +28 -0
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
- package/dist/plugins/app-types/socket/constants.d.ts +33 -0
- package/dist/plugins/app-types/socket/events.d.ts +31 -0
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/dist/plugins/app-types/socket/index.d.ts +61 -0
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/dist/plugins/app-types/socket/socket.d.ts +129 -0
- package/dist/plugins/app-types/socket/types.d.ts +85 -0
- package/dist/plugins/app-types/storage/index.d.ts +17 -0
- package/dist/plugins/app-types/tasks/index.d.ts +77 -0
- package/dist/plugins/app-types/tasks/type.d.ts +62 -0
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/dist/plugins/app-types/type.d.ts +2 -0
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/dist/plugins/app-types/variables/config.d.ts +3 -0
- package/dist/plugins/app-types/variables/index.d.ts +6 -0
- package/dist/plugins/app-types/variables/type.d.ts +2 -0
- package/dist/plugins/app-types/website/index.d.ts +6 -0
- package/dist/plugins/app.d.ts +8 -0
- package/dist/plugins/app.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +1 -1
- package/dist/solution/BookingTicket/index.d.ts +180 -0
- package/dist/solution/BookingTicket/index.js +689 -0
- package/dist/solution/BookingTicket/types.d.ts +68 -0
- package/dist/solution/BookingTicket/types.js +43 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +509 -0
- package/dist/solution/Checkout/index.js +4874 -0
- package/dist/solution/Checkout/types.d.ts +923 -0
- package/dist/solution/Checkout/types.js +148 -0
- package/dist/solution/Checkout/utils/index.d.ts +117 -0
- package/dist/solution/Checkout/utils/index.js +549 -0
- package/dist/solution/ShopDiscount/index.d.ts +4 -9
- package/dist/solution/ShopDiscount/index.js +106 -54
- package/dist/solution/ShopDiscount/types.d.ts +10 -1
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/task.js +171 -0
- package/dist/utils/watch.d.ts +102 -0
- package/dist/utils/watch.js +294 -0
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +4 -3
- package/lib/effects/index.js +4 -1
- package/lib/modules/AccountList/index.d.ts +7 -1
- package/lib/modules/AccountList/index.js +27 -0
- package/lib/modules/AccountList/types.d.ts +28 -0
- package/lib/modules/Cart/index.js +1 -1
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +122 -0
- package/lib/modules/Customer/index.js +440 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/Date/index.d.ts +17 -0
- package/lib/modules/Date/index.js +64 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +25 -1
- package/lib/modules/Order/index.js +182 -0
- package/lib/modules/Order/types.d.ts +45 -0
- package/lib/modules/Payment/cash.d.ts +19 -0
- package/lib/modules/Payment/cash.js +64 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
- package/lib/modules/Payment/eftpos.d.ts +11 -0
- package/lib/modules/Payment/eftpos.js +51 -0
- package/lib/modules/Payment/index.d.ts +184 -9
- package/lib/modules/Payment/index.js +1044 -50
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/types.d.ts +750 -30
- package/lib/modules/Payment/types.js +79 -6
- package/lib/modules/Payment/utils.d.ts +17 -0
- package/lib/modules/Payment/utils.js +67 -0
- package/lib/modules/Payment/walletpass.d.ts +99 -0
- package/lib/modules/Payment/walletpass.js +468 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.d.ts +12 -1
- package/lib/modules/ProductList/index.js +29 -2
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +32 -15
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +9 -0
- package/lib/modules/Schedule/index.js +51 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/app-types/app/app.d.ts +83 -0
- package/lib/plugins/app-types/app/const.d.ts +4 -0
- package/lib/plugins/app-types/app/index.d.ts +14 -0
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/lib/plugins/app-types/config.d.ts +3 -0
- package/lib/plugins/app-types/cookie/index.d.ts +13 -0
- package/lib/plugins/app-types/data/index.d.ts +8 -0
- package/lib/plugins/app-types/history/config.d.ts +24 -0
- package/lib/plugins/app-types/history/index.d.ts +20 -0
- package/lib/plugins/app-types/history/type.d.ts +2 -0
- package/lib/plugins/app-types/hooks/index.d.ts +12 -0
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/lib/plugins/app-types/index.d.ts +6 -0
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
- package/lib/plugins/app-types/locales/en.d.ts +3 -0
- package/lib/plugins/app-types/locales/index.d.ts +37 -0
- package/lib/plugins/app-types/locales/original.d.ts +3 -0
- package/lib/plugins/app-types/locales/type.d.ts +19 -0
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
- package/lib/plugins/app-types/logger/index.d.ts +122 -0
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
- package/lib/plugins/app-types/models/global.d.ts +32 -0
- package/lib/plugins/app-types/models/index.d.ts +45 -0
- package/lib/plugins/app-types/models/type.d.ts +2 -0
- package/lib/plugins/app-types/package.json +15 -0
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
- package/lib/plugins/app-types/request/cache.d.ts +46 -0
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/lib/plugins/app-types/request/config.d.ts +3 -0
- package/lib/plugins/app-types/request/constants.d.ts +2 -0
- package/lib/plugins/app-types/request/index.d.ts +24 -0
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/lib/plugins/app-types/request/type.d.ts +41 -0
- package/lib/plugins/app-types/request/utils.d.ts +46 -0
- package/lib/plugins/app-types/routes/config.d.ts +7 -0
- package/lib/plugins/app-types/routes/index.d.ts +28 -0
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
- package/lib/plugins/app-types/socket/constants.d.ts +33 -0
- package/lib/plugins/app-types/socket/events.d.ts +31 -0
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/lib/plugins/app-types/socket/index.d.ts +61 -0
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/lib/plugins/app-types/socket/socket.d.ts +129 -0
- package/lib/plugins/app-types/socket/types.d.ts +85 -0
- package/lib/plugins/app-types/storage/index.d.ts +17 -0
- package/lib/plugins/app-types/tasks/index.d.ts +77 -0
- package/lib/plugins/app-types/tasks/type.d.ts +62 -0
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/lib/plugins/app-types/type.d.ts +2 -0
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/lib/plugins/app-types/variables/config.d.ts +3 -0
- package/lib/plugins/app-types/variables/index.d.ts +6 -0
- package/lib/plugins/app-types/variables/type.d.ts +2 -0
- package/lib/plugins/app-types/website/index.d.ts +6 -0
- package/lib/plugins/app.d.ts +8 -0
- package/lib/plugins/app.js +17 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1 -2
- package/lib/solution/BookingTicket/index.d.ts +180 -0
- package/lib/solution/BookingTicket/index.js +420 -0
- package/lib/solution/BookingTicket/types.d.ts +68 -0
- package/lib/solution/BookingTicket/types.js +72 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +509 -0
- package/lib/solution/Checkout/index.js +3002 -0
- package/lib/solution/Checkout/types.d.ts +923 -0
- package/lib/solution/Checkout/types.js +87 -0
- package/lib/solution/Checkout/utils/index.d.ts +117 -0
- package/lib/solution/Checkout/utils/index.js +403 -0
- package/lib/solution/ShopDiscount/index.d.ts +4 -9
- package/lib/solution/ShopDiscount/index.js +41 -13
- package/lib/solution/ShopDiscount/types.d.ts +10 -1
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/task.js +109 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +4 -2
|
@@ -1,33 +1,257 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 支付相关类型定义
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 支付方式枚举
|
|
7
|
+
*/
|
|
8
|
+
export var PaymentMethodType = /*#__PURE__*/function (PaymentMethodType) {
|
|
9
|
+
PaymentMethodType["Cash"] = "CASHMANUAL";
|
|
10
|
+
PaymentMethodType["Eftpos"] = "EFTPOS";
|
|
11
|
+
PaymentMethodType["Wallet"] = "WALLET";
|
|
12
|
+
return PaymentMethodType;
|
|
13
|
+
}({});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 支付状态枚举
|
|
17
|
+
*/
|
|
18
|
+
export var PaymentStatus = /*#__PURE__*/function (PaymentStatus) {
|
|
19
|
+
PaymentStatus["Processing"] = "payment_processing";
|
|
20
|
+
PaymentStatus["Sync"] = "sync";
|
|
21
|
+
PaymentStatus["PartiallyPaid"] = "partially_paid";
|
|
22
|
+
PaymentStatus["Finished"] = "finish";
|
|
23
|
+
return PaymentStatus;
|
|
24
|
+
}({});
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 任务状态枚举
|
|
28
|
+
*/
|
|
29
|
+
export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
|
|
30
|
+
TaskRunStatus["Pending"] = "pending";
|
|
31
|
+
TaskRunStatus["Running"] = "running";
|
|
32
|
+
TaskRunStatus["Success"] = "success";
|
|
33
|
+
TaskRunStatus["Failed"] = "failed";
|
|
34
|
+
return TaskRunStatus;
|
|
35
|
+
}({});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 舍入规则枚举
|
|
39
|
+
*/
|
|
40
|
+
export var RoundingRule = /*#__PURE__*/function (RoundingRule) {
|
|
41
|
+
RoundingRule["Standard"] = "standard_rounding";
|
|
42
|
+
RoundingRule["StandardDown"] = "standard_down";
|
|
43
|
+
RoundingRule["AlwaysUp"] = "always_up";
|
|
44
|
+
RoundingRule["AlwaysDown"] = "always_down";
|
|
45
|
+
return RoundingRule;
|
|
46
|
+
}({});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 舍入结果
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 舍入间隔枚举
|
|
54
|
+
*/
|
|
55
|
+
export var RoundingInterval = /*#__PURE__*/function (RoundingInterval) {
|
|
56
|
+
RoundingInterval[RoundingInterval["Interval005"] = 0.05] = "Interval005";
|
|
57
|
+
RoundingInterval[RoundingInterval["Interval01"] = 0.1] = "Interval01";
|
|
58
|
+
RoundingInterval[RoundingInterval["Interval05"] = 0.5] = "Interval05";
|
|
59
|
+
RoundingInterval[RoundingInterval["Interval1"] = 1] = "Interval1";
|
|
60
|
+
return RoundingInterval;
|
|
61
|
+
}({});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 支付方式信息
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 支付项
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 订单信息
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 支付订单(简化版,仅保留支付相关信息)
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* 支付状态
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 推送订单参数(简化版)
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* 更新订单参数
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 支付项输入类型(允许 amount 为数字)
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 推送支付项参数
|
|
97
|
+
*/
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 更新支付项参数中的字段类型(允许 amount 为数字)
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 更新支付项参数
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 删除支付项参数
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 现金支付接口
|
|
113
|
+
*/
|
|
2
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Eftpos支付接口
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 钱包支付接口
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 支付模块API接口
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 订单变化事件数据
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 支付方式变化事件数据
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 支付同步错误事件数据
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 支付同步成功事件数据
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 钱包推荐列表更新事件数据
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 用户识别码列表更新事件数据
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 钱包缓存清除事件数据
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 搜索识别码完成事件数据
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 钱包初始化开始事件数据
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 钱包初始化完成事件数据
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 钱包初始化失败事件数据
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 钱包支付事件枚举
|
|
173
|
+
*/
|
|
174
|
+
export var WalletPassHooks = /*#__PURE__*/function (WalletPassHooks) {
|
|
175
|
+
WalletPassHooks["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
|
|
176
|
+
WalletPassHooks["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
|
|
177
|
+
WalletPassHooks["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
|
|
178
|
+
WalletPassHooks["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
|
|
179
|
+
WalletPassHooks["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
|
|
180
|
+
WalletPassHooks["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
|
|
181
|
+
WalletPassHooks["OnWalletInitializationStarted"] = "wallet:onWalletInitializationStarted";
|
|
182
|
+
WalletPassHooks["OnWalletInitializationCompleted"] = "wallet:onWalletInitializationCompleted";
|
|
183
|
+
WalletPassHooks["OnWalletInitializationFailed"] = "wallet:onWalletInitializationFailed";
|
|
184
|
+
return WalletPassHooks;
|
|
185
|
+
}({});
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 支付钩子事件(统一接口)
|
|
189
|
+
*/
|
|
3
190
|
export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
|
|
4
|
-
PaymentHooks["
|
|
5
|
-
PaymentHooks["
|
|
6
|
-
PaymentHooks["
|
|
7
|
-
PaymentHooks["
|
|
191
|
+
PaymentHooks["OnPaymentMethodsLoaded"] = "payment:onPaymentMethodsLoaded";
|
|
192
|
+
PaymentHooks["OnPaymentMethodsChanged"] = "payment:onPaymentMethodsChanged";
|
|
193
|
+
PaymentHooks["OnOrderChanged"] = "payment:onOrderChanged";
|
|
194
|
+
PaymentHooks["OnOrderAdded"] = "payment:onOrderAdded";
|
|
195
|
+
PaymentHooks["OnOrderUpdated"] = "payment:onOrderUpdated";
|
|
196
|
+
PaymentHooks["OnOrderDeleted"] = "payment:onOrderDeleted";
|
|
197
|
+
PaymentHooks["OnPaymentAdded"] = "payment:onPaymentAdded";
|
|
198
|
+
PaymentHooks["OnPaymentUpdated"] = "payment:onPaymentUpdated";
|
|
199
|
+
PaymentHooks["OnPaymentDeleted"] = "payment:onPaymentDeleted";
|
|
200
|
+
PaymentHooks["OnPaymentSubmitted"] = "payment:onPaymentSubmitted";
|
|
201
|
+
PaymentHooks["OnOrderAmountChanged"] = "payment:onOrderAmountChanged";
|
|
202
|
+
PaymentHooks["OnPaymentSyncError"] = "payment:onPaymentSyncError";
|
|
203
|
+
PaymentHooks["OnPaymentSyncSuccess"] = "payment:onPaymentSyncSuccess";
|
|
204
|
+
PaymentHooks["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
|
|
205
|
+
PaymentHooks["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
|
|
206
|
+
PaymentHooks["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
|
|
207
|
+
PaymentHooks["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
|
|
208
|
+
PaymentHooks["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
|
|
209
|
+
PaymentHooks["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
|
|
8
210
|
return PaymentHooks;
|
|
9
211
|
}({});
|
|
10
212
|
|
|
11
213
|
/**
|
|
12
|
-
*
|
|
214
|
+
* 钱包推荐扣款请求参数
|
|
215
|
+
*/
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* 钱包初始化业务数据接口
|
|
219
|
+
* 用于生成钱包API参数的必要业务信息
|
|
220
|
+
*/
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* 查询用户识别码列表请求参数
|
|
13
224
|
*/
|
|
14
225
|
|
|
15
|
-
|
|
226
|
+
/**
|
|
227
|
+
* 钱包推荐扣款响应数据
|
|
228
|
+
*/
|
|
16
229
|
|
|
17
230
|
/**
|
|
18
|
-
*
|
|
231
|
+
* 用户识别码列表响应数据
|
|
19
232
|
*/
|
|
20
233
|
|
|
21
|
-
|
|
234
|
+
/**
|
|
235
|
+
* 用户识别码项目
|
|
236
|
+
*/
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* 搜索识别码请求参数
|
|
240
|
+
* 基于 WalletDeductionRecommendParams 并增加 code 字段
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* 搜索识别码响应数据
|
|
245
|
+
*/
|
|
22
246
|
|
|
23
247
|
/**
|
|
24
|
-
*
|
|
248
|
+
* 搜索识别码结果类型
|
|
25
249
|
*/
|
|
26
250
|
|
|
27
251
|
/**
|
|
28
|
-
*
|
|
252
|
+
* 搜索识别码项目
|
|
29
253
|
*/
|
|
30
254
|
|
|
31
255
|
/**
|
|
32
|
-
*
|
|
256
|
+
* 钱包推荐项目
|
|
33
257
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const getAvailableMaxAmount: (data: Record<string, any>) => any;
|
|
2
|
+
/**
|
|
3
|
+
* 将walletPass列表数据转换为prepare_payments需要的数据格式
|
|
4
|
+
* @param list
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
|
|
7
|
+
voucher_id: any;
|
|
8
|
+
amount: number;
|
|
9
|
+
tag: any;
|
|
10
|
+
}[];
|
|
11
|
+
/**
|
|
12
|
+
* 对用户识别码列表进行排序
|
|
13
|
+
* 排序规则:正常数据 -> unified_available_status===1 -> 500601/500602 -> unified_available_status===0
|
|
14
|
+
* @param list 用户识别码列表
|
|
15
|
+
* @returns 排序后的列表
|
|
16
|
+
*/
|
|
17
|
+
export declare const sortUserIdentificationCodeList: (list: any[]) => any[];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// 获取walletPass可用最大金额
|
|
2
|
+
export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
|
|
3
|
+
return data.tag !== 'point_card' ? data.available_max_amount : data === null || data === void 0 ? void 0 : data.recommended_usage_amount;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 将walletPass列表数据转换为prepare_payments需要的数据格式
|
|
8
|
+
* @param list
|
|
9
|
+
*/
|
|
10
|
+
export var formatWalletPassList2PreparePayments = function formatWalletPassList2PreparePayments(list) {
|
|
11
|
+
return (list || []).map(function (item) {
|
|
12
|
+
return {
|
|
13
|
+
voucher_id: item.id || 0,
|
|
14
|
+
amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
|
|
15
|
+
tag: item.tag || ''
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 对用户识别码列表进行排序
|
|
22
|
+
* 排序规则:正常数据 -> unified_available_status===1 -> 500601/500602 -> unified_available_status===0
|
|
23
|
+
* @param list 用户识别码列表
|
|
24
|
+
* @returns 排序后的列表
|
|
25
|
+
*/
|
|
26
|
+
export var sortUserIdentificationCodeList = function sortUserIdentificationCodeList(list) {
|
|
27
|
+
if (!Array.isArray(list) || list.length === 0) {
|
|
28
|
+
return list;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 定义中等优先级错误码
|
|
32
|
+
var middlePriorityErrorCodes = ['500601', '500602'];
|
|
33
|
+
return list.sort(function (a, b) {
|
|
34
|
+
// 确定每个项目的优先级
|
|
35
|
+
// 0: 正常数据(没有特定错误码且available_status不是1或0)
|
|
36
|
+
// 1: unified_available_status === 1
|
|
37
|
+
// 2: 中等优先级错误码(500601、500602) 此订单内不可用 订单没有剩余金额
|
|
38
|
+
// 3: unified_available_status === 0(最后)
|
|
39
|
+
var getPriority = function getPriority(item) {
|
|
40
|
+
var _item$unified_error_c;
|
|
41
|
+
var errorCode = (_item$unified_error_c = item.unified_error_code) === null || _item$unified_error_c === void 0 ? void 0 : _item$unified_error_c.toString();
|
|
42
|
+
var availableStatus = item.unified_available_status;
|
|
43
|
+
|
|
44
|
+
// 中等优先级错误码
|
|
45
|
+
if (errorCode && middlePriorityErrorCodes.includes(errorCode)) return 2;
|
|
46
|
+
|
|
47
|
+
// unified_available_status === 0 最后
|
|
48
|
+
if (availableStatus === 0) return 3;
|
|
49
|
+
|
|
50
|
+
// unified_available_status === 1
|
|
51
|
+
if (availableStatus === 1) return 1;
|
|
52
|
+
|
|
53
|
+
// 正常数据
|
|
54
|
+
return 0;
|
|
55
|
+
};
|
|
56
|
+
var aPriority = getPriority(a);
|
|
57
|
+
var bPriority = getPriority(b);
|
|
58
|
+
|
|
59
|
+
// 按优先级排序,优先级相同则保持原有顺序
|
|
60
|
+
return aPriority - bPriority;
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { WalletPassPayment, WalletDeductionRecommendParams, WalletRecommendItem, UserIdentificationCodeParams, UserIdentificationCodeItem, SearchIdentificationCodeParams, SearchIdentificationCodeItem, SearchIdentificationCodeResult, WalletInitBusinessData } from './types';
|
|
2
|
+
import type { PaymentModule } from './index';
|
|
3
|
+
/**
|
|
4
|
+
* 钱包支付实现
|
|
5
|
+
*/
|
|
6
|
+
export declare class WalletPassPaymentImpl implements WalletPassPayment {
|
|
7
|
+
private paymentModule;
|
|
8
|
+
private walletRecommendList;
|
|
9
|
+
private userIdentificationCodes;
|
|
10
|
+
private searchResults;
|
|
11
|
+
private walletParams;
|
|
12
|
+
constructor(paymentModule: PaymentModule);
|
|
13
|
+
/**
|
|
14
|
+
* 发送事件的辅助方法
|
|
15
|
+
* 支持使用WalletPassHooks或PaymentHooks
|
|
16
|
+
*/
|
|
17
|
+
private emitEvent;
|
|
18
|
+
/**
|
|
19
|
+
* 生成钱包API默认参数
|
|
20
|
+
* 根据业务数据生成标准的钱包API参数,并存储在模块中
|
|
21
|
+
*/
|
|
22
|
+
generateWalletParams(businessData: WalletInitBusinessData): WalletDeductionRecommendParams;
|
|
23
|
+
/**
|
|
24
|
+
* 获取已存储的钱包参数
|
|
25
|
+
* 返回之前生成并存储的钱包参数
|
|
26
|
+
*/
|
|
27
|
+
getStoredWalletParams(): WalletDeductionRecommendParams | null;
|
|
28
|
+
/**
|
|
29
|
+
* 清理已存储的钱包参数
|
|
30
|
+
* 清除之前存储的钱包参数
|
|
31
|
+
*/
|
|
32
|
+
clearStoredWalletParams(): void;
|
|
33
|
+
/**
|
|
34
|
+
* 从业务数据初始化钱包数据
|
|
35
|
+
* 内部生成参数,然后调用标准的初始化流程
|
|
36
|
+
*/
|
|
37
|
+
initializeWalletDataFromBusinessAsync(businessData: WalletInitBusinessData): Promise<{
|
|
38
|
+
walletRecommendList: WalletRecommendItem[];
|
|
39
|
+
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* 初始化钱包数据
|
|
43
|
+
* 先获取推荐列表,再获取用户识别码列表(顺序执行)
|
|
44
|
+
*/
|
|
45
|
+
initializeWalletDataAsync(baseParams: WalletDeductionRecommendParams): Promise<{
|
|
46
|
+
walletRecommendList: WalletRecommendItem[];
|
|
47
|
+
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
48
|
+
}>;
|
|
49
|
+
getWalletPassRecommendListAsync(params: WalletDeductionRecommendParams): Promise<WalletRecommendItem[]>;
|
|
50
|
+
formatWalletPassList2PreparePayments(list: WalletRecommendItem[]): {
|
|
51
|
+
voucher_id: number;
|
|
52
|
+
amount: number;
|
|
53
|
+
tag: string;
|
|
54
|
+
}[];
|
|
55
|
+
getUserIdentificationCodeListAsync(params: UserIdentificationCodeParams): Promise<UserIdentificationCodeItem[]>;
|
|
56
|
+
/**
|
|
57
|
+
* 搜索识别码信息
|
|
58
|
+
* 通过识别码搜索相关的钱包通行证信息
|
|
59
|
+
* 基于 WalletDeductionRecommendParams 参数结构
|
|
60
|
+
* 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
|
|
61
|
+
*/
|
|
62
|
+
searchIdentificationCodeAsync(params: SearchIdentificationCodeParams, config?: {
|
|
63
|
+
noCache?: boolean;
|
|
64
|
+
}): Promise<SearchIdentificationCodeResult>;
|
|
65
|
+
processWalletPayment(amount: number, orderUuid: string, voucherId?: string): Promise<void>;
|
|
66
|
+
getWalletBalance(voucherId: string): Promise<number>;
|
|
67
|
+
/**
|
|
68
|
+
* 获取缓存的钱包推荐列表
|
|
69
|
+
*/
|
|
70
|
+
getWalletRecommendList(): WalletRecommendItem[];
|
|
71
|
+
/**
|
|
72
|
+
* 获取缓存的用户识别码列表
|
|
73
|
+
*/
|
|
74
|
+
getUserIdentificationCodes(): UserIdentificationCodeItem[];
|
|
75
|
+
/**
|
|
76
|
+
* 清除钱包推荐列表
|
|
77
|
+
*/
|
|
78
|
+
clearWalletRecommendList(): void;
|
|
79
|
+
/**
|
|
80
|
+
* 清除用户识别码列表
|
|
81
|
+
*/
|
|
82
|
+
clearUserIdentificationCodes(): void;
|
|
83
|
+
/**
|
|
84
|
+
* 获取缓存的搜索结果列表
|
|
85
|
+
*/
|
|
86
|
+
getSearchResults(): SearchIdentificationCodeItem[];
|
|
87
|
+
/**
|
|
88
|
+
* 根据识别码查找搜索结果
|
|
89
|
+
*/
|
|
90
|
+
findSearchResultByCode(code: string): SearchIdentificationCodeItem | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* 清除搜索结果缓存
|
|
93
|
+
*/
|
|
94
|
+
clearSearchResults(): void;
|
|
95
|
+
/**
|
|
96
|
+
* 清除所有缓存数据
|
|
97
|
+
*/
|
|
98
|
+
clearAllCache(): void;
|
|
99
|
+
}
|