@pisell/pisellos 0.0.229 → 0.0.231

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.
Files changed (65) hide show
  1. package/dist/modules/Order/index.d.ts +13 -2
  2. package/dist/modules/Order/index.js +84 -1
  3. package/dist/modules/Order/types.d.ts +43 -0
  4. package/dist/modules/Order/types.js +8 -0
  5. package/dist/modules/Payment/cash.d.ts +8 -0
  6. package/dist/modules/Payment/cash.js +20 -1
  7. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  8. package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
  9. package/dist/modules/Payment/eftpos.js +1 -1
  10. package/dist/modules/Payment/index.d.ts +57 -94
  11. package/dist/modules/Payment/index.js +810 -1109
  12. package/dist/modules/Payment/mx51.d.ts +0 -0
  13. package/dist/modules/Payment/mx51.js +0 -0
  14. package/dist/modules/Payment/types.d.ts +358 -50
  15. package/dist/modules/Payment/types.js +103 -4
  16. package/dist/modules/Payment/utils.d.ts +17 -0
  17. package/dist/modules/Payment/utils.js +62 -0
  18. package/dist/modules/Payment/walletpass.d.ts +96 -0
  19. package/dist/modules/Payment/walletpass.js +492 -0
  20. package/dist/modules/Schedule/index.d.ts +9 -0
  21. package/dist/modules/Schedule/index.js +60 -0
  22. package/dist/solution/BookingTicket/index.d.ts +1 -1
  23. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  24. package/dist/solution/Checkout/index.d.ts +415 -0
  25. package/dist/solution/Checkout/index.js +3622 -0
  26. package/dist/solution/Checkout/types.d.ts +737 -0
  27. package/dist/solution/Checkout/types.js +137 -0
  28. package/dist/solution/Checkout/utils/index.d.ts +73 -0
  29. package/dist/{modules/Payment/wallet.js → solution/Checkout/utils/index.js} +363 -70
  30. package/dist/solution/index.d.ts +1 -0
  31. package/dist/solution/index.js +2 -1
  32. package/lib/modules/Order/index.d.ts +13 -2
  33. package/lib/modules/Order/index.js +58 -1
  34. package/lib/modules/Order/types.d.ts +43 -0
  35. package/lib/modules/Payment/cash.d.ts +8 -0
  36. package/lib/modules/Payment/cash.js +14 -1
  37. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  38. package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
  39. package/lib/modules/Payment/eftpos.js +1 -1
  40. package/lib/modules/Payment/index.d.ts +57 -94
  41. package/lib/modules/Payment/index.js +363 -525
  42. package/lib/modules/Payment/mx51.d.ts +0 -0
  43. package/lib/modules/Payment/mx51.js +0 -0
  44. package/lib/modules/Payment/types.d.ts +358 -50
  45. package/lib/modules/Payment/types.js +37 -2
  46. package/lib/modules/Payment/utils.d.ts +17 -0
  47. package/lib/modules/Payment/utils.js +67 -0
  48. package/lib/modules/Payment/walletpass.d.ts +96 -0
  49. package/lib/modules/Payment/walletpass.js +304 -0
  50. package/lib/modules/Schedule/index.d.ts +9 -0
  51. package/lib/modules/Schedule/index.js +36 -0
  52. package/lib/solution/BookingTicket/index.d.ts +1 -1
  53. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  54. package/lib/solution/Checkout/index.d.ts +415 -0
  55. package/lib/solution/Checkout/index.js +2107 -0
  56. package/lib/solution/Checkout/types.d.ts +737 -0
  57. package/lib/solution/Checkout/types.js +80 -0
  58. package/lib/solution/Checkout/utils/index.d.ts +73 -0
  59. package/lib/solution/Checkout/utils/index.js +266 -0
  60. package/lib/solution/index.d.ts +1 -0
  61. package/lib/solution/index.js +3 -1
  62. package/package.json +1 -1
  63. package/dist/modules/Payment/wallet.d.ts +0 -11
  64. package/lib/modules/Payment/wallet.d.ts +0 -11
  65. package/lib/modules/Payment/wallet.js +0 -51
