import type { ResolvedPayWayConfig } from '../config.js'; import type { HttpClient } from '../utils/http.js'; import type { PurchaseParams, PurchaseResponse } from '../types/checkout.js'; /** * Purchase API - handles payment transactions */ export declare class PurchaseAPI { private config; private http; constructor(config: ResolvedPayWayConfig, http: HttpClient); /** * Create a purchase transaction * * Response type depends on payment_option: * - HTML string for: cards, abapay_khqr, alipay, wechat, google_pay, or undefined * - JSON object for: abapay_khqr_deeplink (contains qr_string, abapay_deeplink, checkout_qr_url) * * @param params - Purchase parameters * @returns HTML string (checkout page) or JSON object (deeplink data) * * @example HTML Response (default) * ```typescript * const checkoutHtml = await client.purchase.create({ * amount: 10.00, * tran_id: 'ORDER-123', * email: 'customer@example.com', * return_url: 'https://yoursite.com/payment/callback' * }); * * return new Response(checkoutHtml, { * headers: { 'Content-Type': 'text/html' } * }); * ``` * * @example JSON Response (abapay_khqr_deeplink) * ```typescript * const deeplinkData = await client.purchase.create({ * amount: 10.00, * tran_id: 'ORDER-123', * payment_option: 'abapay_khqr_deeplink', * email: 'customer@example.com' * }); * * // Returns: { qr_string, abapay_deeplink, checkout_qr_url } * return Response.json(deeplinkData); * ``` */ create(params: PurchaseParams): Promise; /** * Build hash string for purchase endpoint * Field order based on ABA PayWay documentation */ private buildPurchaseHashString; } //# sourceMappingURL=purchase.d.ts.map