import { EPaymentStatus } from '../aggregatePayment/types'; /** 元素类型定义 */ 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; /** 支付状态 */ paymentStatus: EPaymentStatus; /** 接口返回的原始数据 */ 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 { /** 取消交易 */ CancelTransaction = "cancel_transaction", /** 交易完成 */ TransactionComplete = "transaction_complete", /** 重试交易 */ RetryTransaction = "retry_transaction", /** 打印商户收据 */ PrintMerchantReceipt = "print_merchant_receipt", /** 打印客户收据 */ PrintCustomerReceipt = "print_customer_receipt", /** 批准签名 */ ApproveSignature = "approve_signature", /** 拒绝签名 */ DeclineSignature = "decline_signature", /** 提交到API */ SubmitToAPI = "submit_to_api", /** 测试 */ CallTestFunction = "call_test_function" } /** * 操作行为超时时间 */ export declare const CANCEL_ACTION_TIMEOUT: number;