File without changes
File without changes
@@ -31,6 +31,32 @@ export declare enum TaskRunStatus {
31
31
  Success = "success",
32
32
  Failed = "failed"
33
33
  }
34
+ /**
35
+ * 舍入规则枚举
36
+ */
37
+ export declare enum RoundingRule {
38
+ /** 标准舍入(中点向上) */
39
+ Standard = "standard",
40
+ /** 标准舍入(中点向下) */
41
+ StandardDown = "standard_down",
42
+ /** 总是向上舍入 */
43
+ AlwaysUp = "always_up",
44
+ /** 总是向下舍入 */
45
+ AlwaysDown = "always_down"
46
+ }
47
+ /**
48
+ * 舍入间隔枚举
49
+ */
50
+ export declare enum RoundingInterval {
51
+ /** 0.05 间隔 */
52
+ Interval005 = 0.05,
53
+ /** 0.1 间隔 */
54
+ Interval01 = 0.1,
55
+ /** 0.5 间隔 */
56
+ Interval05 = 0.5,
57
+ /** 1 间隔 */
58
+ Interval1 = 1
59
+ }
34
60
  /**
35
61
  * 支付方式信息
36
62
  */
@@ -79,18 +105,13 @@ export interface PaymentItem {
79
105
  rounding_amount?: string;
80
106
  /** 三方支付手续费 */
81
107
  service_charge?: {
82
- percentage: string;
83
- amount: string;
84
- };
85
- /** 该支付项是否已经同步给后端服务器(只有网络请求成功后才为true) */
86
- isSynced?: boolean;
87
- /** 同步错误信息(业务错误时记录错误信息,用于区分"未同步"和"同步失败") */
88
- syncError?: {
89
- error: string;
90
- errorCode?: string;
91
- statusCode?: number;
92
- timestamp: number;
108
+ percentage?: string;
109
+ amount?: string;
93
110
  };
111
+ /** 支付项状态 */
112
+ status?: 'active' | 'voided';
113
+ /** 原始金额(用于记录撤销前的金额) */
114
+ origin_amount?: string;
94
115
  }
95
116
  /**
96
117
  * 订单信息
@@ -106,17 +127,15 @@ export interface OrderInfo {
106
127
  deposit_amount: string;
107
128
  }
108
129
  /**
109
- * 支付订单
130
+ * 支付订单(简化版,仅保留支付相关信息)
110
131
  */
111
132
  export interface PaymentOrder {
112
133
  /** 当前订单的唯一 ID */
113
134
  uuid: string;
114
- /** 订单ID */
115
- id: number;
116
- /** 订单信息 */
117
- order_info: OrderInfo;
118
- /** 支付状态 */
119
- payment_status: PaymentStatus;
135
+ /** 订单ID(字符串类型,支持本地虚拟ID) */
136
+ id: string;
137
+ /** 订单ID(数字类型,兼容旧版本) */
138
+ order_id: string;
120
139
  /** 支付项列表 */
121
140
  payment: PaymentItem[];
122
141
  /** 修改的支付项列表 */
@@ -125,8 +144,16 @@ export interface PaymentOrder {
125
144
  total_amount: string;
126
145
  /** 待付金额 */
127
146
  expect_amount: string;
147
+ /** 支付状态 */
148
+ payment_status: PaymentStatus;
149
+ /** 是否是定金订单 */
150
+ is_deposit: number;
151
+ /** 定金金额 */
152
+ deposit_amount: string;
128
153
  /** 总税费 */
129
154
  tax_fee: string;
155
+ /** 原始订单数据(由 Checkout 模块传入) */
156
+ order_info?: any;
130
157
  }
131
158
  /**
132
159
  * 支付状态
@@ -134,11 +161,19 @@ export interface PaymentOrder {
134
161
  export interface PaymentState {
135
162
  }
136
163
  /**
137
- * 推送订单参数
164
+ * 推送订单参数(简化版)
138
165
  */
139
166
  export interface PushOrderParams {
140
- /** 订单信息 */
141
- order_info: OrderInfo;
167
+ /** 订单ID */
168
+ order_id: string;
169
+ /** 总金额 */
170
+ total_amount: string;
171
+ /** 是否是定金订单 */
172
+ is_deposit?: number;
173
+ /** 定金金额 */
174
+ deposit_amount?: string;
175
+ /** 原始订单数据(可选,由 Checkout 模块传入) */
176
+ order_info?: any;
142
177
  }
143
178
  /**
144
179
  * 更新订单参数
@@ -165,6 +200,11 @@ export interface PaymentItemInput {
165
200
  type: string;
166
201
  /** 代金券、充值卡、积分卡等wallet pass id */
167
202
  voucher_id?: string;
203
+ /** 三方支付手续费 */
204
+ service_charge?: {
205
+ percentage?: string;
206
+ amount?: string;
207
+ };
168
208
  }
