import PaymentMethod from './utils/payment'; export declare enum EVisibleButtonType { /** 取消按钮 */ CancelButton = "CancelButton", /** 等待按钮 */ WaitButton = "WaitButton" } export declare enum EActionStatus { /** 空 */ Empty = "Empty", /** 取消 */ Cancel = "Cancel", /** 取消中 */ CancelWaiting = "CancelWaiting", /** 签名 */ Signature = "Signature", /** 签名等待中 */ SignatureWaiting = "SignatureWaiting" } export declare const QUERY_START_DELAY: number; export declare const GLOBAL_TIMEOUT: number; export declare const REQUEST_TIMEOUT: number; export declare const QUERY_INTERVAL: number; /** * 聚合支付初始化参数 */ export interface PaymentMethodOptions { /** 支付类型 */ paymentCode: string; /** 交易号 */ paymentNum: string; /** 订单ID */ orderId?: string | number; /** 设备ID */ deviceId?: string | number; /** 统一回调函数 */ callback: PaymentCallback; /** 检查是否应该继续处理结果 */ shouldContinue?: () => boolean; /** 配置 */ config?: PaymentMethodConfig; } /** * 聚合支付操作类型 */ export declare enum ActionType { /** 支付 */ Pay = "pay", /** 支付查询 */ PayQuery = "payQuery", /** 支付行为 */ PayAction = "payAction", /** 退款 */ Refund = "refund", /** 退款查询 */ RefundQuery = "refundQuery", /** 退款行为 */ RefundAction = "refundAction" } /** 回调事件 */ export interface CallbackEvent { /** 事件类型:成功、失败、进度 */ status: EPaymentStatus; /** 操作类型 */ actionType: ActionType; /** 数据:成功时是结果,失败时是错误信息,进度时是进度数据 */ data: any; } /** 统一回调函数 */ export declare type PaymentCallback = (instance: PaymentMethod, event: CallbackEvent) => void; /** * 执行操作参数 */ export interface RunOptions { /** 操作类型 */ actionType: ActionType; /** 请求参数 */ params?: Record; /** 配置 */ config?: { /** 是否需要返回结果 */ needResponse?: boolean; }; } /** * 聚合支付配置参数 */ export interface PaymentMethodConfig { /** 是否需要轮询间隔 */ hasQueryInterval?: boolean; /** 全局轮询超时时间 */ globalQueryTimeout?: number; /** 接口兜底查询时间 */ requestDelaySeconds?: number; } /** * 支付状态 */ export declare enum EPaymentStatus { /** 支付中 */ Processing = "processing", /** 支付成功 */ Success = "success", /** 支付失败 */ Failed = "failed" } /** * 执行操作参数 */ export interface HooksRunParams { /** 付款码 */ authCode?: string | number; /** 订单支付ID */ orderPaymentId?: string | number; }