import type { Currency, TransactionType, BaseResponse } from './common.js'; /** * Purchase request parameters */ export interface PurchaseParams { /** Transaction amount */ amount: number; /** Unique transaction ID */ tran_id: string; /** Items being purchased (JSON string) */ items?: string; /** Shipping amount */ shipping?: number; /** Customer first name */ firstname?: string; /** Customer last name */ lastname?: string; /** Customer email */ email?: string; /** Customer phone number */ phone?: string; /** Transaction type: 'purchase' or 'pre-auth' */ type?: TransactionType; /** * Payment method option * - 'cards': Card payments (returns HTML) * - 'abapay_khqr': QR payment for ABA PAY and KHQR banks (returns HTML) * - 'abapay_khqr_deeplink': ABA PAY and KHQR banks deeplink (returns JSON) * - 'alipay': Alipay Wallet (returns HTML) * - 'wechat': WeChat Wallet (returns HTML) * - 'google_pay': Google Pay Wallet (returns HTML) * - undefined: Shows all supported payment methods (returns HTML) */ payment_option?: 'cards' | 'abapay_khqr' | 'abapay_khqr_deeplink' | 'alipay' | 'wechat' | 'google_pay'; /** Return URL after payment */ return_url?: string; /** Cancel URL */ cancel_url?: string; /** Success continuation URL */ continue_success_url?: string; /** Mobile deep link */ return_deeplink?: string; /** Currency (default: USD) */ currency?: Currency; /** Custom fields (JSON string) */ custom_fields?: string; /** Return parameters */ return_params?: string; /** View type (e.g., 'modal', 'popup', 'redirect') */ view_type?: string; /** Payment gate */ payment_gate?: string; /** Payout details */ payout?: string; /** Payment link lifetime in seconds */ lifetime?: number; /** Additional parameters */ additional_params?: string; /** Google Pay token */ google_pay_token?: string; /** Skip success page */ skip_success_page?: boolean; } /** * Internal purchase request data with required fields for signing */ export interface PurchaseRequestData extends PurchaseParams { /** Merchant ID */ merchant_id: string; /** Request timestamp */ req_time: number; /** HMAC-SHA512 hash */ hash?: string; } /** * Deeplink response for abapay_khqr_deeplink payment option */ export interface PurchaseDeeplinkResponse { /** QR code string for KHQR payments */ qr_string: string; /** ABA PAY deeplink URL */ abapay_deeplink: string; /** Checkout QR URL */ checkout_qr_url: string; } /** * Purchase API response * - Returns HTML string for most payment options (cards, abapay_khqr, alipay, wechat, google_pay, or undefined) * - Returns JSON object for 'abapay_khqr_deeplink' payment option */ export type PurchaseResponse = string | PurchaseDeeplinkResponse; /** * Transaction details request parameters */ export interface TransactionDetailsParams { /** Transaction ID to query */ tran_id: string; } /** * Transaction details response */ export interface TransactionDetailsResponse extends BaseResponse { transaction_id?: string; tran_id?: string; amount?: number; currency?: Currency; transaction_status?: string; payment_date?: string; [key: string]: any; } /** * Check transaction request parameters */ export interface CheckTransactionParams { /** Transaction ID to check */ tran_id: string; } /** * Check transaction response */ export interface CheckTransactionResponse extends BaseResponse { transaction_id?: string; transaction_status?: string; [key: string]: any; } /** * Close transaction request parameters */ export interface CloseTransactionParams { /** Transaction ID to close */ tran_id: string; } /** * Close transaction response */ export interface CloseTransactionResponse extends BaseResponse { transaction_id?: string; [key: string]: any; } /** * Refund request parameters */ export interface RefundParams { /** Original transaction ID */ tran_id: string; /** Refund amount */ amount: number; /** Refund reason */ reason?: string; } /** * Refund response */ export interface RefundResponse extends BaseResponse { refund_id?: string; transaction_id?: string; amount?: number; [key: string]: any; } /** * Transaction list request parameters */ export interface TransactionListParams { /** Start date (YYYY-MM-DD) */ from_date?: string; /** End date (YYYY-MM-DD) */ to_date?: string; /** Page number */ page?: number; /** Items per page */ limit?: number; } /** * Transaction list response */ export interface TransactionListResponse extends BaseResponse { transactions?: Array<{ transaction_id?: string; tran_id?: string; amount?: number; currency?: Currency; transaction_status?: string; payment_date?: string; [key: string]: any; }>; total?: number; page?: number; limit?: number; [key: string]: any; } /** * Exchange rate request parameters */ export interface ExchangeRateParams { /** Currency code */ currency: Currency; } /** * Exchange rate response */ export interface ExchangeRateResponse extends BaseResponse { currency?: Currency; rate?: number; [key: string]: any; } //# sourceMappingURL=checkout.d.ts.map