@pisell/pisellos 0.0.234 → 0.0.235

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 (31) hide show
  1. package/dist/modules/Payment/index.d.ts +3 -3
  2. package/dist/modules/Payment/index.js +74 -10
  3. package/dist/modules/Payment/types.d.ts +24 -3
  4. package/dist/modules/Payment/types.js +9 -1
  5. package/dist/modules/Payment/utils.js +1 -1
  6. package/dist/modules/Payment/walletpass.d.ts +5 -2
  7. package/dist/modules/Payment/walletpass.js +63 -11
  8. package/dist/solution/BookingTicket/index.d.ts +9 -1
  9. package/dist/solution/BookingTicket/index.js +27 -3
  10. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +6 -0
  11. package/dist/solution/BookingTicket/utils/scan/handleScan.js +43 -28
  12. package/dist/solution/Checkout/index.d.ts +50 -7
  13. package/dist/solution/Checkout/index.js +890 -474
  14. package/dist/solution/Checkout/types.d.ts +69 -3
  15. package/dist/solution/Checkout/types.js +5 -0
  16. package/lib/modules/Payment/index.d.ts +3 -3
  17. package/lib/modules/Payment/index.js +30 -5
  18. package/lib/modules/Payment/types.d.ts +24 -3
  19. package/lib/modules/Payment/types.js +1 -1
  20. package/lib/modules/Payment/utils.js +1 -1
  21. package/lib/modules/Payment/walletpass.d.ts +5 -2
  22. package/lib/modules/Payment/walletpass.js +30 -2
  23. package/lib/solution/BookingTicket/index.d.ts +9 -1
  24. package/lib/solution/BookingTicket/index.js +23 -2
  25. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +6 -0
  26. package/lib/solution/BookingTicket/utils/scan/handleScan.js +21 -14
  27. package/lib/solution/Checkout/index.d.ts +50 -7
  28. package/lib/solution/Checkout/index.js +267 -92
  29. package/lib/solution/Checkout/types.d.ts +69 -3
  30. package/lib/solution/Checkout/types.js +1 -0
  31. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
3
  import { OrderModule } from '../../modules/Order';
4
4
  import { PaymentModule } from '../../modules/Payment';
5
- import { CheckoutModuleAPI, CheckoutStep, CheckoutInitParams, CreateLocalOrderParams, PlaceOrderParams, CreateOrderParams, ProcessPaymentParams, CheckoutStatusInfo, CheckoutSummary, CurrentOrderInfo, CartSummaryItem, ExtractedAmountInfo } from './types';
5
+ import { CheckoutModuleAPI, CheckoutStep, CheckoutInitParams, CreateLocalOrderParams, PlaceOrderParams, CreateOrderParams, ProcessPaymentParams, CheckoutStatusInfo, CheckoutSummary, CurrentOrderInfo, CartSummaryItem, ExtractedAmountInfo, SendCustomerPayLinkParams } from './types';
6
6
  import { PaymentOrder, PaymentMethod, PaymentItem, PaymentItemInput } from '../../modules/Payment/types';
7
7
  export * from './types';
8
8
  /**
@@ -251,11 +251,12 @@ export declare class CheckoutImpl extends BaseModule implements Module, Checkout
251
251
  customer_name?: string;
252
252
  } | null;
253
253
  /**
254
- * 检查订单是否需要手动同步
254
+ * 检查订单是否需要手动同步(异步版本)
255
255
  *
256
256
  * 返回订单是否为纯代金券支付且待付金额<=0但未同步的状态
257
+ * 从 Payment 模块获取最新的支付项数据
257
258
  */
258
- needsManualSync(): boolean;
259
+ needsManualSyncAsync(): Promise<boolean>;
259
260
  /**
260
261
  * 手动同步订单到后端
261
262
  *
@@ -279,6 +280,25 @@ export declare class CheckoutImpl extends BaseModule implements Module, Checkout
279
280
  * @returns 当前订单的ID,如果没有订单则返回null
280
281
  */
281
282
  getCurrentOrderId(): string | null;
283
+ /**
284
+ * 获取当前订单是否已同步到后端
285
+ *
286
+ * @returns 当前订单是否已同步状态,如果没有订单则返回false
287
+ */
288
+ isCurrentOrderSynced(): boolean;
289
+ /**
290
+ * 取消当前本地订单
291
+ *
292
+ * 只能取消未同步到后端的本地订单,如果订单已同步则不能取消
293
+ *
294
+ * @param cancelReason 取消原因(可选)
295
+ * @returns 取消结果
296
+ */
297
+ cancelCurrentOrderAsync(cancelReason?: string): Promise<{
298
+ success: boolean;
299
+ message?: string;
300
+ orderId?: string;
301
+ }>;
282
302
  /**
283
303
  * 保存订单并稍后支付
284
304
  *
@@ -363,13 +383,13 @@ export declare class CheckoutImpl extends BaseModule implements Module, Checkout
363
383
  */
364
384
  private calculateTotalAmount;
365
385
  /**
366
- * 计算已支付金额
386
+ * 计算已支付金额(从 Payment 模块获取最新数据)
367
387
  */
368
- private calculatePaidAmount;
388
+ private calculatePaidAmountAsync;
369
389
  /**
370
- * 计算剩余未支付金额
390
+ * 计算剩余未支付金额(从 Payment 模块获取最新数据)
371
391
  */
372
- private calculateRemainingAmount;
392
+ private calculateRemainingAmountAsync;
373
393
  /**
374
394
  * 更新 stateAmount 为当前剩余未支付金额
375
395
  */
@@ -432,5 +452,28 @@ export declare class CheckoutImpl extends BaseModule implements Module, Checkout
432
452
  message?: string;
433
453
  orderId?: string | number;
434
454
  }>;
455
+ /**
456
+ * 发送客户支付链接邮件
457
+ *
458
+ * 向指定邮箱发送订单支付提醒邮件
459
+ *
460
+ * @param params 发送参数
461
+ * @returns 发送结果
462
+ */
463
+ sendCustomerPayLinkAsync(params: SendCustomerPayLinkParams): Promise<{
464
+ success: boolean;
465
+ message?: string;
466
+ }>;
467
+ /**
468
+ * 金额舍入
469
+ *
470
+ * @param amount 原始金额
471
+ * @returns 舍入结果详情,包含原始金额、舍入后金额和舍入差额
472
+ */
473
+ roundAmountAsync(amount: number): Promise<{
474
+ originalAmount: string;
475
+ roundedAmount: string;
476
+ roundingDifference: string;
477
+ }>;
435
478
  destroy(): Promise<void>;
436
479
  }