@pisell/pisellos 1.0.65 → 1.0.67

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 (43) hide show
  1. package/dist/modules/Date/index.js +4 -0
  2. package/dist/modules/Order/index.js +10 -4
  3. package/dist/modules/Payment/index.d.ts +1 -0
  4. package/dist/modules/Payment/index.js +75 -41
  5. package/dist/modules/Payment/walletpass.js +3 -4
  6. package/dist/modules/Rules/index.js +2 -0
  7. package/dist/modules/Schedule/index.d.ts +1 -1
  8. package/dist/modules/Schedule/index.js +9 -0
  9. package/dist/solution/BookingByStep/index.d.ts +16 -4
  10. package/dist/solution/BookingByStep/index.js +671 -109
  11. package/dist/solution/BookingByStep/utils/capacity.d.ts +23 -0
  12. package/dist/solution/BookingByStep/utils/capacity.js +219 -1
  13. package/dist/solution/BookingByStep/utils/stock.d.ts +29 -0
  14. package/dist/solution/BookingByStep/utils/stock.js +126 -0
  15. package/dist/solution/BookingTicket/index.d.ts +1 -1
  16. package/dist/solution/Checkout/index.d.ts +6 -148
  17. package/dist/solution/Checkout/index.js +1188 -2434
  18. package/dist/solution/Checkout/types.d.ts +7 -220
  19. package/dist/solution/Checkout/types.js +1 -49
  20. package/dist/solution/Checkout/utils/index.d.ts +9 -5
  21. package/dist/solution/Checkout/utils/index.js +18 -56
  22. package/lib/modules/Date/index.js +3 -0
  23. package/lib/modules/Order/index.js +6 -0
  24. package/lib/modules/Payment/index.d.ts +1 -0
  25. package/lib/modules/Payment/index.js +35 -8
  26. package/lib/modules/Payment/walletpass.js +2 -2
  27. package/lib/modules/Rules/index.js +2 -0
  28. package/lib/modules/Schedule/index.d.ts +1 -1
  29. package/lib/modules/Schedule/index.js +9 -0
  30. package/lib/solution/BookingByStep/index.d.ts +16 -4
  31. package/lib/solution/BookingByStep/index.js +363 -8
  32. package/lib/solution/BookingByStep/utils/capacity.d.ts +23 -0
  33. package/lib/solution/BookingByStep/utils/capacity.js +157 -0
  34. package/lib/solution/BookingByStep/utils/stock.d.ts +29 -0
  35. package/lib/solution/BookingByStep/utils/stock.js +89 -0
  36. package/lib/solution/BookingTicket/index.d.ts +1 -1
  37. package/lib/solution/Checkout/index.d.ts +6 -148
  38. package/lib/solution/Checkout/index.js +337 -1115
  39. package/lib/solution/Checkout/types.d.ts +7 -220
  40. package/lib/solution/Checkout/types.js +3 -27
  41. package/lib/solution/Checkout/utils/index.d.ts +9 -5
  42. package/lib/solution/Checkout/utils/index.js +12 -53
  43. package/package.json +1 -1
@@ -2,42 +2,6 @@ import { Module } from '../../types';
2
2
  import { OrderModule } from '../../modules/Order';
3
3
  import { PaymentModuleAPI, PaymentOrder, PaymentMethod, PaymentStatus, PaymentItem, PaymentItemInput } from '../../modules/Payment';
4
4
  import { CartItem } from '../../modules/Cart/types';
5
- /**
6
- * 结账状态枚举
7
- */
8
- export declare enum CheckoutStatus {
9
- /** 初始化中 */
10
- Initializing = "initializing",
11
- /** 准备就绪 */
12
- Ready = "ready",
13
- /** 创建订单中 */
14
- CreatingOrder = "creating_order",
15
- /** 订单已创建 */
16
- OrderCreated = "order_created",
17
- /** 处理支付中 */
18
- ProcessingPayment = "processing_payment",
19
- /** 支付完成 */
20
- PaymentCompleted = "payment_completed",
21
- /** 结账完成 */
22
- Completed = "completed",
23
- /** 已取消 */
24
- Cancelled = "cancelled",
25
- /** 错误状态 */
26
- Error = "error"
27
- }
28
- /**
29
- * 结账步骤枚举
30
- */
31
- export declare enum CheckoutStep {
32
- /** 订单确认 */
33
- OrderConfirmation = "order_confirmation",
34
- /** 支付方式选择 */
35
- PaymentMethod = "payment_method",
36
- /** 支付处理 */
37
- PaymentProcessing = "payment_processing",
38
- /** 完成 */
39
- Complete = "complete"
40
- }
41
5
  /**
42
6
  * 结账错误类型
43
7
  */
