/** * Payment Link Types * API: POST /api/merchant-portal/merchant-access/payment-link/create */ /** * Payout instruction for payment link */ export interface PaymentLinkPayout { /** ABA account number or MID of the beneficiary */ acc: string; /** Payout amount (currency follows payment link currency) */ amt: number; /** Name of the beneficiary (returned in response) */ acc_name?: string; } /** * Payment link creation request parameters */ export interface PaymentLinkRequest { /** Title of the payment link (max 250 characters) */ title: string; /** Payment link amount (min 100 KHR or 0.01 USD) */ amount: number; /** Transaction currency (KHR or USD) */ currency: 'KHR' | 'USD'; /** Description of the payment link (optional, max 250 characters) */ description?: string; /** Maximum number of transactions allowed (optional, null = no limit) */ payment_limit?: number; /** Expiration timestamp (null = no expiry) */ expired_date: number | null; /** Return URL for payment callbacks (will be Base64 encoded) */ return_url: string; /** Your payment link reference ID (optional, max 50 characters) */ merchant_ref_no?: string; /** Payout instructions (optional, array of payout objects) */ payout?: PaymentLinkPayout[]; /** Image file for the payment link (optional, max 3MB, JPG/JPEG/PNG) */ image?: File | Buffer; } /** * Image data in payment link response */ export interface PaymentLinkImage { /** Image URL or base64 data */ image: string; /** Original filename */ filename: string; /** File size in bytes */ size: number; } /** * Payment link data in response */ export interface PaymentLinkData { /** Unique payment link ID */ id: string; /** Payment link title */ title: string; /** Associated image */ image: PaymentLinkImage; /** Payment link amount */ amount: string; /** Payment link currency (KHR or USD) */ currency: string; /** Status: OPEN, CLOSED, EXPIRED */ status: string; /** Payment link description */ description: string; /** Maximum transactions allowed */ payment_limit: number; /** Total payment amount before refund */ total_amount_org: number; /** Total amount after refund */ total_amount: number; /** Total refunded amount */ total_refund: number; /** Total completed payment transactions */ total_trxn: number; /** Creation timestamp */ created_at: string; /** Last update timestamp */ updated_at: string; /** Expiration timestamp */ expired_date: number; /** Return URL for callbacks */ return_url: string; /** Your payment link reference */ merchant_ref_no: string; /** Unique outlet identifier */ outlet_id: string; /** Outlet name */ outlet_name: string; /** Full payment link URL */ payment_link: string; /** Payout instructions */ payout: PaymentLinkPayout[]; } /** * Payment link creation response */ export interface PaymentLinkResponse { /** Payment link data */ data: PaymentLinkData; /** Response status */ status: { /** Response code (00 = success) */ code: string; /** Response message */ message: string; }; /** Transaction log ID */ tran_id: number; } /** * Payment link detail request parameters */ export interface PaymentLinkDetailRequest { /** Unique payment link ID to retrieve */ id: string; } /** * Payment link detail data (similar to creation but with some differences) */ export interface PaymentLinkDetailData { /** Unique payment link ID */ id: string; /** Payment link title */ title: string; /** Associated image */ image: PaymentLinkImage; /** Payment link amount */ amount: number; /** Payment link currency (KHR or USD) */ currency: string; /** Status: OPEN, PAID, CLOSED, EXPIRED */ status: string; /** Payment link description */ description: string; /** Maximum transactions allowed */ payment_limit: number; /** Total payment amount before refund */ total_amount_org: string; /** Total refunded amount */ total_refund: string; /** Total amount after refund */ total_amount: number; /** Total completed payment transactions */ total_trxn: number; /** Creation timestamp */ created_at: string; /** Last update timestamp */ updated_at: string; /** Expiration timestamp */ expired_date: number; /** Pushback URL for callbacks (same as return_url) */ pushback_url: string; /** Full payment link URL */ payment_link: string; } /** * Payment link detail response */ export interface PaymentLinkDetailResponse { /** Payment link detail data */ data: PaymentLinkDetailData; /** Response status */ status: { /** Response code (00 = success) */ code: string; /** Response message */ message: string; }; /** Transaction log ID */ tran_id: string; }