UNPKG

@yengapay/nodejs-sdk

Version:

Official Node.js SDK for YengaPay - Accept mobile money payments and send payouts in West Africa

67 lines (65 loc) 1.97 kB
import { ClientConfig, CreatePayoutParams, CreatePayoutResponse, PayoutStatusResponse } from '../types'; /** * Payout Module * * Handles payout operations (sending money to customers) */ export declare class Payout { private config; private http; constructor(config: ClientConfig); /** * Create a single payout transaction * * Send money to a customer's mobile money account * * @param params - Payout creation parameters * @returns Payout transaction details * * @example * ```typescript * const payout = await client.payout.create({ * amount: 5000, * destNumber: '+22670123456', * destName: 'John Doe', * destEmail: 'john@example.com', * paymentMethod: 'ORANGE_MONEY', * description: 'Payment for service' * }); * console.log(payout.id, payout.status); * ``` */ create(params: CreatePayoutParams): Promise<CreatePayoutResponse>; /** * Get payout transaction status * * Check the status of a payout transaction * * @param payoutId - The payout transaction ID * @returns Payout transaction status and details * * @example * ```typescript * const status = await client.payout.getStatus('payout_123...'); * if (status.status === 'SUCCESS') { * console.log('Payout completed:', status.operatorTransId); * } * ``` */ getStatus(payoutId: string): Promise<PayoutStatusResponse>; /** * Retry a failed payout transaction * * Retry a payout transaction that has failed * * @param payoutId - The payout transaction ID to retry * @returns Updated payout transaction details * * @example * ```typescript * const retried = await client.payout.retry('payout_123...'); * console.log('Payout retried:', retried.status); * ``` */ retry(payoutId: string): Promise<PayoutStatusResponse>; }