169
209
  /**
170
210
  * 推送支付项参数
@@ -244,7 +284,45 @@ export interface EftposPayment {
244
284
  /**
245
285
  * 钱包支付接口
246
286
  */
247
- export interface WalletPayment {
287
+ export interface WalletPassPayment {
288
+ /** 生成钱包API默认参数 */
289
+ generateWalletParams: (businessData: WalletInitBusinessData) => WalletDeductionRecommendParams;
290
+ /** 获取已存储的钱包参数 */
291
+ getStoredWalletParams: () => WalletDeductionRecommendParams | null;
292
+ /** 清理已存储的钱包参数 */
293
+ clearStoredWalletParams: () => void;
294
+ /** 初始化钱包数据(从业务数据开始,内部生成参数) */
295
+ initializeWalletDataFromBusinessAsync: (businessData: WalletInitBusinessData) => Promise<{
296
+ walletRecommendList: WalletRecommendItem[];
297
+ userIdentificationCodes: UserIdentificationCodeItem[];
298
+ }>;
299
+ /** 初始化钱包数据(先获取推荐列表,再获取用户识别码列表) */
300
+ initializeWalletDataAsync: (baseParams: WalletDeductionRecommendParams) => Promise<{
301
+ walletRecommendList: WalletRecommendItem[];
302
+ userIdentificationCodes: UserIdentificationCodeItem[];
303
+ }>;
304
+ /** 获取钱包推荐扣款列表(异步获取并缓存) */
305
+ getWalletPassRecommendListAsync: (params: WalletDeductionRecommendParams) => Promise<WalletRecommendItem[]>;
306
+ /** 查询用户识别码列表(异步获取并缓存) */
307
+ getUserIdentificationCodeListAsync: (params: UserIdentificationCodeParams) => Promise<UserIdentificationCodeItem[]>;
308
+ /** 搜索识别码信息 */
309
+ searchIdentificationCodeAsync: (params: SearchIdentificationCodeParams) => Promise<SearchIdentificationCodeItem[]>;
310
+ /** 获取缓存的搜索结果列表 */
311
+ getSearchResults: () => SearchIdentificationCodeItem[];
312
+ /** 根据识别码查找搜索结果 */
313
+ findSearchResultByCode: (code: string) => SearchIdentificationCodeItem | undefined;
314
+ /** 获取缓存的钱包推荐列表 */
315
+ getWalletRecommendList: () => WalletRecommendItem[];
316
+ /** 获取缓存的用户识别码列表 */
317
+ getUserIdentificationCodes: () => UserIdentificationCodeItem[];
318
+ /** 清除钱包推荐列表 */
319
+ clearWalletRecommendList: () => void;
320
+ /** 清除用户识别码列表 */
321
+ clearUserIdentificationCodes: () => void;
322
+ /** 清除搜索结果缓存 */
323
+ clearSearchResults: () => void;
324
+ /** 清除所有缓存数据 */
325
+ clearAllCache: () => void;
248
326
  /** 处理钱包支付 */
249
327
  processWalletPayment: (amount: number, orderUuid: string, voucherId?: string) => Promise<void>;
250
328
  /** 获取钱包余额 */
@@ -259,43 +337,47 @@ export interface PaymentModuleAPI {
259
337
  /** Eftpos支付相关方法 */
260
338
  eftpos: EftposPayment;
261
339
  /** 钱包支付相关方法 */
262
- wallet: WalletPayment;
340
+ wallet: WalletPassPayment;
263
341
  /** 获取支付方式列表 */
264
342
  getPayMethodListAsync: () => Promise<PaymentMethod[]>;
265
- /** 获取订单列表 */
266
- getOrderListAsync: () => Promise<PaymentOrder[]>;
267
- /** 根据uuid获取指定订单 */
268
- getOrderByUuidAsync: (orderUuid: string) => Promise<PaymentOrder | null>;
269
- /** 往交易组中添加订单 */
270
- pushOrderAsync: (params: PushOrderParams) => Promise<PaymentOrder>;
271
- /** 删除订单 */
272
- deleteOrderAsync: (orderUuid: string) => Promise<void>;
273
- /** 更新订单 */
274
- updateOrderAsync: (orderUuid: string, params: Partial<PaymentOrder>) => Promise<void>;
343
+ /** 创建支付订单(仅保存支付相关信息) */
344
+ createPaymentOrderAsync: (params: PushOrderParams) => Promise<PaymentOrder>;
345
+ /** 根据订单UUID获取支付订单 */
346
+ getPaymentOrderByUuidAsync: (orderUuid: string) => Promise<PaymentOrder | null>;
347
+ /** 基于UUID替换订单ID */
348
+ replaceOrderIdByUuidAsync: (orderUuid: string, newOrderId: string) => Promise<PaymentOrder | null>;
349
+ /** 删除支付订单 */
350
+ deletePaymentOrderAsync: (orderUuid: string) => Promise<void>;
275
351
  /** 获取支付项 */
276
- getPaymentAsync: (orderUuid: string) => Promise<PaymentItem[]>;
277
- /** 为某个订单设置一个支付项 */
278
- pushPaymentAsync: (orderUuid: string, paymentItem: PaymentItemInput) => Promise<void>;
279
- /** 删除一个支付项 */
352
+ getPaymentItemsAsync: (orderUuid: string, includeVoided?: boolean) => Promise<PaymentItem[]>;
353
+ /** 获取所有支付项(包括已撤销的) */
354
+ getAllPaymentItemsAsync: (orderUuid: string) => Promise<PaymentItem[]>;
355
+ /** 为某个订单添加支付项 */
356
+ addPaymentItemAsync: (orderUuid: string, paymentItem: PaymentItemInput) => Promise<void>;
357
+ /** 删除支付项 */
280
358
  deletePaymentAsync: (orderUuid: string, paymentUuid: string) => Promise<void>;
281
- /** 更新一个支付项 */
359
+ /** 更新支付项 */
282
360
  updatePaymentAsync: (orderUuid: string, paymentUuid: string, params: PaymentUpdateFields) => Promise<void>;
283
- /** 提交支付 */
284
- submitPayAsync: (orderUuid?: string) => Promise<{
285
- status: 'success' | 'failed';
286
- }>;
361
+ /** 批量更新代金券类支付项(覆盖更新) */
362
+ updateVoucherPaymentItemsAsync: (orderUuid: string, voucherPaymentItems: PaymentItemInput[]) => Promise<void>;
287
363
  /** 获取订单剩余待付金额 */
288
364
  getRemainingOrderAmountAsync: (orderUuid: string) => Promise<number>;
289
365
  /** 获取订单剩余待付金额(基于用户输入的金额) */
290
366
  getRemainingOrderAmountWithInputAsync: (inputAmount: string | number, orderUuid: string) => Promise<number>;
367
+ /**
368
+ * 智能金额舍入
369
+ * @param originalAmount 原始金额
370
+ * @param interval 舍入间隔 (0.05, 0.1, 0.5, 1)
371
+ * @param rule 舍入规则 (standard, standard_down, always_up, always_down)
372
+ * @returns 舍入后的金额
373
+ */
374
+ roundAmountAsync: (originalAmount: number | string, interval: RoundingInterval | number, rule: RoundingRule | string) => Promise<string>;
375
+ /** 提交支付 */
376
+ submitPayAsync: (orderUuid?: string) => Promise<{
377
+ status: 'success' | 'failed';
378
+ }>;
291
379
  /** 获取部分支付的订单 */
292
380
  getPartiallyPaidOrdersAsync: () => Promise<PaymentOrder[]>;
293
- /** 获取未同步到服务器的订单 */
294
- getUnsyncedOrdersAsync: () => Promise<PaymentOrder[]>;
295
- /** 检测未同步的订单并重新加入任务队列 */
296
- recheckAndRequeueUnsyncedOrders: () => Promise<number>;
297
- /** 手动执行支付同步队列 */
298
- runPaymentSyncQueue: () => Promise<void>;
299
381
  }
300
382
  /**
301
383
  * 订单变化事件数据
@@ -350,7 +432,52 @@ export interface OnPaymentSyncSuccessEventData {
350
432
  timestamp: number;
351
433
  }
352
434
  /**
353
- * 支付钩子事件
435
+ * 钱包推荐列表更新事件数据
436
+ */
437
+ export interface OnWalletRecommendListUpdatedEventData {
438
+ /** 新的钱包推荐列表 */
439
+ walletRecommendList: WalletRecommendItem[];
440
+ }
441
+ /**
442
+ * 用户识别码列表更新事件数据
443
+ */
444
+ export interface OnUserIdentificationCodesUpdatedEventData {
445
+ /** 新的用户识别码列表 */
446
+ userIdentificationCodes: UserIdentificationCodeItem[];
447
+ }
448
+ /**
449
+ * 钱包缓存清除事件数据
450
+ */
451
+ export interface OnWalletCacheClearedEventData {
452
+ /** 清除的数据类型 */
453
+ clearedTypes: ('walletRecommendList' | 'userIdentificationCodes' | 'all')[];
454
+ }
455
+ /**
456
+ * 搜索识别码完成事件数据
457
+ */
458
+ export interface OnSearchIdentificationCodeCompletedEventData {
459
+ /** 当前搜索的识别码 */
460
+ searchCode: string;
461
+ /** 当前搜索返回的结果 */
462
+ currentSearchResults: SearchIdentificationCodeItem[];
463
+ /** 缓存中的所有搜索结果 */
464
+ cachedSearchResults: SearchIdentificationCodeItem[];
465
+ /** 搜索参数 */
466
+ searchParams: SearchIdentificationCodeParams;
467
+ }
468
+ /**
469
+ * 钱包支付事件枚举
470
+ */
471
+ export declare enum WalletPassHooks {
472
+ OnWalletRecommendListUpdated = "wallet:onWalletRecommendListUpdated",
473
+ OnWalletRecommendListCleared = "wallet:onWalletRecommendListCleared",
474
+ OnUserIdentificationCodesUpdated = "wallet:onUserIdentificationCodesUpdated",
475
+ OnUserIdentificationCodesCleared = "wallet:onUserIdentificationCodesCleared",
476
+ OnWalletCacheCleared = "wallet:onWalletCacheCleared",
477
+ OnSearchIdentificationCodeCompleted = "wallet:onSearchIdentificationCodeCompleted"
478
+ }
479
+ /**
480
+ * 支付钩子事件(统一接口)
354
481
  */
355
482
  export declare enum PaymentHooks {
356
483
  OnPaymentMethodsLoaded = "payment:onPaymentMethodsLoaded",
@@ -365,5 +492,186 @@ export declare enum PaymentHooks {
365
492
  OnPaymentSubmitted = "payment:onPaymentSubmitted",
366
493
  OnOrderAmountChanged = "payment:onOrderAmountChanged",
367
494
  OnPaymentSyncError = "payment:onPaymentSyncError",
368
- OnPaymentSyncSuccess = "payment:onPaymentSyncSuccess"
495
+ OnPaymentSyncSuccess = "payment:onPaymentSyncSuccess",
496
+ OnWalletRecommendListUpdated = "wallet:onWalletRecommendListUpdated",
497
+ OnWalletRecommendListCleared = "wallet:onWalletRecommendListCleared",
498
+ OnUserIdentificationCodesUpdated = "wallet:onUserIdentificationCodesUpdated",
499
+ OnUserIdentificationCodesCleared = "wallet:onUserIdentificationCodesCleared",
500
+ OnWalletCacheCleared = "wallet:onWalletCacheCleared",
501
+ OnSearchIdentificationCodeCompleted = "wallet:onSearchIdentificationCodeCompleted"
502
+ }
503
+ /**
504
+ * 钱包推荐扣款请求参数
505
+ */
506
+ export interface WalletDeductionRecommendParams {
507
+ /** 销售渠道 */
508
+ sale_channel: string;
509
+ /** 前端设置只想要的字段 */
510
+ expect_columns?: string[];
511
+ /** 客户id */
512
+ customer_id: number;
513
+ /** 订单总计金额 */
514
+ order_expect_amount: number;
515
+ /** 订单小计金额 */
516
+ order_product_amount: number;
517
+ /** 订单待支付金额 */
518
+ order_wait_pay_amount: number;
519
+ /** 统计计数用户id */
520
+ order_behavior_count_customer_id: number;
521
+ /** 已选商品 */
522
+ products: {
523
+ /** 商品id */
524
+ product_id: number;
525
+ /** 商品variant_id */
526
+ product_variant_id: string;
527
+ /** 商品数量 */
528
+ quantity: number;
529
+ /** 商品使用了所有优惠后的最终价格 */
530
+ selling_price: number;
531
+ }[];
532
+ /** 预备支付 */
533
+ prepare_payments?: {
534
+ voucher_id: number;
535
+ amount: number;
536
+ tag: string;
537
+ }[];
538
+ }
539
+ /**
540
+ * 钱包初始化业务数据接口
541
+ * 用于生成钱包API参数的必要业务信息
542
+ */
543
+ export interface WalletInitBusinessData {
544
+ /** 客户ID(可选) */
545
+ customer_id?: number;
546
+ /** 金额信息 */
547
+ amountInfo: {
548
+ totalAmount: string;
549
+ subTotal: string;
550
+ };
551
+ /** 商品列表 */
552
+ products: {
553
+ product_id: number;
554
+ product_variant_id: string;
555
+ quantity: number;
556
+ selling_price: number;
557
+ }[];
558
+ }
559
+ /**
560
+ * 查询用户识别码列表请求参数
561
+ */
562
+ export interface UserIdentificationCodeParams extends WalletDeductionRecommendParams {
563
+ /** 是否可用 */
564
+ available?: 0 | 1 | 2;
565
+ /** 其他精确码 */
566
+ other_exact_codes?: string[];
567
+ /** 过滤预备钱包通行证 */
568
+ filter_prepare_wallet_pass?: 0 | 1;
569
+ /** 预备支付 */
570
+ prepare_payments?: {
571
+ voucher_id: number;
572
+ amount: number;
573
+ tag: string;
574
+ }[];
575
+ }
576
+ /**
577
+ * 钱包推荐扣款响应数据
578
+ */
579
+ export interface WalletDeductionRecommendResponse {
580
+ /** 响应状态码 */
581
+ code?: number;
582
+ /** 响应消息 */
583
+ message?: string;
584
+ /** 响应数据 */
585
+ data?: WalletRecommendItem[];
586
+ }
587
+ /**
588
+ * 用户识别码列表响应数据
589
+ */
590
+ export interface UserIdentificationCodeResponse {
591
+ /** 响应状态码 */
592
+ code?: number;
593
+ /** 响应消息 */
594
+ message?: string;
595
+ /** 响应数据 */
596
+ data?: UserIdentificationCodeItem[];
597
+ }
598
+ /**
599
+ * 用户识别码项目
600
+ */
601
+ export interface UserIdentificationCodeItem {
602
+ /** 识别码ID */
603
+ id: number;
604
+ /** 识别码 */
605
+ code: string;
606
+ /** 识别码名称 */
607
+ name: string;
608
+ /** 识别码类型 */
609
+ type: string;
610
+ /** 是否可用 */
611
+ available: boolean;
612
+ /** 余额信息 */
613
+ balance?: number;
614
+ /** 有效期 */
615
+ expires_at?: string;
616
+ /** 其他扩展字段 */
617
+ [key: string]: any;
618
+ }
619
+ /**
620
+ * 搜索识别码请求参数
621
+ * 基于 WalletDeductionRecommendParams 并增加 code 字段
622
+ */
623
+ export interface SearchIdentificationCodeParams extends WalletDeductionRecommendParams {
624
+ /** 识别码 */
625
+ code: string;
626
+ }
627
+ /**
628
+ * 搜索识别码响应数据
629
+ */
630
+ export interface SearchIdentificationCodeResponse {
631
+ /** 响应状态码 */
632
+ code?: number;
633
+ /** 响应消息 */
634
+ message?: string;
635
+ /** 响应数据 */
636
+ data?: SearchIdentificationCodeItem[];
637
+ }
638
+ /**
639
+ * 搜索识别码项目
640
+ */
641
+ export interface SearchIdentificationCodeItem {
642
+ /** 识别码ID */
643
+ id: number;
644
+ /** 识别码 */
645
+ code: string;
646
+ /** 识别码名称 */
647
+ name: string;
648
+ /** 识别码类型 */
649
+ type: string;
650
+ /** 标签 */
651
+ tag?: string;
652
+ /** 是否可用 */
653
+ available: boolean;
654
+ /** 余额信息 */
655
+ balance?: number;
656
+ /** 有效期 */
657
+ expires_at?: string;
658
+ }
659
+ /**
660
+ * 钱包推荐项目
661
+ */
662
+ export interface WalletRecommendItem {
663
+ /** 推荐项目ID */
664
+ id: number;
665
+ /** 推荐项目名称 */
666
+ name: string;
667
+ /** 推荐金额 */
668
+ amount: number;
669
+ /** 项目类型 */
670
+ type: string;
671
+ /** 是否可用 */
672
+ available: boolean;
673
+ /** 优先级 */
674
+ priority?: number;
675
+ /** 其他扩展字段 */
676
+ [key: string]: any;
369
677
  }
@@ -34,6 +34,28 @@ export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
34
34
  return TaskRunStatus;
35
35
  }({});
36
36
 
37
+ /**
38
+ * 舍入规则枚举
39
+ */
40
+ export var RoundingRule = /*#__PURE__*/function (RoundingRule) {
41
+ RoundingRule["Standard"] = "standard";
42
+ RoundingRule["StandardDown"] = "standard_down";
43
+ RoundingRule["AlwaysUp"] = "always_up";
44
+ RoundingRule["AlwaysDown"] = "always_down";
45
+ return RoundingRule;
46
+ }({});
47
+
48
+ /**
49
+ * 舍入间隔枚举
50
+ */
51
+ export var RoundingInterval = /*#__PURE__*/function (RoundingInterval) {
52
+ RoundingInterval[RoundingInterval["Interval005"] = 0.05] = "Interval005";
53
+ RoundingInterval[RoundingInterval["Interval01"] = 0.1] = "Interval01";
54
+ RoundingInterval[RoundingInterval["Interval05"] = 0.5] = "Interval05";
55
+ RoundingInterval[RoundingInterval["Interval1"] = 1] = "Interval1";
56
+ return RoundingInterval;
57
+ }({});
58
+
37
59
  /**
38
60
  * 支付方式信息
39
61
  */
@@ -47,7 +69,7 @@ export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
47
69
  */
48
70
 
49
71
  /**
50
- * 支付订单
72
+ * 支付订单(简化版,仅保留支付相关信息)
51
73
  */
52
74
 
53
75
  /**
@@ -55,7 +77,7 @@ export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
55
77
  */
56
78
 
57
79
  /**
58
- * 推送订单参数
80
+ * 推送订单参数(简化版)
59
81
  */
60
82
 
61
83
  /**
@@ -115,7 +137,36 @@ export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
115
137
  */
116
138
 
117
139
  /**
118
- * 支付钩子事件
140
+ * 钱包推荐列表更新事件数据
141
+ */
142
+
143
+ /**
144
+ * 用户识别码列表更新事件数据
145
+ */
146
+
147
+ /**
148
+ * 钱包缓存清除事件数据
149
+ */
150
+
151
+ /**
152
+ * 搜索识别码完成事件数据
153
+ */
154
+
155
+ /**
156
+ * 钱包支付事件枚举
157
+ */
158
+ export var WalletPassHooks = /*#__PURE__*/function (WalletPassHooks) {
159
+ WalletPassHooks["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
160
+ WalletPassHooks["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
161
+ WalletPassHooks["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
162
+ WalletPassHooks["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
163
+ WalletPassHooks["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
164
+ WalletPassHooks["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
165
+ return WalletPassHooks;
166
+ }({});
167
+
168
+ /**
169
+ * 支付钩子事件(统一接口)
119
170
  */
120
171
  export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
121
172
  PaymentHooks["OnPaymentMethodsLoaded"] = "payment:onPaymentMethodsLoaded";
@@ -131,5 +182,53 @@ export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
131
182
  PaymentHooks["OnOrderAmountChanged"] = "payment:onOrderAmountChanged";
132
183
  PaymentHooks["OnPaymentSyncError"] = "payment:onPaymentSyncError";
133
184
  PaymentHooks["OnPaymentSyncSuccess"] = "payment:onPaymentSyncSuccess";
185
+ PaymentHooks["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
186
+ PaymentHooks["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
187
+ PaymentHooks["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
188
+ PaymentHooks["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
189
+ PaymentHooks["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
190
+ PaymentHooks["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
134
191
  return PaymentHooks;
135
- }({});
192
+ }({});
193
+
194
+ /**
195
+ * 钱包推荐扣款请求参数
196
+ */
197
+
198
+ /**
199
+ * 钱包初始化业务数据接口
200
+ * 用于生成钱包API参数的必要业务信息
201
+ */
202
+
203
+ /**
204
+ * 查询用户识别码列表请求参数
205
+ */
206
+
207
+ /**
208
+ * 钱包推荐扣款响应数据
209
+ */
210
+
211
+ /**
212
+ * 用户识别码列表响应数据
213
+ */
214
+
215
+ /**
216
+ * 用户识别码项目
217
+ */
218
+
219
+ /**
220
+ * 搜索识别码请求参数
221
+ * 基于 WalletDeductionRecommendParams 并增加 code 字段
222
+ */
223
+
224
+ /**
225
+ * 搜索识别码响应数据
226
+ */
227
+
228
+ /**
229
+ * 搜索识别码项目
230
+ */
231
+
232
+ /**
233
+ * 钱包推荐项目
234
+ */
@@ -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[];