@pisell/pisellos 2.2.274 → 2.2.276
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.d.ts +2 -0
- package/dist/core/index.js +7 -0
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
- package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/dist/model/strategy/adapter/promotion/examples.js +99 -0
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +1 -1
- package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/dist/model/strategy/adapter/promotion/type.js +45 -0
- package/dist/modules/OpenData/index.d.ts +2 -0
- package/dist/modules/OpenData/index.js +8 -0
- package/dist/modules/Order/index.d.ts +28 -8
- package/dist/modules/Order/index.js +907 -588
- package/dist/modules/Order/payment-utils.d.ts +26 -0
- package/dist/modules/Order/payment-utils.js +225 -0
- package/dist/modules/Order/types.d.ts +35 -1
- package/dist/modules/Order/utils/orderCollectionIdentity.js +7 -2
- package/dist/modules/Order/utils.js +10 -6
- package/dist/modules/Payment/index.d.ts +2 -0
- package/dist/modules/Payment/index.js +78 -49
- package/dist/modules/Payment/types.d.ts +104 -25
- package/dist/modules/Payment/types.js +17 -0
- package/dist/modules/Payment/walletpass.d.ts +38 -1
- package/dist/modules/Payment/walletpass.js +917 -114
- package/dist/modules/Rules/index.d.ts +3 -0
- package/dist/modules/Rules/index.js +100 -70
- package/dist/server/index.d.ts +25 -0
- package/dist/server/index.js +1993 -1061
- package/dist/server/modules/index.d.ts +1 -1
- package/dist/server/modules/order/index.d.ts +70 -4
- package/dist/server/modules/order/index.js +1816 -728
- package/dist/server/modules/order/types.d.ts +25 -3
- package/dist/server/modules/order/types.js +7 -1
- package/dist/solution/BaseSales/index.d.ts +104 -5
- package/dist/solution/BaseSales/index.js +1767 -436
- package/dist/solution/BaseSales/types.d.ts +55 -1
- package/dist/solution/BaseSales/types.js +2 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/dist/solution/BaseSales/utils/cartPromotion.js +94 -32
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +7 -4
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +21 -5
- package/dist/solution/BookingTicket/index.js +139 -56
- package/dist/solution/BookingTicket/types.d.ts +1 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +173 -83
- package/dist/solution/Sales/index.d.ts +2 -0
- package/dist/solution/Sales/index.js +26 -4
- package/dist/solution/ScanOrder/index.js +31 -20
- package/dist/solution/VenueBooking/index.d.ts +1 -0
- package/dist/solution/VenueBooking/index.js +30 -19
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/payment-number.d.ts +9 -0
- package/dist/utils/payment-number.js +69 -0
- package/lib/core/index.d.ts +2 -0
- package/lib/core/index.js +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
- package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
- package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
- package/lib/model/strategy/adapter/promotion/examples.js +91 -0
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +2 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
- package/lib/model/strategy/adapter/promotion/type.js +2 -0
- package/lib/modules/OpenData/index.d.ts +2 -0
- package/lib/modules/OpenData/index.js +5 -0
- package/lib/modules/Order/index.d.ts +28 -8
- package/lib/modules/Order/index.js +252 -84
- package/lib/modules/Order/payment-utils.d.ts +26 -0
- package/lib/modules/Order/payment-utils.js +224 -0
- package/lib/modules/Order/types.d.ts +35 -1
- package/lib/modules/Order/utils/orderCollectionIdentity.js +3 -0
- package/lib/modules/Order/utils.js +11 -4
- package/lib/modules/Payment/index.d.ts +2 -0
- package/lib/modules/Payment/index.js +33 -12
- package/lib/modules/Payment/types.d.ts +104 -25
- package/lib/modules/Payment/types.js +1 -0
- package/lib/modules/Payment/walletpass.d.ts +38 -1
- package/lib/modules/Payment/walletpass.js +730 -21
- package/lib/modules/Rules/index.d.ts +3 -0
- package/lib/modules/Rules/index.js +38 -9
- package/lib/server/index.d.ts +25 -0
- package/lib/server/index.js +726 -31
- package/lib/server/modules/index.d.ts +1 -1
- package/lib/server/modules/order/index.d.ts +70 -4
- package/lib/server/modules/order/index.js +818 -69
- package/lib/server/modules/order/types.d.ts +25 -3
- package/lib/server/modules/order/types.js +1 -0
- package/lib/solution/BaseSales/index.d.ts +104 -5
- package/lib/solution/BaseSales/index.js +858 -27
- package/lib/solution/BaseSales/types.d.ts +55 -1
- package/lib/solution/BaseSales/types.js +2 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.js +66 -12
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +4 -3
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +21 -5
- package/lib/solution/BookingTicket/index.js +64 -13
- package/lib/solution/BookingTicket/types.d.ts +1 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +37 -5
- package/lib/solution/Sales/index.d.ts +2 -0
- package/lib/solution/Sales/index.js +20 -6
- package/lib/solution/ScanOrder/index.js +8 -0
- package/lib/solution/VenueBooking/index.d.ts +1 -0
- package/lib/solution/VenueBooking/index.js +8 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/utils/payment-number.d.ts +9 -0
- package/lib/utils/payment-number.js +64 -0
- package/package.json +1 -1
|
@@ -213,10 +213,12 @@ export interface OrderBookingItem {
|
|
|
213
213
|
[key: string]: unknown;
|
|
214
214
|
}[];
|
|
215
215
|
}
|
|
216
|
-
/** 支付记录 metadata
|
|
216
|
+
/** 支付记录 metadata */
|
|
217
217
|
export interface OrderPaymentMetadata {
|
|
218
|
-
/**
|
|
218
|
+
/** 三方支付交易流水号 */
|
|
219
219
|
unique_payment_number?: string;
|
|
220
|
+
/** 刷卡机设备快照;server 不解析内部字段,仅透传并持久化 */
|
|
221
|
+
card_reader_snapshot?: Record<string, unknown>;
|
|
220
222
|
[key: string]: unknown;
|
|
221
223
|
}
|
|
222
224
|
/**
|
|
@@ -225,6 +227,8 @@ export interface OrderPaymentMetadata {
|
|
|
225
227
|
export interface OrderPaymentItem {
|
|
226
228
|
/** 支付记录 ID;存量/更新时传。来源:OrderPayment.id */
|
|
227
229
|
order_payment_id?: number | null;
|
|
230
|
+
/** 支付项稳定唯一号;历史支付项允许缺失 */
|
|
231
|
+
payment_number?: string;
|
|
228
232
|
/** 支付方式 ID(设备端从本地支付方式配置取详情)。来源:OrderPayment.custom_payment_id */
|
|
229
233
|
custom_payment_id?: number;
|
|
230
234
|
/** 支付方式编码。来源:OrderPayment.payment_method */
|
|
@@ -249,11 +253,13 @@ export interface OrderPaymentItem {
|
|
|
249
253
|
created_at?: string | null;
|
|
250
254
|
/** 手续费配置。来源:OrderPayment.service_charge */
|
|
251
255
|
service_charge?: Record<string, unknown> | null;
|
|
256
|
+
/** 已计算的支付手续费。来源:OrderPayment.service_fee */
|
|
257
|
+
service_fee?: OrderMoneyString;
|
|
252
258
|
/** Wallet Pass 使用单位 */
|
|
253
259
|
wallet_pass_usage_unit?: unknown[] | null;
|
|
254
260
|
/** Wallet Pass 使用值 */
|
|
255
261
|
wallet_pass_use_value?: number | null;
|
|
256
|
-
/**
|
|
262
|
+
/** 元数据;三方支付成功后可含 unique_payment_number */
|
|
257
263
|
metadata?: OrderPaymentMetadata | null;
|
|
258
264
|
}
|
|
259
265
|
/**
|
|
@@ -413,6 +419,8 @@ export interface OrderData {
|
|
|
413
419
|
create_date?: string;
|
|
414
420
|
/** 本地待同步标记:1 表示需要后续同步到云端 */
|
|
415
421
|
need_sync?: 0 | 1 | number;
|
|
422
|
+
/** 本地草稿标记:1 表示仅为 POS 可恢复草稿,不代表已提交云端 */
|
|
423
|
+
is_draft_order?: 0 | 1 | number;
|
|
416
424
|
/** 兼容:部分场景仍使用顶层 total_amount */
|
|
417
425
|
total_amount?: OrderMoneyString | number;
|
|
418
426
|
/** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
|
|
@@ -560,6 +568,19 @@ export interface OrderChangedPayload {
|
|
|
560
568
|
/** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
|
|
561
569
|
source?: string;
|
|
562
570
|
}
|
|
571
|
+
export type RemoteProductMembershipChangeSource = 'pubsub.bodyUpsert' | 'pubsub.httpRefresh';
|
|
572
|
+
/**
|
|
573
|
+
* 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
|
|
574
|
+
* 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
|
|
575
|
+
*/
|
|
576
|
+
export interface RemoteProductMembershipChangedPayload {
|
|
577
|
+
order_id: OrderId;
|
|
578
|
+
source: RemoteProductMembershipChangeSource;
|
|
579
|
+
added_product_keys: string[];
|
|
580
|
+
removed_product_keys: string[];
|
|
581
|
+
previous_product_count: number;
|
|
582
|
+
current_product_count: number;
|
|
583
|
+
}
|
|
563
584
|
/**
|
|
564
585
|
* OrderSyncMessage - pubsub 同步消息结构
|
|
565
586
|
*/
|
|
@@ -597,5 +618,6 @@ export interface OrderState {
|
|
|
597
618
|
export declare enum OrderHooks {
|
|
598
619
|
onOrdersLoaded = "order:onOrdersLoaded",
|
|
599
620
|
onOrdersChanged = "order:onOrdersChanged",
|
|
621
|
+
onRemoteProductMembershipChanged = "order:onRemoteProductMembershipChanged",
|
|
600
622
|
onOrdersSyncCompleted = "order:onOrdersSyncCompleted"
|
|
601
623
|
}
|
|
@@ -25,6 +25,7 @@ module.exports = __toCommonJS(types_exports);
|
|
|
25
25
|
var OrderHooks = /* @__PURE__ */ ((OrderHooks2) => {
|
|
26
26
|
OrderHooks2["onOrdersLoaded"] = "order:onOrdersLoaded";
|
|
27
27
|
OrderHooks2["onOrdersChanged"] = "order:onOrdersChanged";
|
|
28
|
+
OrderHooks2["onRemoteProductMembershipChanged"] = "order:onRemoteProductMembershipChanged";
|
|
28
29
|
OrderHooks2["onOrdersSyncCompleted"] = "order:onOrdersSyncCompleted";
|
|
29
30
|
return OrderHooks2;
|
|
30
31
|
})(OrderHooks || {});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult } from './types';
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
-
import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions } from '../../modules/Order/types';
|
|
5
|
+
import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions } from '../../modules/Order/types';
|
|
6
6
|
import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
|
|
7
7
|
import type { Discount } from '../../modules/Discount/types';
|
|
8
8
|
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
9
9
|
export * from './types';
|
|
10
10
|
import { ProductList } from '../../modules/ProductList';
|
|
11
11
|
import { PaymentModule } from '../../modules/Payment';
|
|
12
|
-
import type { PaymentMethod, RoundingResult } from '../../modules/Payment/types';
|
|
12
|
+
import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsBehaviorOptions, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } from '../../modules/Payment/types';
|
|
13
13
|
import type { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
14
14
|
import type { ScheduleModule } from '../../modules/Schedule';
|
|
15
15
|
import { QuotationModule } from '../../modules/Quotation';
|
|
@@ -24,6 +24,19 @@ export interface BaseSalesState {
|
|
|
24
24
|
schedule?: ScheduleModule;
|
|
25
25
|
quotation?: QuotationModule;
|
|
26
26
|
}
|
|
27
|
+
export interface BaseSalesUpdateOrderPaymentOptions extends OrderPaymentUpdateOptions {
|
|
28
|
+
persistDraft?: boolean;
|
|
29
|
+
submitWhenPaid?: boolean;
|
|
30
|
+
forceSubmitIfPaid?: boolean;
|
|
31
|
+
/** 草稿恢复时,允许将新回调字段合并进已 paid 的支付项。 */
|
|
32
|
+
applyUpdatesWhenPaid?: boolean;
|
|
33
|
+
smallTicketDataFlag?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface BaseSalesUpdateOrderPaymentResult extends OrderPaymentUpdateResult {
|
|
36
|
+
draftResult?: unknown;
|
|
37
|
+
draftError?: unknown;
|
|
38
|
+
syncResult?: SyncPaymentsToOrderResult<any>;
|
|
39
|
+
}
|
|
27
40
|
export type BaseSalesPrintLocalOrderReceiptParams = string | number;
|
|
28
41
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
29
42
|
protected defaultName: string;
|
|
@@ -35,6 +48,11 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
35
48
|
protected store: BaseSalesState;
|
|
36
49
|
protected otherParams: Record<string, any>;
|
|
37
50
|
protected cacheId: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* 由已在初始化阶段解析过设备短号的业务解决方案写入。
|
|
53
|
+
* 未设置时,支付编号仍按原逻辑实时读取设备信息。
|
|
54
|
+
*/
|
|
55
|
+
protected paymentNumberDevicePrefix: string | null;
|
|
38
56
|
/**
|
|
39
57
|
* window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
|
|
40
58
|
* `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
|
|
@@ -51,6 +69,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
51
69
|
private autoPaymentSyncTimer;
|
|
52
70
|
private salesDetailLoadInFlightCount;
|
|
53
71
|
private salesDetailLoadSequence;
|
|
72
|
+
private walletAssetsRefreshSequence;
|
|
54
73
|
private salesDetailHydrateQueue;
|
|
55
74
|
private serverOrderChangeUnsubscribe;
|
|
56
75
|
private serverOrderChangeHydrateInFlight;
|
|
@@ -138,6 +157,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
138
157
|
*/
|
|
139
158
|
protected readSessionCacheData(): Record<string, any>;
|
|
140
159
|
protected getAppData<T>(key: string): T | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* 复用业务解决方案初始化时已解析的支付设备短号。
|
|
162
|
+
* 空值会清除缓存,使后续支付恢复实时读取设备信息的兼容路径。
|
|
163
|
+
*/
|
|
164
|
+
protected setPaymentNumberDevicePrefix(prefix: unknown): void;
|
|
165
|
+
private getPaymentNumberDevicePrefixSync;
|
|
166
|
+
private getPaymentNumberDevicePrefixAsync;
|
|
141
167
|
private syncAppDataToTempOrder;
|
|
142
168
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
143
169
|
destroy(): Promise<void>;
|
|
@@ -250,6 +276,13 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
250
276
|
confirmPendingVoucherPayments?: boolean;
|
|
251
277
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
252
278
|
}): Promise<T>;
|
|
279
|
+
saveSalesOrderDraft<T = any>(params?: {
|
|
280
|
+
platform?: string;
|
|
281
|
+
businessCode?: string;
|
|
282
|
+
channel?: string;
|
|
283
|
+
type?: string;
|
|
284
|
+
enhancePayload?: SubmitPayloadEnhancer;
|
|
285
|
+
}): Promise<T>;
|
|
253
286
|
submitTempOrderAsync<T = any>(params?: {
|
|
254
287
|
payments?: OrderPaymentSource[];
|
|
255
288
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -268,22 +301,64 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
268
301
|
private queueLatestAutoPaymentSync;
|
|
269
302
|
private scheduleQueuedAutoPaymentSyncFlush;
|
|
270
303
|
private flushQueuedAutoPaymentSync;
|
|
271
|
-
/**
|
|
304
|
+
/**
|
|
305
|
+
* 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
|
|
306
|
+
*/
|
|
272
307
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
308
|
+
/**
|
|
309
|
+
* 创建新支付项时优先使用业务解决方案初始化阶段缓存的设备短号;
|
|
310
|
+
* 未缓存的通用 BaseSales 保持实时读取设备信息的兼容语义。
|
|
311
|
+
*/
|
|
312
|
+
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
313
|
+
private addOrderPaymentWithDevicePrefix;
|
|
273
314
|
/** 更新当前订单中的指定支付项。 */
|
|
274
|
-
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any
|
|
315
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>, options?: BaseSalesUpdateOrderPaymentOptions): Promise<BaseSalesUpdateOrderPaymentResult>;
|
|
275
316
|
/** 删除当前订单中的指定支付项。 */
|
|
276
317
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
277
318
|
/** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
|
|
278
319
|
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
279
320
|
status?: 'paid' | 'payment_pending';
|
|
280
321
|
}): OrderPaymentData[];
|
|
322
|
+
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
323
|
+
status?: 'paid' | 'payment_pending';
|
|
324
|
+
}): Promise<OrderPaymentData[]>;
|
|
281
325
|
confirmPendingVoucherPayments(): OrderPaymentData[];
|
|
282
326
|
discardPendingVoucherPayments(): OrderPaymentData[];
|
|
283
327
|
private getWalletProductList;
|
|
328
|
+
private buildWalletInitBusinessData;
|
|
284
329
|
initWalletData(params?: {
|
|
285
330
|
order_wait_pay_amount?: number;
|
|
286
331
|
}): Promise<import("../../modules/Payment").WalletInitializationResult>;
|
|
332
|
+
private getCommittedWalletAssets;
|
|
333
|
+
private publishWalletAssetsState;
|
|
334
|
+
private syncSelectedWalletAssets;
|
|
335
|
+
/** 读取购物车与 Shared Checkout 共用的钱包资产状态。 */
|
|
336
|
+
getWalletAssetsState(): WalletAssetsState;
|
|
337
|
+
/** 导出 Shared Checkout 跨运行时恢复所需的钱包状态与搜索缓存。 */
|
|
338
|
+
exportWalletAssetsSnapshot(): WalletAssetsSnapshot;
|
|
339
|
+
/** 配置仅影响 Wallet Assets,不改变 Promotion/Voucher 选择流程。 */
|
|
340
|
+
configureWalletAssetsBehavior(options: WalletAssetsBehaviorOptions): void;
|
|
341
|
+
/**
|
|
342
|
+
* 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
|
|
343
|
+
*/
|
|
344
|
+
importWalletAssetsSnapshot(snapshot: WalletAssetsSnapshot): Promise<WalletAssetsState>;
|
|
345
|
+
/**
|
|
346
|
+
* 基于当前订单快照刷新钱包资产。商品变化保留并重验选择;客户变化强制清空。
|
|
347
|
+
*/
|
|
348
|
+
refreshWalletAssets(params?: {
|
|
349
|
+
order_wait_pay_amount?: number;
|
|
350
|
+
preserveSelection?: boolean;
|
|
351
|
+
}): Promise<WalletAssetsState>;
|
|
352
|
+
/** 选择或取消单张钱包资产,并立即同步 pending wallet payments。 */
|
|
353
|
+
selectWalletAsset(params: {
|
|
354
|
+
assetId: WalletAssetId;
|
|
355
|
+
selected: boolean;
|
|
356
|
+
source?: WalletAssetSelectionSource;
|
|
357
|
+
}): Promise<WalletAssetsState>;
|
|
358
|
+
/** 扫码精确查券;仅可用资产会被自动选中。 */
|
|
359
|
+
scanWalletAsset(code: string): Promise<ScanWalletAssetResult>;
|
|
360
|
+
/** 清空全部未确认钱包选择,已支付钱包项由 Order 模块继续保留。 */
|
|
361
|
+
clearWalletAssetSelection(): Promise<WalletAssetsState>;
|
|
287
362
|
/**
|
|
288
363
|
* 更新当前订单客户字段。
|
|
289
364
|
*
|
|
@@ -300,6 +375,30 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
300
375
|
getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
|
|
301
376
|
/** 同步读取初始化时缓存的支付方式列表。 */
|
|
302
377
|
getPaymentMethods(): PaymentMethod[];
|
|
378
|
+
private findCashPaymentMethod;
|
|
379
|
+
private getPendingWalletPaymentAmount;
|
|
380
|
+
/** 读取现金 action 所需的支付方式、待付金额和快捷金额。 */
|
|
381
|
+
getCashPaymentConfig(): Promise<BaseSalesCashPaymentConfig>;
|
|
382
|
+
/**
|
|
383
|
+
* 确认足额覆盖订单的 pending Wallet 支付并提交订单。
|
|
384
|
+
*
|
|
385
|
+
* Order 模块在构造提交参数时将 pending voucher 转为 paid;只有提交成功后
|
|
386
|
+
* 才同步 Wallet committed 状态。失败时恢复调用前 payments,允许用户重试。
|
|
387
|
+
*/
|
|
388
|
+
confirmWalletPayment<T = Record<string, any>>(): Promise<BaseSalesConfirmWalletPaymentResult<T>>;
|
|
389
|
+
/**
|
|
390
|
+
* 购物车现金直付:写入现金记录并等待支付同步完成。
|
|
391
|
+
* 同步失败会恢复调用前 payments(包含 Wallet pending 状态)。
|
|
392
|
+
*/
|
|
393
|
+
payCash(params: BaseSalesPayCashParams): Promise<BaseSalesPayCashResult>;
|
|
394
|
+
/**
|
|
395
|
+
* 提交一次已由支付设备确认成功的非 Wallet 支付。
|
|
396
|
+
*
|
|
397
|
+
* 与 addOrderPayment 不同,本入口不会启动后台 fire-and-forget 同步;调用方会等待
|
|
398
|
+
* 本次 payment、当前 pending Wallet 以及订单提交共同完成。任何同步失败都会恢复
|
|
399
|
+
* 调用前的 payments 与 payment_status,便于 UI 安全解锁并重试。
|
|
400
|
+
*/
|
|
401
|
+
commitPaymentMethodPayment(params: BaseSalesCommitPaymentMethodParams): Promise<BaseSalesCommitPaymentMethodResult>;
|
|
303
402
|
/**
|
|
304
403
|
* 按当前店铺的现金舍入配置计算金额,供现金支付 UI 使用。
|
|
305
404
|
*
|