@pisell/private-materials 3.3.98 → 3.3.99
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 +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/Sales/Cart/index.d.ts +53 -0
- package/es/components/Sales/Cart/index.js +1 -5
- package/es/components/Sales/Cart/utils.d.ts +23 -0
- package/es/components/Sales/Cart/utils.js +0 -167
- package/es/components/Sales/Checkout/index.d.ts +33 -0
- package/es/components/Sales/Checkout/index.js +8 -52
- package/es/components/Sales/Checkout/serve.d.ts +2 -0
- package/es/components/Sales/Checkout/serve.js +2 -16
- package/es/components/Sales/Checkout/utils.d.ts +35 -0
- package/es/components/Sales/Checkout/utils.js +1 -7
- package/es/components/Sales/Summary/index.d.ts +25 -0
- package/es/components/Sales/Summary/index.js +2 -17
- package/es/components/Sales/Summary/serve.d.ts +0 -0
- package/es/components/Sales/Summary/serve.js +0 -6
- package/es/components/Sales/Summary/utils.d.ts +36 -0
- package/es/components/Sales/Summary/utils.js +1 -43
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Content/index.js +1 -15
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Services/index.js +27 -23
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
- package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
- package/es/components/appointmentBooking/deposit/index.js +2 -4
- package/es/components/appointmentBooking/index.d.ts +3 -0
- package/es/components/appointmentBooking/index.js +0 -14
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/const.d.ts +181 -0
- package/es/components/eftposPay/const.js +1 -3
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +35 -0
- package/es/components/eftposPay/hooks.js +1 -3
- package/es/components/eftposPay/index.d.ts +4 -0
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/manufacturer.d.ts +6 -0
- package/es/components/eftposPay/manufacturer.js +0 -4
- package/es/components/eftposPay/pay.d.ts +20 -0
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +355 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
- package/es/components/eventBooking/components/bookingDetailModal/index.js +1 -3
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/eventBooking/locales.d.ts +222 -0
- package/es/components/eventBooking/locales.js +3 -27
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
- package/es/components/pay/toC/PaymentMethods/index.js +4 -5
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +1 -120
- package/es/components/ticketBooking/locales.d.ts +153 -0
- package/es/components/ticketBooking/locales.js +147 -195
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/utils/index.d.ts +23 -0
- package/lib/components/Sales/Cart/index.d.ts +53 -0
- package/lib/components/Sales/Cart/index.js +0 -1
- package/lib/components/Sales/Cart/utils.d.ts +23 -0
- package/lib/components/Sales/Cart/utils.js +0 -117
- package/lib/components/Sales/Checkout/index.d.ts +33 -0
- package/lib/components/Sales/Checkout/index.js +7 -39
- package/lib/components/Sales/Checkout/serve.d.ts +2 -0
- package/lib/components/Sales/Checkout/serve.js +2 -7
- package/lib/components/Sales/Checkout/utils.d.ts +35 -0
- package/lib/components/Sales/Checkout/utils.js +0 -2
- package/lib/components/Sales/Summary/index.d.ts +25 -0
- package/lib/components/Sales/Summary/index.js +1 -7
- package/lib/components/Sales/Summary/serve.d.ts +0 -0
- package/lib/components/Sales/Summary/serve.js +0 -32
- package/lib/components/Sales/Summary/utils.d.ts +36 -0
- package/lib/components/Sales/Summary/utils.js +1 -30
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Content/index.js +1 -6
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Services/index.js +11 -6
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
- package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
- package/lib/components/appointmentBooking/deposit/index.js +2 -4
- package/lib/components/appointmentBooking/index.d.ts +3 -0
- package/lib/components/appointmentBooking/index.js +0 -11
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +2 -2
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/const.d.ts +181 -0
- package/lib/components/eftposPay/const.js +0 -2
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +35 -0
- package/lib/components/eftposPay/hooks.js +4 -11
- package/lib/components/eftposPay/index.d.ts +4 -0
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/manufacturer.d.ts +6 -0
- package/lib/components/eftposPay/manufacturer.js +0 -6
- package/lib/components/eftposPay/pay.d.ts +20 -0
- package/lib/components/eftposPay/pay.js +2 -13
- package/lib/components/eftposPay/store/index.d.ts +355 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/eventBooking/locales.d.ts +222 -0
- package/lib/components/eventBooking/locales.js +3 -27
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
- package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -120
- package/lib/components/ticketBooking/locales.d.ts +153 -0
- package/lib/components/ticketBooking/locales.js +4 -22
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/utils/index.d.ts +23 -0
- package/package.json +4 -4
- package/es/components/eftposPay/linkly/const.js +0 -82
- package/es/components/eftposPay/linkly/hooks/index.js +0 -2
- package/es/components/eftposPay/linkly/hooks/normal.js +0 -321
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
- package/es/components/eftposPay/linkly/index.js +0 -197
- package/es/components/eftposPay/linkly/service.js +0 -81
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
- package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
- package/es/components/ticketBooking/utils/formatTime.js +0 -144
- package/lib/components/eftposPay/linkly/const.js +0 -102
- package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
- package/lib/components/eftposPay/linkly/hooks/normal.js +0 -242
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
- package/lib/components/eftposPay/linkly/index.js +0 -208
- package/lib/components/eftposPay/linkly/service.js +0 -55
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
- package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
- package/lib/components/ticketBooking/utils/formatTime.js +0 -139
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export declare enum EftposEnum {
|
|
2
|
+
/** 后端支付 - 仅支付 */
|
|
3
|
+
Payo = "payo",
|
|
4
|
+
/** 前端支付 */
|
|
5
|
+
Tyro = "tyro",
|
|
6
|
+
/** 后端支付 - 支付 + 退款 */
|
|
7
|
+
Windcave = "windcave",
|
|
8
|
+
Stripe = "stripe"
|
|
9
|
+
}
|
|
10
|
+
export declare enum StatusEnum {
|
|
11
|
+
Loading = "loading",
|
|
12
|
+
Warn = "warn",
|
|
13
|
+
Fail = "fail",
|
|
14
|
+
Success = "success",
|
|
15
|
+
Pedding = "pedding",
|
|
16
|
+
Resove = "resove",
|
|
17
|
+
Reject = "reject",
|
|
18
|
+
Question = "question"
|
|
19
|
+
}
|
|
20
|
+
export declare enum ModeEnum {
|
|
21
|
+
/** 支付 */
|
|
22
|
+
Pay = "pay",
|
|
23
|
+
/** 完整支付 */
|
|
24
|
+
FullPay = "fullPay",
|
|
25
|
+
/** 退款 */
|
|
26
|
+
Refund = "refund",
|
|
27
|
+
/** 查询 */
|
|
28
|
+
Query = "query"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 崩溃恢复
|
|
32
|
+
*/
|
|
33
|
+
export declare enum RestoreEumn {
|
|
34
|
+
/** 常规 */
|
|
35
|
+
Normal = "normal",
|
|
36
|
+
/** 恢复 */
|
|
37
|
+
Restore = "restore"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 订单状态
|
|
41
|
+
*/
|
|
42
|
+
export declare enum OrderEumn {
|
|
43
|
+
/** 恢复 */
|
|
44
|
+
Restore = "restore",
|
|
45
|
+
/** 常规 */
|
|
46
|
+
Normal = "normal",
|
|
47
|
+
/** 成功 */
|
|
48
|
+
Succeed = "succeed",
|
|
49
|
+
/** 失败 */
|
|
50
|
+
Failed = "failed",
|
|
51
|
+
/** 等待 */
|
|
52
|
+
Pending = "pending",
|
|
53
|
+
/** 没有订单状态 */
|
|
54
|
+
Null = "null"
|
|
55
|
+
}
|
|
56
|
+
export declare enum ClientEnum {
|
|
57
|
+
/** 用户端 */
|
|
58
|
+
User = "user",
|
|
59
|
+
/** 商家端 */
|
|
60
|
+
Merchant = "merchant"
|
|
61
|
+
}
|
|
62
|
+
export declare enum RouteEnum {
|
|
63
|
+
/** 改价页 */
|
|
64
|
+
Amount = "amount",
|
|
65
|
+
/** 门店列表页 */
|
|
66
|
+
DeviceList = "deviceList",
|
|
67
|
+
/**支付页 */
|
|
68
|
+
Pay = "pay"
|
|
69
|
+
}
|
|
70
|
+
export declare enum PayRouteEnum {
|
|
71
|
+
Step = "step",
|
|
72
|
+
Unset = "unset"
|
|
73
|
+
}
|
|
74
|
+
export declare type RouteType = `${RouteEnum}`;
|
|
75
|
+
export declare type PayRouteType = `${PayRouteEnum}`;
|
|
76
|
+
export declare type DeviceStatusType = `${EftposEnum}`;
|
|
77
|
+
export declare type StatusType = `${StatusEnum}`;
|
|
78
|
+
export declare type ModeType = `${ModeEnum}`;
|
|
79
|
+
export interface PosProps {
|
|
80
|
+
/** 厂商类型 */
|
|
81
|
+
type: DeviceStatusType;
|
|
82
|
+
getApi: () => {
|
|
83
|
+
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
84
|
+
};
|
|
85
|
+
params: {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
/** 回调 */
|
|
89
|
+
onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page' | 'print' | 'mark_tx_processed', params?: {
|
|
90
|
+
[keys: string]: unknown;
|
|
91
|
+
} | string, other?: any) => void;
|
|
92
|
+
onChangeParams(...agrn: unknown[]): void;
|
|
93
|
+
terminal: {
|
|
94
|
+
network: boolean;
|
|
95
|
+
};
|
|
96
|
+
device?: {
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
};
|
|
99
|
+
mode: ModeEnum;
|
|
100
|
+
tyroUrl?: string;
|
|
101
|
+
tyroVersion?: string;
|
|
102
|
+
source: 'normal' | 'restore';
|
|
103
|
+
}
|
|
104
|
+
export interface PayProps {
|
|
105
|
+
api: ReturnType<PosProps['getApi']>;
|
|
106
|
+
onChange: PosProps['onChangeStatus'];
|
|
107
|
+
className?: string;
|
|
108
|
+
}
|
|
109
|
+
export declare type Amount = {
|
|
110
|
+
name: string;
|
|
111
|
+
/** 订单金额 */
|
|
112
|
+
money: number;
|
|
113
|
+
/** 上一轮操作订单金额 */
|
|
114
|
+
amount: number;
|
|
115
|
+
/** 金额单位 */
|
|
116
|
+
symbol: string;
|
|
117
|
+
/** 手续费-百分率 */
|
|
118
|
+
surRate: number;
|
|
119
|
+
/** 手续费-是否开启 */
|
|
120
|
+
surMoney: number;
|
|
121
|
+
/** 手续费-是否存在 */
|
|
122
|
+
surcharge: boolean;
|
|
123
|
+
/** 是否使用原始手续费 */
|
|
124
|
+
useOriginSurcharge: boolean;
|
|
125
|
+
};
|
|
126
|
+
export declare type PayAmount = {
|
|
127
|
+
/** 手续费-百分比-带百分号 例: 1% =》 数据为 0.01 */
|
|
128
|
+
surPercentRate: string;
|
|
129
|
+
/** 手续费-百分比-不带百分号 例:1% =》 数据为 1 */
|
|
130
|
+
surRate: string;
|
|
131
|
+
/** 手续费-比例金额 amount * surPercentRate */
|
|
132
|
+
surRateMoney: string;
|
|
133
|
+
/** 手续费-固定金额 */
|
|
134
|
+
surMoney: string;
|
|
135
|
+
/** 手续费 = surPercentRate + surMoney */
|
|
136
|
+
surcharge: string;
|
|
137
|
+
/** 支付金额 (不包含手续费) */
|
|
138
|
+
amount: string;
|
|
139
|
+
/** 支付总金额 = amount + surcharge */
|
|
140
|
+
total: string;
|
|
141
|
+
/** 订单金额 */
|
|
142
|
+
sourceAmount: string;
|
|
143
|
+
/** 支付总金额带单位 + 单位 */
|
|
144
|
+
totalUnit: string;
|
|
145
|
+
};
|
|
146
|
+
export declare enum PayStatus {
|
|
147
|
+
'Success' = "200",
|
|
148
|
+
/** 未生成交易记录 */
|
|
149
|
+
'NoPay' = "4004",
|
|
150
|
+
/** 支付失败 */
|
|
151
|
+
'Unknown' = "701000",
|
|
152
|
+
/** 交易请求超时 */
|
|
153
|
+
'Timeout' = "701001",
|
|
154
|
+
/** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
|
|
155
|
+
'PayOtherEftposFailed' = "701003",
|
|
156
|
+
/** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
|
|
157
|
+
'PayCardErrorFailed' = "701004",
|
|
158
|
+
/** 断网 向EFTPOS发送消息失败。可能有网络问题,也可能没有连接websocket。 */
|
|
159
|
+
'NoNetWork' = "701005",
|
|
160
|
+
/** 交易等待超时 */
|
|
161
|
+
'PayTimeout' = "701006",
|
|
162
|
+
/** 连接失败 */
|
|
163
|
+
'SocketError' = "701007",
|
|
164
|
+
/** 银行拒绝 */
|
|
165
|
+
'PayBankRefuses' = "701008",
|
|
166
|
+
/** 签名拒绝 */
|
|
167
|
+
'SignatureDeclined' = "701009",
|
|
168
|
+
/** 配置参数错误 */
|
|
169
|
+
'UserConfigError' = "701010"
|
|
170
|
+
}
|
|
171
|
+
export interface ActionProps {
|
|
172
|
+
onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
} | string) => void;
|
|
175
|
+
api: {
|
|
176
|
+
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
177
|
+
};
|
|
178
|
+
className?: string;
|
|
179
|
+
isMobile?: boolean;
|
|
180
|
+
formatAmount: (amount: number | string, precision: number, symbol: string) => string;
|
|
181
|
+
}
|
|
@@ -3,9 +3,8 @@ export var EftposEnum = /*#__PURE__*/function (EftposEnum) {
|
|
|
3
3
|
EftposEnum["Tyro"] = "tyro";
|
|
4
4
|
EftposEnum["Windcave"] = "windcave";
|
|
5
5
|
EftposEnum["Stripe"] = "stripe";
|
|
6
|
-
EftposEnum["Linkly"] = "linkly";
|
|
7
6
|
return EftposEnum;
|
|
8
|
-
}({});
|
|
7
|
+
}({}); // Eftpos = 'eftpos',
|
|
9
8
|
export var StatusEnum = /*#__PURE__*/function (StatusEnum) {
|
|
10
9
|
StatusEnum["Loading"] = "loading";
|
|
11
10
|
StatusEnum["Warn"] = "warn";
|
|
@@ -65,7 +64,6 @@ export var PayRouteEnum = /*#__PURE__*/function (PayRouteEnum) {
|
|
|
65
64
|
export var PayStatus = /*#__PURE__*/function (PayStatus) {
|
|
66
65
|
PayStatus["Success"] = "200";
|
|
67
66
|
PayStatus["NoPay"] = "4004";
|
|
68
|
-
PayStatus["PairingFailure"] = "606020";
|
|
69
67
|
PayStatus["Unknown"] = "701000";
|
|
70
68
|
PayStatus["Timeout"] = "701001";
|
|
71
69
|
PayStatus["PayOtherEftposFailed"] = "701003";
|
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
11
11
|
api: PayProps['api'];
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
onChange?: ((status: "
|
|
13
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
14
14
|
[keys: string]: unknown;
|
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
|
16
16
|
onClose: () => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PayStatus } from './const';
|
|
3
|
+
import { ModeEnum, ClientEnum } from './const';
|
|
4
|
+
export declare const useStoreRef: <T extends {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
} = {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}, U extends {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
} = {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}>() => {
|
|
13
|
+
readonly deviceRef: React.MutableRefObject<T>;
|
|
14
|
+
readonly payRef: React.MutableRefObject<U>;
|
|
15
|
+
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
|
+
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
|
+
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
|
+
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
|
+
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
|
+
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
|
|
23
|
+
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
|
+
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @title: 通用失败处理
|
|
28
|
+
* @description: 固定步骤 错误处理逻辑
|
|
29
|
+
* @return null
|
|
30
|
+
* @Author: hongbing.wang
|
|
31
|
+
* @Date: 2024-08-12 11:54
|
|
32
|
+
*/
|
|
33
|
+
export declare const useFail: (index: number) => (res: {
|
|
34
|
+
code?: `${PayStatus}`;
|
|
35
|
+
}, isMark?: boolean) => void;
|
|
@@ -139,7 +139,6 @@ export var useFail = function useFail(index) {
|
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
var code = "".concat(res.code);
|
|
142
|
-
console.log('code---->>>>>>>', code);
|
|
143
142
|
if (code === PayStatus.Unknown) {
|
|
144
143
|
// 前往报错页 不可标记
|
|
145
144
|
steps[index].title = locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
|
|
@@ -225,7 +224,6 @@ export var useFail = function useFail(index) {
|
|
|
225
224
|
dispatch(updateComponent('Fail'));
|
|
226
225
|
return;
|
|
227
226
|
}
|
|
228
|
-
|
|
229
227
|
// 重新支付 最多到重新发起2次
|
|
230
228
|
ref.current += 1;
|
|
231
229
|
dispatch(updateState({
|
|
@@ -302,7 +300,7 @@ export var useFail = function useFail(index) {
|
|
|
302
300
|
}));
|
|
303
301
|
return;
|
|
304
302
|
}
|
|
305
|
-
if (code === PayStatus.UserConfigError
|
|
303
|
+
if (code === PayStatus.UserConfigError) {
|
|
306
304
|
// 前往错误页 不可标记状态
|
|
307
305
|
steps[index].title = locales.getText('page.eftpos-pay.text.transaction.user.config.title');
|
|
308
306
|
steps[index].fail = locales.getText('page.eftpos-pay.text.transaction.user.config.text');
|
|
@@ -163,7 +163,7 @@ export default (function (props) {
|
|
|
163
163
|
}, [mode, state]);
|
|
164
164
|
useEffect(function () {
|
|
165
165
|
document.body.id = 'body';
|
|
166
|
-
console.log('初始化 ........
|
|
166
|
+
console.log('初始化 ........11221801');
|
|
167
167
|
}, []);
|
|
168
168
|
|
|
169
169
|
// console.log('action = ', action);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { State } from './store';
|
|
2
|
+
export { getAmonunt } from './helper';
|
|
3
|
+
export { default as Payo } from './payo';
|
|
4
|
+
export { default as Windcave } from './windcave/windcave';
|
|
5
|
+
export { default as Tyro } from './tyro';
|
|
6
|
+
export declare const getInitState: (type: string, params?: any) => State;
|
|
@@ -2,12 +2,10 @@ import { EftposEnum } from "./const";
|
|
|
2
2
|
import getPayoInitState from "./payo/const";
|
|
3
3
|
import getTyroInitState from "./tyro/const";
|
|
4
4
|
import getWindcaveInitState from "./windcave/const";
|
|
5
|
-
import getLinklyInitState from "./linkly/const";
|
|
6
5
|
export { getAmonunt } from "./helper";
|
|
7
6
|
export { default as Payo } from "./payo";
|
|
8
7
|
export { default as Windcave } from "./windcave/windcave";
|
|
9
8
|
export { default as Tyro } from "./tyro";
|
|
10
|
-
export { default as Linkly } from "./linkly";
|
|
11
9
|
export var getInitState = function getInitState(type, params) {
|
|
12
10
|
switch (type) {
|
|
13
11
|
case EftposEnum.Payo:
|
|
@@ -16,8 +14,6 @@ export var getInitState = function getInitState(type, params) {
|
|
|
16
14
|
return getWindcaveInitState(params);
|
|
17
15
|
case EftposEnum.Tyro:
|
|
18
16
|
return getTyroInitState(params);
|
|
19
|
-
case EftposEnum.Linkly:
|
|
20
|
-
return getLinklyInitState(params);
|
|
21
17
|
default:
|
|
22
18
|
throw new Error('未知的厂商类型');
|
|
23
19
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PayProps } from './const';
|
|
2
|
+
import './index.less';
|
|
3
|
+
/**
|
|
4
|
+
* @title: 支付组件
|
|
5
|
+
* @description:
|
|
6
|
+
* @Author: hongbing.wang
|
|
7
|
+
* @Date: 2024-08-20 14:59
|
|
8
|
+
*/
|
|
9
|
+
declare const Pay: ({ api, onChange: onChangeStatus, className, terminal, net, isMobile, tyroUrl, tyroVersion, formatAmount, client }: PayProps & {
|
|
10
|
+
terminal: {
|
|
11
|
+
network: boolean;
|
|
12
|
+
};
|
|
13
|
+
net: boolean;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
tyroUrl?: string | undefined;
|
|
16
|
+
tyroVersion?: string | undefined;
|
|
17
|
+
formatAmount(amount: number | string, precision: number, symbol: string): string;
|
|
18
|
+
client: string;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
export default Pay;
|
|
@@ -10,7 +10,7 @@ import { getPayParams } from "./helper";
|
|
|
10
10
|
import Manual from "./component/manual";
|
|
11
11
|
import Signature from "./component/signature";
|
|
12
12
|
import { StatusEnum, PayRouteEnum, ClientEnum } from "./const";
|
|
13
|
-
import { Payo, Windcave, Tyro
|
|
13
|
+
import { Payo, Windcave, Tyro } from "./manufacturer";
|
|
14
14
|
import { useContextData, useDispatch, updateStatus, backUpProduction, updateComponent, backUpFree, updateState } from "./store";
|
|
15
15
|
import "./index.less";
|
|
16
16
|
|
|
@@ -150,7 +150,7 @@ var Pay = function Pay(_ref) {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
}, []);
|
|
153
|
-
console.log('
|
|
153
|
+
// console.log("pay2222 = ",'pay 222' , data.render,data.type)
|
|
154
154
|
return /*#__PURE__*/React.createElement(React.Fragment, null, data.render ? /*#__PURE__*/React.createElement("div", {
|
|
155
155
|
className: "pisell-lowcode__eft-pay-box ".concat(className),
|
|
156
156
|
style: data.type === 'step' ? {} : {
|
|
@@ -178,10 +178,6 @@ var Pay = function Pay(_ref) {
|
|
|
178
178
|
onChange: onChange,
|
|
179
179
|
key: data.key,
|
|
180
180
|
formatAmount: formatAmount
|
|
181
|
-
}) : null, data.eftpos === 'linkly' ? /*#__PURE__*/React.createElement(Linkly, {
|
|
182
|
-
key: data.key,
|
|
183
|
-
api: api,
|
|
184
|
-
onChange: onChange
|
|
185
181
|
}) : null) : null, data.type === PayRouteEnum.Unset && Comm ? /*#__PURE__*/React.createElement(Comm, {
|
|
186
182
|
onChange: onChange,
|
|
187
183
|
api: api,
|