flutterwave-universal
Version:
Universal TypeScript SDK for Flutterwave payment services, compatible with Node.js, Bun, Deno, Cloudflare Workers and Edge Functions
1 lines • 36.1 kB
Source Map (JSON)
{"version":3,"sources":["../src/errors/flutterwave-error.ts","../src/core/config.ts","../src/core/client.ts","../src/services/banks.ts","../src/services/charge.ts","../src/services/otp.ts","../src/services/payments.ts","../src/services/transfer.ts","../src/services/transfer-beneficiary.ts","../src/services/virtual-account.ts","../src/index.ts"],"sourcesContent":["export class FlutterwaveError extends Error {\n\tpublic readonly status?: string;\n\tpublic readonly code?: string;\n\tpublic readonly data?: unknown;\n\n\tconstructor(message: string, status?: string, code?: string, data?: unknown) {\n\t\tsuper(message);\n\t\tthis.name = \"FlutterwaveError\";\n\t\tthis.status = status;\n\t\tthis.code = code;\n\t\tthis.data = data;\n\n\t\t// This is necessary for proper Error subclassing in TypeScript\n\t\tObject.setPrototypeOf(this, FlutterwaveError.prototype);\n\t}\n}\n","export const FLUTTERWAVE_API_VERSION = \"v3\";\nexport const FLUTTERWAVE_BASE_URL = `https://api.flutterwave.com/${FLUTTERWAVE_API_VERSION}`;\n\nexport interface FlutterwaveConfig {\n\tsecretKey: string;\n\tpublicKey?: string; // Optional, for some client-side operations if you extend\n\tencryptionKey?: string; // For Rave V2 payment encryption, if needed\n\ttimeout?: number; // Request timeout in milliseconds\n}\n","import type {\n\tFlutterwaveErrorResponse,\n\tFlutterwaveResponse,\n} from \"@/definitions/common\";\nimport { FlutterwaveError } from \"@/errors/flutterwave-error\";\nimport { FLUTTERWAVE_BASE_URL, type FlutterwaveConfig } from \"./config\";\n\nexport class ApiClient {\n\tprivate secretKey: string;\n\tprivate baseUrl: string;\n\tprivate timeout: number;\n\n\tconstructor(config: FlutterwaveConfig) {\n\t\tif (!config.secretKey) {\n\t\t\tthrow new Error(\"Flutterwave secret key is required.\");\n\t\t}\n\t\tthis.secretKey = config.secretKey;\n\t\tthis.baseUrl = FLUTTERWAVE_BASE_URL;\n\t\tthis.timeout = config.timeout || 60000; // 60 seconds\n\t}\n\n\tprivate async request<T>(\n\t\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\",\n\t\tendpoint: string,\n\t\tpayload?: Record<string, unknown>,\n\t): Promise<T> {\n\t\tlet url = `${this.baseUrl}/${endpoint}`;\n\t\tconst headers: Record<string, string> = {\n\t\t\tAuthorization: `Bearer ${this.secretKey}`,\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\tAccept: \"application/json\",\n\t\t};\n\n\t\tconst options: RequestInit = {\n\t\t\tmethod,\n\t\t\theaders,\n\t\t};\n\n\t\tif (payload) {\n\t\t\tif (method === \"PUT\" || method === \"POST\") {\n\t\t\t\toptions.body = JSON.stringify(payload);\n\t\t\t} else if (method === \"GET\" || method === \"DELETE\") {\n\t\t\t\t// For GET/DELETE requests, append params to URL\n\t\t\t\tconst queryParams = new URLSearchParams(\n\t\t\t\t\t// Ensure payload values are strings or numbers for URLSearchParams\n\t\t\t\t\tObject.entries(payload).reduce(\n\t\t\t\t\t\t(acc, [key, value]) => {\n\t\t\t\t\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\t\t\t\t\tacc[key] = String(value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{} as Record<string, string>,\n\t\t\t\t\t),\n\t\t\t\t).toString();\n\n\t\t\t\tif (queryParams) {\n\t\t\t\t\turl = `${url}?${queryParams}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst controller = new AbortController();\n\t\tconst timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\t\toptions.signal = controller.signal;\n\n\t\ttry {\n\t\t\tconst response: Response = await fetch(url, options);\n\t\t\tclearTimeout(timeoutId); // Clear timeout if the request completes\n\n\t\t\tif (!response.ok) {\n\t\t\t\tlet errorData: FlutterwaveErrorResponse | string;\n\t\t\t\ttry {\n\t\t\t\t\t// Attempt to parse as JSON, Flutterwave usually sends JSON errors\n\t\t\t\t\terrorData = await response.json();\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Fallback to text if JSON parsing fails or if the response wasn't JSON\n\t\t\t\t\terrorData = await response.text();\n\t\t\t\t}\n\n\t\t\t\tconst message =\n\t\t\t\t\ttypeof errorData === \"string\"\n\t\t\t\t\t\t? errorData || `API request failed with status ${response.status}`\n\t\t\t\t\t\t: (errorData as FlutterwaveErrorResponse).message ||\n\t\t\t\t\t\t\t`API request failed with status ${response.status}`;\n\t\t\t\tconst code =\n\t\t\t\t\ttypeof errorData !== \"string\"\n\t\t\t\t\t\t? (errorData as FlutterwaveErrorResponse).code\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst data =\n\t\t\t\t\ttypeof errorData !== \"string\"\n\t\t\t\t\t\t? (errorData as FlutterwaveErrorResponse).data\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tthrow new FlutterwaveError(\n\t\t\t\t\tmessage,\n\t\t\t\t\tString(response.status),\n\t\t\t\t\tcode,\n\t\t\t\t\tdata,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Handle cases where Flutterwave might return 200 OK but with an error status in the body\n\t\t\t// Or successful responses that might not always have a 'data' field directly (e.g. delete operations returning 204 with no content or different structure)\n\t\t\tif (response.status === 204) {\n\t\t\t\t// Handle No Content responses\n\t\t\t\treturn {} as T; // Or an appropriate empty success object/value\n\t\t\t}\n\n\t\t\tconst responseData = await response.json(); // Expect FlutterwaveResponse<T> or FlutterwaveErrorResponse\n\n\t\t\tif (responseData.status && responseData.status === \"error\") {\n\t\t\t\tconst typedErrorData = responseData as FlutterwaveErrorResponse;\n\t\t\t\tthrow new FlutterwaveError(\n\t\t\t\t\ttypedErrorData.message,\n\t\t\t\t\t\"API Error\",\n\t\t\t\t\ttypedErrorData.code,\n\t\t\t\t\ttypedErrorData.data,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// If the response is expected to be FlutterwaveResponse<T>, return data\n\t\t\t// If it's a direct data object, return as is (adapt as per actual API responses)\n\t\t\treturn (responseData as FlutterwaveResponse<T>).data !== undefined\n\t\t\t\t? (responseData as FlutterwaveResponse<T>).data\n\t\t\t\t: (responseData as T);\n\t\t} catch (error) {\n\t\t\tclearTimeout(timeoutId); // Ensure timeout is cleared on any error\n\t\t\tif (error instanceof FlutterwaveError) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tif (error instanceof Error && error.name === \"AbortError\") {\n\t\t\t\tthrow new FlutterwaveError(\n\t\t\t\t\t`Request timed out after ${this.timeout}ms`,\n\t\t\t\t\t\"TimeoutError\",\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Handle other network errors or unexpected issues\n\t\t\tthrow new FlutterwaveError(\n\t\t\t\terror instanceof Error\n\t\t\t\t\t? error.message\n\t\t\t\t\t: \"An unexpected network error occurred\",\n\t\t\t\t\"NetworkError\",\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic get<T>(\n\t\tendpoint: string,\n\t\tparams?: Record<string, unknown>,\n\t): Promise<T> {\n\t\treturn this.request<T>(\"GET\", endpoint, params);\n\t}\n\n\tpublic post<T>(endpoint: string, data: Record<string, unknown>): Promise<T> {\n\t\treturn this.request<T>(\"POST\", endpoint, data);\n\t}\n\n\tpublic put<T>(endpoint: string, data: Record<string, unknown>): Promise<T> {\n\t\treturn this.request<T>(\"PUT\", endpoint, data);\n\t}\n\n\tpublic delete<T>(\n\t\tendpoint: string,\n\t\tdata?: Record<string, unknown>,\n\t): Promise<T> {\n\t\treturn this.request<T>(\"DELETE\", endpoint, data);\n\t}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type { Bank, BankBranch } from \"@/definitions/banks\";\n\nexport class BanksService {\n\tprivate apiClient: ApiClient;\n\n\tconstructor(client: ApiClient) {\n\t\tthis.apiClient = client;\n\t}\n\n\t/** Query all supported Banks in a specified country.\n\t * @param country The country code (e.g., 'NG', 'GH', 'KE')\n\t */\n\tasync list(country: string): Promise<Bank[]> {\n\t\treturn this.apiClient.get<Bank[]>(`banks/${country}`);\n\t}\n\n\t/** Query the branch code for a specific Bank.\n\t * @param bankId The ID of the bank (can be obtained from the list() method).\n\t */\n\tasync branches(bankId: string | number): Promise<BankBranch[]> {\n\t\treturn this.apiClient.get<BankBranch[]>(`banks/${bankId}/branches`);\n\t}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type {\n\tCharge1VoucherPayload,\n\tCharge1VoucherResponse,\n\tChargeACHPayload,\n\tChargeACHResponse,\n\tChargeApplePay,\n\tChargeApplePayResponse,\n\tChargeBankNGResponse,\n\tChargeBankPayload,\n\tChargeBankResponse,\n\tChargeBankTransferPaylod,\n\tChargeBankTransferResponse,\n\tChargeCaptecPaylod,\n\tChargeCaptecResponse,\n\tChargeCardPaylood,\n\tChargeCardResponse,\n\tChargeENairaPayload,\n\tChargeENairaResponse,\n\tChargeFawryPayPayload,\n\tChargeFawryResponse,\n\tChargeFrancoPhoneMobilePaylaod,\n\tChargeFranncophoneMobileResponse,\n\tChargeGhanaMobilePayload,\n\tChargeGhanaMobileResponse,\n\tChargeGooglePay,\n\tChargeGooglePayResponse,\n\tChargeMpesaPayload,\n\tChargeMpesaResponse,\n\tChargeNQRPayload,\n\tChargeNQRResponse,\n\tChargeOpayPayload,\n\tChargeOpayResponse,\n\tChargeRwandaMobilePayload,\n\tChargeRwandaMobileResponse,\n\tChargeTanzaniaMobilePayload,\n\tChargeTanzaniaMobileResponse,\n\tChargeUSSDPayload,\n\tChargeUSSDResponse,\n\tChargeUgandaMobileMobilePayload,\n\tChargeUgandaMobileResponse,\n\tValidateChargePayload,\n\tValidateChargeResponse,\n} from \"@/definitions/charges\";\n\ntype T = Record<string, unknown>;\n\nexport class ChargeService {\n\tprivate client: ApiClient;\n\n\tconstructor(apiClient: ApiClient) {\n\t\tthis.client = apiClient;\n\t}\n\n\t/**\n\t * Collect card payments with Flutterwave.\n\t * We recommend you read the {@link https://developer.flutterwave.com/docs/direct-card-charge} method overview before you proceed.\n\t */\n\tasync card(payload: ChargeCardPaylood): Promise<ChargeCardResponse> {\n\t\treturn this.client.post(\"charges?type=card\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Generate dynamic virtual accounts for instant payments via bank transfers.\n\t * We recommend you read the {@link https://developer.flutterwave.com/docs/bank-transfer-1} method overview before you proceed.\n\t */\n\tasync bankTransfer(\n\t\tpayload: ChargeBankTransferPaylod,\n\t): Promise<ChargeBankTransferResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=bank_transfer\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Collect ACH payments for USD and ZAR transactions. We recommend you read the method overview before you proceed.\n\t * {@linnk https://developer.flutterwave.com/docs/ach-payment}\n\t */\n\tasync ach(payload: ChargeACHPayload): Promise<ChargeACHResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=ach_payment\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Charge Customers UK and EU bank accounts. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/uk-and-eu}\n\t */\n\tasync bank_uk_eu(paylaod: ChargeBankPayload): Promise<ChargeBankResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=debit_uk_account\",\n\t\t\tpaylaod as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Charge Nigerian bank accounts using Flutterwave. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/nigeria}\n\t */\n\tasync bank_ng(payload: ChargeBankPayload): Promise<ChargeBankNGResponse> {\n\t\treturn this.client.post(\"charges?type=mono\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Collect Mpesa payments from customers in Kenya. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/m-pesa}\n\t */\n\tasync mpesa(payload: ChargeMpesaPayload): Promise<ChargeMpesaResponse> {\n\t\treturn this.client.post(\"charges?type=mpesa\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Collect mobile money payments from customers in Ghana. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/ghana}\n\t */\n\tasync ghanaMobile(\n\t\tpayload: ChargeGhanaMobilePayload,\n\t): Promise<ChargeGhanaMobileResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=mobile_money_ghana\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Collect mobile money payments from customers in Rwanda. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/rwanda}\n\t */\n\tasync rwandaMobile(\n\t\tpayload: ChargeRwandaMobilePayload,\n\t): Promise<ChargeRwandaMobileResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=mobile_money_rwanda\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Receive mobile money payments from customers in Uganda. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/uganda}\n\t */\n\tasync ugandaMobile(\n\t\tpayload: ChargeUgandaMobileMobilePayload,\n\t): Promise<ChargeUgandaMobileResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=mobile_money_uganda\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Collect mobile money payments from customers in Francophone countries. This method supports payment from Cameroon,\n\t * Cote d'Ivoire, Mali and Senegal. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/francophone}\n\t */\n\tasync francophoneMobile(\n\t\tpayload: ChargeFrancoPhoneMobilePaylaod,\n\t): Promise<ChargeFranncophoneMobileResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=mobile_money_franco\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * This document describes how to collect payments via Tanzania mobile money.\n\t */\n\tasync tanzaniaMobile(\n\t\tpayload: ChargeTanzaniaMobilePayload,\n\t): Promise<ChargeTanzaniaMobileResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=mobile_money_tanzania\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * This document describes how to collect payments via Zambia mobile money.\n\t */\n\tasync zambiaMobile(paylaod: unknown): Promise<unknown> {\n\t\treturn this.client.post(\n\t\t\t\"harges?type=mobile_money_zambia\",\n\t\t\tpaylaod as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Charge South African customers via 1Voucher. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/1voucher}\n\t */\n\tasync voucher(\n\t\tpayload: Charge1VoucherPayload,\n\t): Promise<Charge1VoucherResponse> {\n\t\treturn this.client.post(\n\t\t\t\"charges?type=voucher_payment\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/**\n\t * Accept payments from your customers with Apple Pay. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/apple-paytm%EF%B8%8F}\n\t */\n\tasync applePay(payload: ChargeApplePay): Promise<ChargeApplePayResponse> {\n\t\treturn this.client.post(\"charges?type=applepay\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Accept payments from your customers with Google Pay. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/google-paytm%EF%B8%8F}\n\t */\n\tasync googlePay(payload: ChargeGooglePay): Promise<ChargeGooglePayResponse> {\n\t\treturn this.client.post(\"charges?type=googlepay\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Accept payment from eNaira wallets. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/enaira-payment}\n\t */\n\tasync enaira(paylaod: ChargeENairaPayload): Promise<ChargeENairaResponse> {\n\t\treturn this.client.post(\"charges?type=enaira\", paylaod as unknown as T);\n\t}\n\n\t/**\n\t * Collect USSD payments from customers in Nigeria. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/ussd}\n\t */\n\tasync ussd(payload: ChargeUSSDPayload): Promise<ChargeUSSDResponse> {\n\t\treturn this.client.post(\"charges?type=ussd\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Generate QR images for NQR payments. We recommend you read the method overview before you proceed.\n\t * {@link https://developer.flutterwave.com/docs/nibss-qr}\n\t */\n\tasync nqr(payload: ChargeNQRPayload): Promise<ChargeNQRResponse> {\n\t\treturn this.client.post(\"charges?type=qr\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Collect payments from OPay wallets. We cover this payment method in more details in the method overview.\n\t * {@link https://developer.flutterwave.com/docs/opay}\n\t */\n\tasync opay(payload: ChargeOpayPayload): Promise<ChargeOpayResponse> {\n\t\treturn this.client.post(\"charges?type=opay\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Collect capitec payments with Flutterwave. we recommend you read the overview before you proceed.\n\t */\n\tasync capitec(payload: ChargeCaptecPaylod): Promise<ChargeCaptecResponse> {\n\t\treturn this.client.post(\"charges?type=capitec\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Receive Fawry payments from customers in Egypt. Read the overview for this payment method before proceeding.\n\t * {@link https://developer.flutterwave.com/docs/fawry-pay}\n\t */\n\tasync fawryPay(payload: ChargeFawryPayPayload): Promise<ChargeFawryResponse> {\n\t\treturn this.client.post(\"charges?type=fawry_pay\", payload as unknown as T);\n\t}\n\n\t/**\n\t * Validate a pending transaction using an OTP (Card or account charges)\n\t */\n\tasync validate(\n\t\tpayload: ValidateChargePayload,\n\t): Promise<ValidateChargeResponse> {\n\t\treturn this.client.post(\"validate-charge\", payload as unknown as T);\n\t}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type { GenerateOtpPayload, GenerateOtpResult } from \"@/definitions/opt\";\n\nexport class OTPServices {\n\tprivate client: ApiClient;\n\n\tconstructor(apiClient: ApiClient) {\n\t\tthis.client = apiClient;\n\t}\n\n\t/**\n\t * Create OTP strings of varying lengths.\n\t */\n\tasync generate(payload: GenerateOtpPayload): Promise<GenerateOtpResult> {\n\t\treturn this.client.post(\n\t\t\t\"otps\",\n\t\t\tpayload as unknown as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Validate an OTP\n\t * @param otp The one time password sent to the customer.\n\t */\n\tasync validate(payload: { otp: string }) {\n\t\treturn this.client.post(`otps/${crypto.randomUUID()}/validate`, payload);\n\t}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type {\n\tPaymentInitPayload,\n\tPaymentInitResponse,\n} from \"@/definitions/payments\";\n\nexport class PaymentService {\n\tprivate apiClient: ApiClient;\n\n\tconstructor(client: ApiClient) {\n\t\tthis.apiClient = client;\n\t}\n\n\t/**\n\t * Generate Flutterwave checkout to receive payments from customers (Standard payment)\n\t * @param payload Payment details\n\t */\n\tasync initiate(payload: PaymentInitPayload) {\n\t\treturn this.apiClient.post<PaymentInitResponse>(\n\t\t\t\"payments\",\n\t\t\tpayload as unknown as Record<string, unknown>,\n\t\t);\n\t}\n\n\t/**\n\t * Verify a transaction.\n\t * @param transactionId The transaction ID returned by Flutterwave after a transaction.\n\t */\n\t// NOTE: add verification\n\t// async verify(transactionId:string): Promise<Pa> {}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type { Currency } from \"@/definitions/common\";\nimport type {\n\tBulkRates,\n\tBulkTransferPayload,\n\tBulkTransferResponse,\n\tCreateTransferPayload,\n\tCreateTransferResponse,\n\tGetBulkTransferPayload,\n\tGetBulkTransferResponse,\n\tListTransferPayload,\n\tListTransferResponse,\n\tQueryFeeResponse,\n\tQueryRateResponse,\n\tRetry,\n\tRetryTransferResponse,\n\tTransfer,\n\tVerifyBulkRateResponse,\n} from \"@/definitions/transfer\";\n\ntype T = Record<string, unknown>;\nexport class TransferService {\n\tprivate apiClient: ApiClient;\n\n\tconstructor(client: ApiClient) {\n\t\tthis.apiClient = client;\n\t}\n\n\t/** This will show you how to initiate a transfer */\n\tasync create(\n\t\tpayload: CreateTransferPayload,\n\t): Promise<CreateTransferResponse> {\n\t\treturn this.apiClient.post(\"transfers\", payload as unknown as T);\n\t}\n\n\t/** This helps you retry a previously failed transfer. */\n\tasync retry(payload: { id: string }): Promise<RetryTransferResponse> {\n\t\treturn this.apiClient.post(\n\t\t\t`transfers/${payload.id}/retries`,\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/** This document shows you how to initiate a bulk transfer */\n\tasync bulkTransfer(\n\t\tpayload: BulkTransferPayload,\n\t): Promise<BulkTransferResponse> {\n\t\treturn this.apiClient.post(\"bulk-transfers\", payload as unknown as T);\n\t}\n\n\t/** Get applicable transfer fee */\n\tasync queryFee(payload: {\n\t\tamount: number;\n\t\tcurrency: Currency;\n\t\ttype: \"mobilemoney\" | \"account\";\n\t}): Promise<QueryFeeResponse> {\n\t\treturn this.apiClient.get(\n\t\t\t`transfers/fee?amount=${payload.amount}¤cy=${payload.currency}&type=${payload.type}`,\n\t\t);\n\t}\n\n\t/** Fetch all transfers on your account */\n\tasync list(payload: ListTransferPayload): Promise<ListTransferResponse> {\n\t\treturn this.apiClient.get(\n\t\t\t`transfers?${new URLSearchParams(payload as Record<string, string>).toString()}`,\n\t\t);\n\t}\n\n\t/** Fetch a single transfer on your account */\n\tasync get(payload: { id: string }): Promise<Transfer> {\n\t\treturn this.apiClient.get(`transfers/${payload.id}`);\n\t}\n\n\t/** Fetch transfer retry attempts for a single transfer on your account.*/\n\tasync getRetry(payload: { id: string }): Promise<Retry[]> {\n\t\treturn this.apiClient.get(`transfers/${payload.id}/retries`);\n\t}\n\n\t/** Get the status of a bulk transfer on your account*/\n\tasync getBulkTransfer(\n\t\tpayload: GetBulkTransferPayload,\n\t): Promise<GetBulkTransferResponse> {\n\t\treturn this.apiClient.get(\n\t\t\t`transfers?${new URLSearchParams(payload as unknown as Record<string, string>).toString()}`,\n\t\t);\n\t}\n\n\t/** This endpoint helps you understand transfer rates when making international transfers */\n\tasync queryTransferRates(payload: {\n\t\tamount: number;\n\t\tdestination_currency: Currency;\n\t\tsource_currency: Currency;\n\t}): Promise<QueryRateResponse> {\n\t\treturn this.apiClient.get(\n\t\t\t`transfers/rates?${new URLSearchParams(payload as unknown as Record<string, string>).toString()}`,\n\t\t);\n\t}\n\n\tasync queryBulkRates(payload: BulkRates) {\n\t\treturn this.apiClient.post(\"bulk-rates\", payload as unknown as T);\n\t}\n\n\tasync verifyBulkRates(payload: { id: string }): Promise<\n\t\tVerifyBulkRateResponse[]\n\t> {\n\t\treturn this.apiClient.get(`bulk-rates?id=${payload.id}`);\n\t}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type {\n\tBeneficiary,\n\tCreateBeneficiaryPayload,\n\tCreateBeneficiaryRespose,\n\tListBeneficiariesResponse,\n} from \"@/definitions/transfer-beneficiary\";\n\ntype T = Record<string, unknown>;\nexport class TransferBeneficiaryService {\n\tprivate apiClient: ApiClient;\n\n\tconstructor(client: ApiClient) {\n\t\tthis.apiClient = client;\n\t}\n\n\t/** Create a transfer beneficiary */\n\tasync create(\n\t\tpayload: CreateBeneficiaryPayload,\n\t): Promise<CreateBeneficiaryRespose> {\n\t\treturn this.apiClient.post(\"beneficiaries\", payload as unknown as T);\n\t}\n\n\t/** Get all beneficiaries */\n\tasync list(payload: { page: number }): Promise<ListBeneficiariesResponse> {\n\t\treturn this.apiClient.get(`beneficiaries?page=${payload.page}`);\n\t}\n\n\t/** Get a single transfer beneficiary details */\n\tasync get(paylaod: { id: string }): Promise<Beneficiary> {\n\t\treturn this.apiClient.get(`beneficiaries/${paylaod.id}`);\n\t}\n\n\t/** Delete a transfer beneficiary */\n\tasync delete(payload: { id: string }) {\n\t\treturn this.apiClient.delete(`beneficiaries/${payload.id}`);\n\t}\n}\n","import type { ApiClient } from \"@/core/client\";\nimport type {\n\tBulkVirtualAccountPayload,\n\tBulkVirtualAccountResponse,\n\tCreateVirtualAccountPayload,\n\tCreateVirtualAccountResponse,\n\tVirtualAccount,\n} from \"@/definitions/virtual-accounts\";\n\ntype T = Record<string, unknown>;\n\nexport class VirtualAccountService {\n\tprivate apiClient: ApiClient;\n\n\tconstructor(client: ApiClient) {\n\t\tthis.apiClient = client;\n\t}\n\n\t/**\n\t * Create a Virtual Account for Your Customer.\n\t */\n\tasync create(\n\t\tpayload: CreateVirtualAccountPayload,\n\t): Promise<CreateVirtualAccountResponse> {\n\t\treturn this.apiClient.post(\n\t\t\t\"virtual-account-numbers\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\t/**\n\t * Create Virtual Account Numbers in Bulk.\n\t */\n\tasync createBulk(\n\t\tpayload: BulkVirtualAccountPayload,\n\t): Promise<BulkVirtualAccountResponse> {\n\t\treturn this.apiClient.post(\n\t\t\t\"bulk-virtual-account-numbers\",\n\t\t\tpayload as unknown as T,\n\t\t);\n\t}\n\n\t/** Retrieve virtual account information using its account number */\n\tasync get(payload: { account_number: string }): Promise<VirtualAccount> {\n\t\treturn this.apiClient.get(\n\t\t\t`virtual-account-numbers/${payload.account_number}`,\n\t\t);\n\t}\n\n\t/** Query virtual account information using the batch ID from the batch creation response. */\n\tasync getBulk(payload: { batch_id: string }): Promise<VirtualAccount[]> {\n\t\treturn this.apiClient.get(\n\t\t\t`bulk-virtual-account-numbers/${payload.batch_id}`,\n\t\t);\n\t}\n\n\t/** Update the BVN of existing virtual accounts. */\n\tasync updateBVN(payload: { order_ref: string; bvn: string }) {\n\t\treturn this.apiClient.put(`virtual-account-numbers/${payload.order_ref}`, {\n\t\t\tbvn: payload.bvn,\n\t\t});\n\t}\n\n\t/** Delete a virtual account */\n\tasync delete(payload: {\n\t\torder_ref: string;\n\t\tstatus: \"active\" | \"inactive\" | string;\n\t}): Promise<{ status: string; status_desc: string }> {\n\t\treturn this.apiClient.delete(\n\t\t\t`virtual-account-numbers/${payload.order_ref}`,\n\t\t\t{ status: payload.status },\n\t\t);\n\t}\n}\n","import { ApiClient } from \"./core/client\";\nimport type { FlutterwaveConfig } from \"./core/config\";\nimport { BanksService } from \"./services/banks\";\nimport { ChargeService } from \"./services/charge\";\nimport { OTPServices } from \"./services/otp\";\nimport { PaymentService } from \"./services/payments\";\nimport { TransferService } from \"./services/transfer\";\nimport { TransferBeneficiaryService } from \"./services/transfer-beneficiary\";\nimport { VirtualAccountService } from \"./services/virtual-account\";\n\nexport class Flutterwave {\n\tprivate apiClient: ApiClient;\n\n\tpublic banks: BanksService;\n\tpublic payments: PaymentService;\n\tpublic otp: OTPServices;\n\tpublic charges: ChargeService;\n\tpublic transfer: TransferService;\n\tpublic beneficiary: TransferBeneficiaryService;\n\tpublic virtualAccount: VirtualAccountService;\n\n\tconstructor(config: FlutterwaveConfig) {\n\t\tif (!config || !config.secretKey) {\n\t\t\tthrow new Error(\"Flutterwave configuration with secretKey is required.\");\n\t\t}\n\n\t\tthis.apiClient = new ApiClient(config);\n\n\t\t// Initialize services\n\t\tthis.banks = new BanksService(this.apiClient);\n\t\tthis.payments = new PaymentService(this.apiClient);\n\t\tthis.otp = new OTPServices(this.apiClient);\n\t\tthis.charges = new ChargeService(this.apiClient);\n\t\tthis.transfer = new TransferService(this.apiClient);\n\t\tthis.beneficiary = new TransferBeneficiaryService(this.apiClient);\n\t\tthis.virtualAccount = new VirtualAccountService(this.apiClient);\n\t}\n\n\tasync ping(): Promise<{ status: string; message: string }> {\n\t\ttry {\n\t\t\t// A simple way to check connectivity, e.g., get banks for a common country\n\t\t\tawait this.banks.list(\"NG\");\n\t\t\treturn {\n\t\t\t\tstatus: \"success\",\n\t\t\t\tmessage: \"Flutterwave API connection successful.\",\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"Unknown error\";\n\t\t\treturn {\n\t\t\t\tstatus: \"error\",\n\t\t\t\tmessage: `Flutterwave API connection failed: ${message}`,\n\t\t\t};\n\t\t}\n\t}\n}\n\n// Export definitions\nexport type { FlutterwaveConfig };\nexport * from \"./definitions/banks\";\nexport * from \"./definitions/common\";\nexport * from \"./definitions/payments\";\nexport * from \"./definitions/opt\";\nexport * from \"./errors/flutterwave-error\";\nexport * from \"./definitions/charges\";\nexport * from \"./definitions/transfer-beneficiary\";\nexport * from \"./definitions/transfer\";\nexport * from \"./definitions//virtual-accounts\";\n// Exorts flutter as default or named (for CJ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K,SAAS,EACzC,KAAK,QAAU,IAAIC,EAAc,KAAK,SAAS,EAC/C,KAAK,SAAW,IAAIC,EAAgB,KAAK,SAAS,EAClD,KAAK,YAAc,IAAIC,EAA2B,KAAK,SAAS,EAChE,KAAK,eAAiB,IAAIC,EAAsB,KAAK,SAAS,CAC/D,CAEA,MAAM,MAAqD,CAC1D,GAAI,CAEH,aAAM,KAAK,MAAM,KAAK,IAAI,EACnB,CACN,OAAQ,UACR,QAAS,wCACV,CACD,OAASC,EAAO,CAEf,MAAO,CACN,OAAQ,QACR,QAAS,sCAHMA,aAAiB,MAAQA,EAAM,QAAU,eAGF,EACvD,CACD,CACD,CACD,EAcOC,EAAQX","names":["FlutterwaveError","_FlutterwaveError","message","status","code","data","FLUTTERWAVE_API_VERSION","FLUTTERWAVE_BASE_URL","ApiClient","config","FLUTTERWAVE_BASE_URL","method","endpoint","payload","url","headers","options","queryParams","acc","key","value","controller","timeoutId","response","errorData","message","code","data","FlutterwaveError","responseData","typedErrorData","error","params","BanksService","client","country","bankId","ChargeService","apiClient","payload","paylaod","OTPServices","apiClient","payload","PaymentService","client","payload","TransferService","client","payload","TransferBeneficiaryService","client","payload","paylaod","VirtualAccountService","client","payload","Flutterwave","config","ApiClient","BanksService","PaymentService","OTPServices","ChargeService","TransferService","TransferBeneficiaryService","VirtualAccountService","error","index_default"]}