/** * 支付状态 */ export declare enum ESettlementStatus { /** 结算中 */ Processing = "processing", /** 结算成功 */ Success = "success", /** 结算失败 */ Failed = "failed" } /** 元素类型定义 */ export interface ElementType { label: string; key: string; } /** 布局类型定义 */ export interface LayoutType { type: string; elements: ElementType[]; } /** 元素属性定义 */ export interface ElementProperty { type: 'button' | 'text' | 'image' | 'input'; submit_url: string; action: string | null; text?: string | null; name?: string | null; data?: string | null; encoding?: string | null; } /** Action Form 定义 */ export interface ActionFormType { layout: LayoutType[]; properties: { [key: string]: ElementProperty; }; details: { [key: string]: string; }; } /** POS 指令定义 */ export interface PosInstructions { auto_actions: any; action_form: ActionFormType | null; } /** MX51 参数定义 */ export interface MX51Params { id: string; version: number; status: string; message: string; merchant_receipt: string | null; customer_receipt: string | null; result_amounts: any; result_financial_status: string | null; pos_instructions: PosInstructions | null; } /** 解析后的按钮配置 */ export interface ParsedElement { /** 元素键 */ key: string; /** 元素标签 */ label: string; /** 提交URL */ submitUrl: string; /** 按钮动作 */ action: string | null; /** 元素类型 */ type: 'button' | 'text'; /** 文本信息 */ text?: string | null; /** 小票信息 */ receipt?: string | null; /** 额外信息 */ _extra?: { /** 商户收据 */ merchantReceipt?: string | null; /** 客户收据 */ customerReceipt?: string | null; /** 结算状态 */ settlementStatus: ESettlementStatus; /** 接口返回的原始数据 */ response: any; }; /** 图片信息 */ image?: { name?: string | null; data?: string | null; encoding?: string | null; }; } /** 解析后的布局配置 */ export interface ParsedLayout { /** 布局类型,如 horizontal_layout */ layoutType: string; /** 该布局中的按钮列表 */ elements: ParsedElement[]; } /** 解析后的结果 */ export interface ParsedMX51Result { /** 交易ID */ transactionId: string; /** 版本号 */ version: number; /** 状态 */ status: string; /** 提示信息 */ message: string; /** 商户收据 */ merchantReceipt: string | null; /** 客户收据 */ customerReceipt: string | null; /** 结果金额 */ resultAmounts: any; /** 结果财务状态 */ resultFinancialStatus: string | null; /** 布局列表,每个布局包含其类型和按钮 */ layouts: ParsedLayout[]; /** 详情信息 */ details: { [key: string]: string; }; /** 详情信息 text */ detailsText: string; /** 自动操作 */ autoAction: Array | null; } export declare enum EButtonKeyType { /** 打印客户收据 */ PrintCustomerReceipt = "print_customer_receipt", /** 打印商户收据 */ PrintMerchantReceipt = "print_merchant_receipt", /** 结算完成 */ SettlementComplete = "settlement_complete", /** 重试结算 */ RetrySettlement = "retry_settlement" }