@@ -127,15 +91,6 @@ export interface CreateLocalOrderParams {
127
91
  autoPayment?: boolean;
128
92
  totalInfo: any;
129
93
  }
130
- /**
131
- * 手动下单参数
132
- */
133
- export interface PlaceOrderParams {
134
- /** 订单提交的 URL (可选,默认使用 /order/appointment) */
135
- url?: string;
136
- /** 是否自动替换虚拟订单ID为真实订单ID */
137
- autoReplaceOrderId?: boolean;
138
- }
139
94
  /**
140
95
  * 本地订单数据结构 (基于 appointmentDemo.json)
141
96
  */
@@ -300,74 +255,12 @@ export interface LocalResourceItem {
300
255
  /** 资源类型 (可选) */
301
256
  resourceType?: string;
302
257
  }
303
- /**
304
- * 订单创建参数
305
- */
306
- export interface CreateOrderParams {
307
- /** 购物车商品 */
308
- cartItems: CartItem[];
309
- /** 订单类型 */
310
- type?: 'virtual' | 'appointment_booking';
311
- /** 平台类型 */
312
- platform?: 'pc' | 'h5';
313
- /** 额外参数 */
314
- extra?: Record<string, any>;
315
- }
316
- /**
317
- * 支付处理参数
318
- */
319
- export interface ProcessPaymentParams {
320
- /** 订单UUID */
321
- orderUuid: string;
322
- /** 支付方式代码 */
323
- paymentMethodCode: string;
324
- /** 支付金额 */
325
- amount: string | number;
326
- /** 支付元数据 */
327
- metadata?: Record<string, any>;
328
- }
329
- /**
330
- * 结账状态信息
331
- */
332
- export interface CheckoutStatusInfo {
333
- /** 当前状态 */
334
- status: CheckoutStatus;
335
- /** 当前步骤 */
336
- step: CheckoutStep;
337
- /** 进度百分比 (0-100) */
338
- progress: number;
339
- /** 状态消息 */
340
- message?: string;
341
- /** 错误信息 */
342
- error?: CheckoutError;
343
- }
344
- /**
345
- * 结账摘要信息
346
- */
347
- export interface CheckoutSummary {
348
- /** 订单信息 */
349
- order?: PaymentOrder;
350
- /** 总金额 */
351
- totalAmount: string;
352
- /** 已支付金额 */
353
- paidAmount: string;
354
- /** 待支付金额 */
355
- remainingAmount: string;
356
- /** 支付状态 */
357
- paymentStatus: PaymentStatus;
358
- /** 可用支付方式 */
359
- availablePaymentMethods: PaymentMethod[];
360
- }
361
258
  /**
362
259
  * 结账事件钩子
363
260
  */
