@pisell/pisellos 2.2.277 → 2.2.800
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 +0 -2
- package/dist/core/index.js +1 -7
- package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
- package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
- package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/dist/model/strategy/adapter/promotion/examples.js +0 -99
- package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/dist/model/strategy/adapter/promotion/type.js +0 -45
- package/dist/model/strategy/adapter/walletPass/evaluator.js +2 -0
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -5
- package/dist/model/strategy/adapter/walletPass/utils.js +26 -57
- package/dist/modules/OpenData/index.d.ts +0 -2
- package/dist/modules/OpenData/index.js +0 -8
- package/dist/modules/Order/index.d.ts +8 -28
- package/dist/modules/Order/index.js +496 -808
- package/dist/modules/Order/types.d.ts +1 -35
- package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
- package/dist/modules/Order/utils.js +6 -10
- package/dist/modules/Payment/index.d.ts +0 -2
- package/dist/modules/Payment/index.js +49 -78
- package/dist/modules/Payment/types.d.ts +25 -106
- package/dist/modules/Payment/types.js +0 -17
- package/dist/modules/Payment/utils.js +1 -4
- package/dist/modules/Payment/walletpass.d.ts +1 -49
- package/dist/modules/Payment/walletpass.js +124 -1081
- package/dist/modules/Rules/index.d.ts +0 -3
- package/dist/modules/Rules/index.js +70 -100
- package/dist/server/index.d.ts +0 -25
- package/dist/server/index.js +1069 -2001
- package/dist/server/modules/index.d.ts +1 -1
- package/dist/server/modules/order/index.d.ts +4 -70
- package/dist/server/modules/order/index.js +728 -1816
- package/dist/server/modules/order/types.d.ts +3 -25
- package/dist/server/modules/order/types.js +1 -7
- package/dist/server/utils/small-ticket.js +2 -1
- package/dist/solution/BaseSales/index.d.ts +5 -109
- package/dist/solution/BaseSales/index.js +436 -1802
- package/dist/solution/BaseSales/types.d.ts +1 -55
- package/dist/solution/BaseSales/types.js +1 -2
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/dist/solution/BaseSales/utils/cartPromotion.js +31 -90
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +4 -7
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +5 -21
- package/dist/solution/BookingTicket/index.js +56 -139
- package/dist/solution/BookingTicket/types.d.ts +0 -1
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +83 -173
- package/dist/solution/Sales/index.d.ts +0 -2
- package/dist/solution/Sales/index.js +4 -26
- package/dist/solution/ScanOrder/index.js +20 -31
- package/dist/solution/VenueBooking/index.d.ts +0 -1
- package/dist/solution/VenueBooking/index.js +19 -30
- package/dist/types/index.d.ts +0 -1
- package/lib/core/index.d.ts +0 -2
- package/lib/core/index.js +1 -4
- package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
- package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
- package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
- package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
- package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
- package/lib/model/strategy/adapter/promotion/examples.js +0 -91
- package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
- package/lib/model/strategy/adapter/promotion/type.js +0 -2
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -5
- package/lib/model/strategy/adapter/walletPass/utils.js +11 -62
- package/lib/modules/OpenData/index.d.ts +0 -2
- package/lib/modules/OpenData/index.js +0 -5
- package/lib/modules/Order/index.d.ts +8 -28
- package/lib/modules/Order/index.js +69 -231
- package/lib/modules/Order/types.d.ts +1 -35
- package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
- package/lib/modules/Order/utils.js +4 -11
- package/lib/modules/Payment/index.d.ts +0 -2
- package/lib/modules/Payment/index.js +12 -33
- package/lib/modules/Payment/types.d.ts +25 -106
- package/lib/modules/Payment/types.js +0 -1
- package/lib/modules/Payment/utils.js +1 -5
- package/lib/modules/Payment/walletpass.d.ts +1 -49
- package/lib/modules/Payment/walletpass.js +22 -898
- package/lib/modules/Rules/index.d.ts +0 -3
- package/lib/modules/Rules/index.js +9 -38
- package/lib/server/index.d.ts +0 -25
- package/lib/server/index.js +31 -726
- package/lib/server/modules/index.d.ts +1 -1
- package/lib/server/modules/order/index.d.ts +4 -70
- package/lib/server/modules/order/index.js +69 -818
- package/lib/server/modules/order/types.d.ts +3 -25
- package/lib/server/modules/order/types.js +0 -1
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BaseSales/index.d.ts +5 -109
- package/lib/solution/BaseSales/index.js +27 -874
- package/lib/solution/BaseSales/types.d.ts +1 -55
- package/lib/solution/BaseSales/types.js +1 -2
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
- package/lib/solution/BaseSales/utils/cartPromotion.js +12 -63
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -4
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +5 -21
- package/lib/solution/BookingTicket/index.js +13 -64
- package/lib/solution/BookingTicket/types.d.ts +0 -1
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -8
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +5 -37
- package/lib/solution/Sales/index.d.ts +0 -2
- package/lib/solution/Sales/index.js +6 -20
- package/lib/solution/ScanOrder/index.js +0 -8
- package/lib/solution/VenueBooking/index.d.ts +0 -1
- package/lib/solution/VenueBooking/index.js +0 -8
- package/lib/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/modules/Order/payment-utils.d.ts +0 -26
- package/dist/modules/Order/payment-utils.js +0 -225
- package/dist/utils/payment-number.d.ts +0 -9
- package/dist/utils/payment-number.js +0 -69
- package/lib/modules/Order/payment-utils.d.ts +0 -26
- package/lib/modules/Order/payment-utils.js +0 -224
- package/lib/utils/payment-number.d.ts +0 -9
- package/lib/utils/payment-number.js +0 -64
|
@@ -213,12 +213,10 @@ export interface OrderBookingItem {
|
|
|
213
213
|
[key: string]: unknown;
|
|
214
214
|
}[];
|
|
215
215
|
}
|
|
216
|
-
/** 支付记录 metadata */
|
|
216
|
+
/** 支付记录 metadata,常含 unique_payment_number */
|
|
217
217
|
export interface OrderPaymentMetadata {
|
|
218
|
-
/**
|
|
218
|
+
/** 设备端本地支付唯一标识 */
|
|
219
219
|
unique_payment_number?: string;
|
|
220
|
-
/** 刷卡机设备快照;server 不解析内部字段,仅透传并持久化 */
|
|
221
|
-
card_reader_snapshot?: Record<string, unknown>;
|
|
222
220
|
[key: string]: unknown;
|
|
223
221
|
}
|
|
224
222
|
/**
|
|
@@ -227,8 +225,6 @@ export interface OrderPaymentMetadata {
|
|
|
227
225
|
export interface OrderPaymentItem {
|
|
228
226
|
/** 支付记录 ID;存量/更新时传。来源:OrderPayment.id */
|
|
229
227
|
order_payment_id?: number | null;
|
|
230
|
-
/** 支付项稳定唯一号;历史支付项允许缺失 */
|
|
231
|
-
payment_number?: string;
|
|
232
228
|
/** 支付方式 ID(设备端从本地支付方式配置取详情)。来源:OrderPayment.custom_payment_id */
|
|
233
229
|
custom_payment_id?: number;
|
|
234
230
|
/** 支付方式编码。来源:OrderPayment.payment_method */
|
|
@@ -253,13 +249,11 @@ export interface OrderPaymentItem {
|
|
|
253
249
|
created_at?: string | null;
|
|
254
250
|
/** 手续费配置。来源:OrderPayment.service_charge */
|
|
255
251
|
service_charge?: Record<string, unknown> | null;
|
|
256
|
-
/** 已计算的支付手续费。来源:OrderPayment.service_fee */
|
|
257
|
-
service_fee?: OrderMoneyString;
|
|
258
252
|
/** Wallet Pass 使用单位 */
|
|
259
253
|
wallet_pass_usage_unit?: unknown[] | null;
|
|
260
254
|
/** Wallet Pass 使用值 */
|
|
261
255
|
wallet_pass_use_value?: number | null;
|
|
262
|
-
/**
|
|
256
|
+
/** 元数据;含 unique_payment_number。来源:OrderPayment.metadata */
|
|
263
257
|
metadata?: OrderPaymentMetadata | null;
|
|
264
258
|
}
|
|
265
259
|
/**
|
|
@@ -419,8 +413,6 @@ export interface OrderData {
|
|
|
419
413
|
create_date?: string;
|
|
420
414
|
/** 本地待同步标记:1 表示需要后续同步到云端 */
|
|
421
415
|
need_sync?: 0 | 1 | number;
|
|
422
|
-
/** 本地草稿标记:1 表示仅为 POS 可恢复草稿,不代表已提交云端 */
|
|
423
|
-
is_draft_order?: 0 | 1 | number;
|
|
424
416
|
/** 兼容:部分场景仍使用顶层 total_amount */
|
|
425
417
|
total_amount?: OrderMoneyString | number;
|
|
426
418
|
/** 扩展字段(物流、标签等);使用 any 以便筛选与数据源扩展 */
|
|
@@ -568,19 +560,6 @@ export interface OrderChangedPayload {
|
|
|
568
560
|
/** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
|
|
569
561
|
source?: string;
|
|
570
562
|
}
|
|
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
|
-
}
|
|
584
563
|
/**
|
|
585
564
|
* OrderSyncMessage - pubsub 同步消息结构
|
|
586
565
|
*/
|
|
@@ -618,6 +597,5 @@ export interface OrderState {
|
|
|
618
597
|
export declare enum OrderHooks {
|
|
619
598
|
onOrdersLoaded = "order:onOrdersLoaded",
|
|
620
599
|
onOrdersChanged = "order:onOrdersChanged",
|
|
621
|
-
onRemoteProductMembershipChanged = "order:onRemoteProductMembershipChanged",
|
|
622
600
|
onOrdersSyncCompleted = "order:onOrdersSyncCompleted"
|
|
623
601
|
}
|
|
@@ -25,7 +25,6 @@ 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";
|
|
29
28
|
OrderHooks2["onOrdersSyncCompleted"] = "order:onOrdersSyncCompleted";
|
|
30
29
|
return OrderHooks2;
|
|
31
30
|
})(OrderHooks || {});
|
|
@@ -562,7 +562,7 @@ function buildOptionTitleSuffix(options) {
|
|
|
562
562
|
function formatBundlePrice(bundle, currencySymbol) {
|
|
563
563
|
const value = bundle.bundle_selling_price ?? bundle.bundle_sum_price ?? bundle.price ?? 0;
|
|
564
564
|
const amount = new import_decimal.default(toMoneyNumber(value));
|
|
565
|
-
const isNegative = bundle.price_type === "markdown"
|
|
565
|
+
const isNegative = bundle.price_type === "markdown";
|
|
566
566
|
if (isNegative)
|
|
567
567
|
return `-${currencySymbol}${amount.abs().toFixed(2)}`;
|
|
568
568
|
return formatMoney(amount, currencySymbol);
|
|
@@ -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
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
-
import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData,
|
|
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';
|
|
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
|
|
12
|
+
import type { PaymentMethod, RoundingResult } 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,19 +24,6 @@ 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
|
-
}
|
|
40
27
|
export type BaseSalesPrintLocalOrderReceiptParams = string | number;
|
|
41
28
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
42
29
|
protected defaultName: string;
|
|
@@ -48,11 +35,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
48
35
|
protected store: BaseSalesState;
|
|
49
36
|
protected otherParams: Record<string, any>;
|
|
50
37
|
protected cacheId: string | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* 由已在初始化阶段解析过设备短号的业务解决方案写入。
|
|
53
|
-
* 未设置时,支付编号仍按原逻辑实时读取设备信息。
|
|
54
|
-
*/
|
|
55
|
-
protected paymentNumberDevicePrefix: string | null;
|
|
56
38
|
/**
|
|
57
39
|
* window / request 暴露为 public:现存外部工具(如 BookingTicket Scan)通过
|
|
58
40
|
* `solution.window` / `solution.request` 直接访问插件,保持原有契约不破坏。
|
|
@@ -69,7 +51,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
69
51
|
private autoPaymentSyncTimer;
|
|
70
52
|
private salesDetailLoadInFlightCount;
|
|
71
53
|
private salesDetailLoadSequence;
|
|
72
|
-
private walletAssetsRefreshSequence;
|
|
73
54
|
private salesDetailHydrateQueue;
|
|
74
55
|
private serverOrderChangeUnsubscribe;
|
|
75
56
|
private serverOrderChangeHydrateInFlight;
|
|
@@ -157,13 +138,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
157
138
|
*/
|
|
158
139
|
protected readSessionCacheData(): Record<string, any>;
|
|
159
140
|
protected getAppData<T>(key: string): T | undefined;
|
|
160
|
-
/**
|
|
161
|
-
* 复用业务解决方案初始化时已解析的支付设备短号。
|
|
162
|
-
* 空值会清除缓存,使后续支付恢复实时读取设备信息的兼容路径。
|
|
163
|
-
*/
|
|
164
|
-
protected setPaymentNumberDevicePrefix(prefix: unknown): void;
|
|
165
|
-
private getPaymentNumberDevicePrefixSync;
|
|
166
|
-
private getPaymentNumberDevicePrefixAsync;
|
|
167
141
|
private syncAppDataToTempOrder;
|
|
168
142
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
169
143
|
destroy(): Promise<void>;
|
|
@@ -276,13 +250,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
276
250
|
confirmPendingVoucherPayments?: boolean;
|
|
277
251
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
278
252
|
}): 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>;
|
|
286
253
|
submitTempOrderAsync<T = any>(params?: {
|
|
287
254
|
payments?: OrderPaymentSource[];
|
|
288
255
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -301,69 +268,22 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
301
268
|
private queueLatestAutoPaymentSync;
|
|
302
269
|
private scheduleQueuedAutoPaymentSyncFlush;
|
|
303
270
|
private flushQueuedAutoPaymentSync;
|
|
304
|
-
/**
|
|
305
|
-
* 同步兼容入口。无法等待 IoT 短号时,按调用当下的 device_id 或 LOCAL 生成。
|
|
306
|
-
*/
|
|
271
|
+
/** 追加单个支付项到当前订单。 */
|
|
307
272
|
addOrderPayment(payment: OrderPaymentSource): OrderPaymentData[];
|
|
308
|
-
/**
|
|
309
|
-
* 创建新支付项时优先使用业务解决方案初始化阶段缓存的设备短号;
|
|
310
|
-
* 未缓存的通用 BaseSales 保持实时读取设备信息的兼容语义。
|
|
311
|
-
*/
|
|
312
|
-
addOrderPaymentAsync(payment: OrderPaymentSource): Promise<OrderPaymentData[]>;
|
|
313
|
-
private addOrderPaymentWithDevicePrefix;
|
|
314
273
|
/** 更新当前订单中的指定支付项。 */
|
|
315
|
-
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any
|
|
274
|
+
updateOrderPayment(paymentIdentity: string | number, updates: Partial<OrderPaymentData> & Record<string, any>): OrderPaymentData[];
|
|
316
275
|
/** 删除当前订单中的指定支付项。 */
|
|
317
276
|
deleteOrderPayment(paymentIdentity: string | number): OrderPaymentData[];
|
|
318
277
|
/** 覆盖 wallet pass 支付项,同时保留普通支付项。 */
|
|
319
278
|
updateVoucherOrderPayments(payments: OrderPaymentSource[], options?: {
|
|
320
279
|
status?: 'paid' | 'payment_pending';
|
|
321
280
|
}): OrderPaymentData[];
|
|
322
|
-
updateVoucherOrderPaymentsAsync(payments: OrderPaymentSource[], options?: {
|
|
323
|
-
status?: 'paid' | 'payment_pending';
|
|
324
|
-
}): Promise<OrderPaymentData[]>;
|
|
325
281
|
confirmPendingVoucherPayments(): OrderPaymentData[];
|
|
326
282
|
discardPendingVoucherPayments(): OrderPaymentData[];
|
|
327
283
|
private getWalletProductList;
|
|
328
|
-
private buildWalletInitBusinessData;
|
|
329
284
|
initWalletData(params?: {
|
|
330
285
|
order_wait_pay_amount?: number;
|
|
331
286
|
}): 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
|
-
/** 更新已选钱包资产的手动使用金额,并同步 pending payment。 */
|
|
359
|
-
updateWalletAssetAmount(params: {
|
|
360
|
-
assetId: WalletAssetId;
|
|
361
|
-
amount: number;
|
|
362
|
-
}): Promise<WalletAssetsState>;
|
|
363
|
-
/** 扫码精确查券;仅可用资产会被自动选中。 */
|
|
364
|
-
scanWalletAsset(code: string): Promise<ScanWalletAssetResult>;
|
|
365
|
-
/** 清空全部未确认钱包选择,已支付钱包项由 Order 模块继续保留。 */
|
|
366
|
-
clearWalletAssetSelection(): Promise<WalletAssetsState>;
|
|
367
287
|
/**
|
|
368
288
|
* 更新当前订单客户字段。
|
|
369
289
|
*
|
|
@@ -380,30 +300,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
380
300
|
getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
|
|
381
301
|
/** 同步读取初始化时缓存的支付方式列表。 */
|
|
382
302
|
getPaymentMethods(): PaymentMethod[];
|
|
383
|
-
private findCashPaymentMethod;
|
|
384
|
-
private getPendingWalletPaymentAmount;
|
|
385
|
-
/** 读取现金 action 所需的支付方式、待付金额和快捷金额。 */
|
|
386
|
-
getCashPaymentConfig(): Promise<BaseSalesCashPaymentConfig>;
|
|
387
|
-
/**
|
|
388
|
-
* 确认足额覆盖订单的 pending Wallet 支付并提交订单。
|
|
389
|
-
*
|
|
390
|
-
* Order 模块在构造提交参数时将 pending voucher 转为 paid;只有提交成功后
|
|
391
|
-
* 才同步 Wallet committed 状态。失败时恢复调用前 payments,允许用户重试。
|
|
392
|
-
*/
|
|
393
|
-
confirmWalletPayment<T = Record<string, any>>(): Promise<BaseSalesConfirmWalletPaymentResult<T>>;
|
|
394
|
-
/**
|
|
395
|
-
* 购物车现金直付:写入现金记录并等待支付同步完成。
|
|
396
|
-
* 同步失败会恢复调用前 payments(包含 Wallet pending 状态)。
|
|
397
|
-
*/
|
|
398
|
-
payCash(params: BaseSalesPayCashParams): Promise<BaseSalesPayCashResult>;
|
|
399
|
-
/**
|
|
400
|
-
* 提交一次已由支付设备确认成功的非 Wallet 支付。
|
|
401
|
-
*
|
|
402
|
-
* 与 addOrderPayment 不同,本入口不会启动后台 fire-and-forget 同步;调用方会等待
|
|
403
|
-
* 本次 payment、当前 pending Wallet 以及订单提交共同完成。任何同步失败都会恢复
|
|
404
|
-
* 调用前的 payments 与 payment_status,便于 UI 安全解锁并重试。
|
|
405
|
-
*/
|
|
406
|
-
commitPaymentMethodPayment(params: BaseSalesCommitPaymentMethodParams): Promise<BaseSalesCommitPaymentMethodResult>;
|
|
407
303
|
/**
|
|
408
304
|
* 按当前店铺的现金舍入配置计算金额,供现金支付 UI 使用。
|
|
409
305
|
*
|