364
261
  export declare enum CheckoutHooks {
365
262
  /** 结账初始化完成 */
366
263
  OnCheckoutInitialized = "checkout:onInitialized",
367
- /** 状态变更 */
368
- OnStatusChanged = "checkout:onStatusChanged",
369
- /** 步骤变更 */
370
- OnStepChanged = "checkout:onStepChanged",
371
264
  /** 订单创建成功 */
372
265
  OnOrderCreated = "checkout:onOrderCreated",
373
266
  /** 订单创建失败 */
@@ -407,16 +300,14 @@ export declare enum CheckoutHooks {
407
300
  /** 下单接口请求完成 */
408
301
  OnOrderSubmitEnd = "checkout:onOrderSubmitEnd",
409
302
  /** 钱包数据初始化完成 */
410
- OnWalletDataInitialized = "checkout:onWalletDataInitialized"
303
+ OnWalletDataInitialized = "checkout:onWalletDataInitialized",
304
+ /** 支付项添加成功 */
305
+ OnPaymentItemAdded = "checkout:onPaymentItemAdded"
411
306
  }
412
307
  /**
413
308
  * 结账状态数据
414
309
  */
415
310
  export interface CheckoutState {
416
- /** 当前状态 */
417
- status: CheckoutStatus;
418
- /** 当前步骤 */
419
- step: CheckoutStep;
420
311
  /** 当前订单 */
421
312
  currentOrder?: PaymentOrder;
422
313
  /** 购物车商品 */
@@ -449,10 +340,6 @@ export interface CurrentOrderInfo {
449
340
  uuid?: string;
450
341
  /** 订单ID */
451
342
  orderId?: string;
452
- /** 订单状态 */
453
- status?: CheckoutStatus;
454
- /** 当前步骤 */
455
- step?: CheckoutStep;
456
343
  /** 订单总金额 */
457
344
  totalAmount?: string;
458
345
  /** 待付金额 */
@@ -486,22 +373,6 @@ export interface CheckoutModuleAPI extends Module {
486
373
  * 创建本地订单 (前端模拟下单流程)
487
374
  */
488
375
  createLocalOrderAsync(params: CreateLocalOrderParams): Promise<PaymentOrder>;
489
- /**
490
- * 手动下单 (根据虚拟订单生成实际订单)
491
- */
492
- placeOrderAsync(params?: PlaceOrderParams): Promise<{
493
- success: boolean;
494
- orderId?: string;
495
- error?: string;
496
- }>;
497
- /**
498
- * 创建订单
499
- */
500
- createOrderAsync(params: CreateOrderParams): Promise<PaymentOrder>;
501
- /**
502
- * 处理支付
503
- */
504
- processPaymentAsync(params: ProcessPaymentParams): Promise<void>;
505
376
  /**
506
377
  * 完成结账
507
378
  */
@@ -509,26 +380,6 @@ export interface CheckoutModuleAPI extends Module {
509
380
  success: boolean;
510
381
  orderId?: string;
511
382
  }>;
512
- /**
513
- * 取消结账
514
- */
515
- cancelCheckoutAsync(): Promise<void>;
516
- /**
517
- * 获取结账状态
518
- */
519
- getCheckoutStatus(): CheckoutStatusInfo;
520
- /**
521
- * 获取结账摘要
522
- */
523
- getCheckoutSummaryAsync(): Promise<CheckoutSummary>;
524
- /**
525
- * 获取可用支付方式
526
- */
527
- getAvailablePaymentMethodsAsync(): Promise<PaymentMethod[]>;
528
- /**
529
- * 刷新支付方式缓存
530
- */
531
- refreshPaymentMethodsAsync(): Promise<PaymentMethod[]>;
532
383
  /**
533
384
  * 获取当前订单基础信息
534
385
  */
@@ -537,21 +388,6 @@ export interface CheckoutModuleAPI extends Module {
537
388
  * 获取当前订单的支付项
538
389
  */
539
390
  getCurrentOrderPaymentItemsAsync(): Promise<PaymentItem[]>;
540
- /**
541
- * 验证结账前置条件
542
- */
543
- validateCheckoutAsync(): Promise<{
544
- valid: boolean;
545
- errors: string[];
546
- }>;
547
- /**
548
- * 重试失败的操作
549
- */
550
- retryFailedOperationAsync(): Promise<void>;
551
- /**
552
- * 设置当前步骤
553
- */
554
- setCurrentStep(step: CheckoutStep): void;
555
391
  /**
556
392
  * 获取订单模块
557
393
  */
@@ -578,18 +414,10 @@ export interface CheckoutModuleAPI extends Module {
578
414
  * @returns 当前系统计算的待付金额
579
415
  */
580
416
  getBalanceDueAmount(): string;
581
- /**
582
- * 刷新 stateAmount 为当前剩余未支付金额
583
- */
584
- refreshStateAmountAsync(): Promise<void>;
585
417
  /**
586
418
  * 获取购物车小计数据
587
419
  */
588
420
  getCartSummary(): CartSummaryItem[] | null;
589
- /**
590
- * 获取提取的金额详细信息
591
- */
592
- getExtractedAmountInfo(): ExtractedAmountInfo | null;
593
421
  /**
594
422
  * 获取支付方式列表(直接调用 Payment 模块)
595
423
  */
@@ -611,19 +439,11 @@ export interface CheckoutModuleAPI extends Module {
611
439
  */
612
440
  updateOrderDepositStatusAsync(isDeposit: number): Promise<void>;
613
441
  /**
614
- * 更新当前订单的客户信息
442
+ * 手动设置当前订单的定金金额
443
+ *
444
+ * @param depositAmount 定金金额,必须是有效的数字字符串,且不能超过订单总额
615
445
  */
616
- updateOrderCustomerAsync(customer: {
617
- customer_id?: string;
618
- customer_name?: string;
619
- }): Promise<void>;
620
- /**
621
- * 获取当前订单的客户信息
622
- */
623
- getCurrentCustomer(): {
624
- customer_id?: string;
625
- customer_name?: string;
626
- } | null;
446
+ setDepositAmountAsync(depositAmount: string): Promise<void>;
627
447
  /**
628
448
  * 手动同步订单到后端
629
449
  *
@@ -636,13 +456,6 @@ export interface CheckoutModuleAPI extends Module {
636
456
  orderUuid?: string;
637
457
  response?: any;
638
458
  }>;
639
- /**
640
- * 检查订单是否需要手动同步(异步版本)
641
- *
642
- * 返回订单是否为纯代金券支付且待付金额<=0但未同步的状态
643
- * 从 Payment 模块获取最新的支付项数据
644
- */
645
- needsManualSyncAsync(): Promise<boolean>;
646
459
  /**
647
460
  * 更新订单备注
648
461
  *
@@ -680,20 +493,6 @@ export interface CheckoutModuleAPI extends Module {
680
493
  message?: string;
681
494
  orderId?: string;
682
495
  }>;
683
- /**
684
- * 更新订单商店折扣
685
- *
686
- * 同时更新cartSummary和localOrderData中的shop_discount值
687
- *
688
- * @param discountAmount 商店折扣金额
689
- */
690
- updateShopDiscountAsync(discountAmount: number): Promise<void>;
691
- /**
692
- * 获取当前商店折扣金额
693
- *
694
- * @returns 当前的商店折扣金额,如果没有则返回0
695
- */
696
- getShopDiscount(): number;
697
496
  /**
698
497
  * 保存订单并稍后支付
699
498
  *
@@ -764,18 +563,6 @@ export interface SendCustomerPayLinkParams {
764
563
  * 结账事件数据类型
765
564
  */
766
565
  export interface CheckoutEventData {
767
- /** 状态变更事件 */
768
- statusChanged: {
769
- oldStatus: CheckoutStatus;
770
- newStatus: CheckoutStatus;
771
- timestamp: number;
772
- };
773
- /** 步骤变更事件 */
774
- stepChanged: {
775
- oldStep: CheckoutStep;
776
- newStep: CheckoutStep;
777
- timestamp: number;
778
- };
779
566
  /** 订单创建事件 */
780
567
  orderCreated: {
781
568
  order: PaymentOrder;
@@ -20,30 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  var types_exports = {};
21
21
  __export(types_exports, {
22
22
  CheckoutErrorType: () => CheckoutErrorType,
23
- CheckoutHooks: () => CheckoutHooks,
24
- CheckoutStatus: () => CheckoutStatus,
25
- CheckoutStep: () => CheckoutStep
23
+ CheckoutHooks: () => CheckoutHooks
26
24
  });
27
25
  module.exports = __toCommonJS(types_exports);
28
- var CheckoutStatus = /* @__PURE__ */ ((CheckoutStatus2) => {
29
- CheckoutStatus2["Initializing"] = "initializing";
30
- CheckoutStatus2["Ready"] = "ready";
31
- CheckoutStatus2["CreatingOrder"] = "creating_order";
32
- CheckoutStatus2["OrderCreated"] = "order_created";
33
- CheckoutStatus2["ProcessingPayment"] = "processing_payment";
34
- CheckoutStatus2["PaymentCompleted"] = "payment_completed";
35
- CheckoutStatus2["Completed"] = "completed";
36
- CheckoutStatus2["Cancelled"] = "cancelled";
37
- CheckoutStatus2["Error"] = "error";
38
- return CheckoutStatus2;
39
- })(CheckoutStatus || {});
40
- var CheckoutStep = /* @__PURE__ */ ((CheckoutStep2) => {
41
- CheckoutStep2["OrderConfirmation"] = "order_confirmation";
42
- CheckoutStep2["PaymentMethod"] = "payment_method";
43
- CheckoutStep2["PaymentProcessing"] = "payment_processing";
44
- CheckoutStep2["Complete"] = "complete";
45
- return CheckoutStep2;
46
- })(CheckoutStep || {});
47
26
  var CheckoutErrorType = /* @__PURE__ */ ((CheckoutErrorType2) => {
48
27
  CheckoutErrorType2["OrderCreationFailed"] = "order_creation_failed";
49
28
  CheckoutErrorType2["PaymentFailed"] = "payment_failed";
@@ -54,8 +33,6 @@ var CheckoutErrorType = /* @__PURE__ */ ((CheckoutErrorType2) => {
54
33
  })(CheckoutErrorType || {});
55
34
  var CheckoutHooks = /* @__PURE__ */ ((CheckoutHooks2) => {
56
35
  CheckoutHooks2["OnCheckoutInitialized"] = "checkout:onInitialized";
57
- CheckoutHooks2["OnStatusChanged"] = "checkout:onStatusChanged";
58
- CheckoutHooks2["OnStepChanged"] = "checkout:onStepChanged";
59
36
  CheckoutHooks2["OnOrderCreated"] = "checkout:onOrderCreated";
60
37
  CheckoutHooks2["OnOrderCreationFailed"] = "checkout:onOrderCreationFailed";
61
38
  CheckoutHooks2["OnPaymentStarted"] = "checkout:onPaymentStarted";
@@ -76,12 +53,11 @@ var CheckoutHooks = /* @__PURE__ */ ((CheckoutHooks2) => {
76
53
  CheckoutHooks2["OnOrderSubmitStart"] = "checkout:onOrderSubmitStart";
77
54
  CheckoutHooks2["OnOrderSubmitEnd"] = "checkout:onOrderSubmitEnd";
78
55
  CheckoutHooks2["OnWalletDataInitialized"] = "checkout:onWalletDataInitialized";
56
+ CheckoutHooks2["OnPaymentItemAdded"] = "checkout:onPaymentItemAdded";
79
57
  return CheckoutHooks2;
80
58
  })(CheckoutHooks || {});
81
59
  // Annotate the CommonJS export names for ESM import in node:
82
60
  0 && (module.exports = {
83
61
  CheckoutErrorType,
84
- CheckoutHooks,
85
- CheckoutStatus,
86
- CheckoutStep
62
+ CheckoutHooks
87
63
  });
@@ -1,4 +1,4 @@
1
- import { CheckoutInitParams, CheckoutError, CheckoutErrorType, CheckoutStatus, CheckoutStep, LocalOrderData, CartSummaryItem, ExtractedAmountInfo } from '../types';
1
+ import { CheckoutInitParams, CheckoutError, CheckoutErrorType, LocalOrderData, CartSummaryItem, ExtractedAmountInfo } from '../types';
2
2
  import { CartItem } from '../../../modules/Cart/types';
3
3
  /**
4
4
  * 验证结账数据
@@ -11,10 +11,6 @@ export declare function validateCheckoutData(params: CheckoutInitParams): {
11
11
  * 创建结账错误对象
12
12
  */
13
13
  export declare function createCheckoutError(type: CheckoutErrorType, message: string, details?: any): CheckoutError;
14
- /**
15
- * 计算结账进度
16
- */
17
- export declare function calculateProgress(status: CheckoutStatus, step: CheckoutStep): number;
18
14
  /**
19
15
  * 格式化金额
20
16
  */
@@ -115,3 +111,11 @@ export declare function isVirtualOrderId(orderId: string): boolean;
115
111
  * @returns 是否需要同步订单
116
112
  */
117
113
  export declare function shouldSyncOrderForPayment(paymentCode: string, paymentType: string): boolean;
114
+ /**
115
+ * 判断是否为现金支付
116
+ *
117
+ * @param paymentCode 支付方式代码
118
+ * @param paymentType 支付方式类型
119
+ * @returns 是否为现金支付
120
+ */
121
+ export declare function isCashPayment(paymentCode?: string, paymentType?: string): boolean;
@@ -19,7 +19,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/solution/Checkout/utils/index.ts
20
20
  var utils_exports = {};
21
21
  __export(utils_exports, {
22
- calculateProgress: () => calculateProgress,
23
22
  calculateTotalAmount: () => calculateTotalAmount,
24
23
  createCheckoutError: () => createCheckoutError,
25
24
  debounce: () => debounce,
@@ -30,6 +29,7 @@ __export(utils_exports, {
30
29
  generateLocalOrderId: () => generateLocalOrderId,
31
30
  generateOrderId: () => generateOrderId,
32
31
  getErrorMessage: () => getErrorMessage,
32
+ isCashPayment: () => isCashPayment,
33
33
  isEmpty: () => isEmpty,
34
34
  isProduction: () => isProduction,
35
35
  isValidPaymentMethodCode: () => isValidPaymentMethodCode,
@@ -44,8 +44,7 @@ __export(utils_exports, {
44
44
  validateLocalOrderData: () => validateLocalOrderData
45
45
  });
46
46
  module.exports = __toCommonJS(utils_exports);
47
- var import_types = require("../types");
48
- var import_types2 = require("../../../modules/Payment/types");
47
+ var import_types = require("../../../modules/Payment/types");
49
48
  function validateCheckoutData(params) {
50
49
  const errors = [];
51
50
  if (!params.cartItems || params.cartItems.length === 0) {
@@ -83,54 +82,6 @@ function createCheckoutError(type, message, details) {
83
82
  timestamp: Date.now()
84
83
  };
85
84
  }
86
- function calculateProgress(status, step) {
87
- let baseProgress = 0;
88
- switch (status) {
89
- case import_types.CheckoutStatus.Initializing:
90
- baseProgress = 5;
91
- break;
92
- case import_types.CheckoutStatus.Ready:
93
- baseProgress = 10;
94
- break;
95
- case import_types.CheckoutStatus.CreatingOrder:
96
- baseProgress = 25;
97
- break;
98
- case import_types.CheckoutStatus.OrderCreated:
99
- baseProgress = 40;
100
- break;
101
- case import_types.CheckoutStatus.ProcessingPayment:
102
- baseProgress = 65;
103
- break;
104
- case import_types.CheckoutStatus.PaymentCompleted:
105
- baseProgress = 85;
106
- break;
107
- case import_types.CheckoutStatus.Completed:
108
- baseProgress = 100;
109
- break;
110
- case import_types.CheckoutStatus.Cancelled:
111
- case import_types.CheckoutStatus.Error:
112
- baseProgress = 0;
113
- break;
114
- default:
115
- baseProgress = 0;
116
- }
117
- let stepProgress = 0;
118
- switch (step) {
119
- case import_types.CheckoutStep.OrderConfirmation:
120
- stepProgress = 0;
121
- break;
122
- case import_types.CheckoutStep.PaymentMethod:
123
- stepProgress = 10;
124
- break;
125
- case import_types.CheckoutStep.PaymentProcessing:
126
- stepProgress = 15;
127
- break;
128
- case import_types.CheckoutStep.Complete:
129
- stepProgress = 0;
130
- break;
131
- }
132
- return Math.min(100, baseProgress + stepProgress);
133
- }
134
85
  function formatAmount(amount) {
135
86
  const numAmount = typeof amount === "string" ? parseFloat(amount) : amount;
136
87
  if (isNaN(numAmount))
@@ -367,7 +318,7 @@ function shouldSyncOrderForPayment(paymentCode, paymentType) {
367
318
  )) {
368
319
  return false;
369
320
  }
370
- if (paymentCode === import_types2.PaymentMethodType.Cash || paymentType === import_types2.PaymentMethodType.Cash) {
321
+ if (paymentCode === import_types.PaymentMethodType.Cash || paymentType === import_types.PaymentMethodType.Cash) {
371
322
  return false;
372
323
  }
373
324
  if (codeUpper.includes("CUSTOM") || typeUpper.includes("CUSTOM")) {
@@ -375,9 +326,16 @@ function shouldSyncOrderForPayment(paymentCode, paymentType) {
375
326
  }
376
327
  return true;
377
328
  }
329
+ function isCashPayment(paymentCode, paymentType) {
330
+ const codeUpper = (paymentCode == null ? void 0 : paymentCode.toUpperCase()) || "";
331
+ const typeUpper = (paymentType == null ? void 0 : paymentType.toUpperCase()) || "";
332
+ const cashIdentifiers = ["CASH", "CASHMANUAL", "MANUAL"];
333
+ return cashIdentifiers.some(
334
+ (identifier) => codeUpper.includes(identifier) || typeUpper.includes(identifier)
335
+ );
336
+ }
378
337
  // Annotate the CommonJS export names for ESM import in node:
379
338
  0 && (module.exports = {
380
- calculateProgress,
381
339
  calculateTotalAmount,
382
340
  createCheckoutError,
383
341
  debounce,
@@ -388,6 +346,7 @@ function shouldSyncOrderForPayment(paymentCode, paymentType) {
388
346
  generateLocalOrderId,
389
347
  generateOrderId,
390
348
  getErrorMessage,
349
+ isCashPayment,
391
350
  isEmpty,
392
351
  isProduction,
393
352
  isValidPaymentMethodCode,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "1.0.65",
4
+ "version": "1.0.67",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",