pawapay-nodejs-sdk
Version:
Unofficial Node.js SDK for the PawaPay Merchant API v2. Simplify Mobile Money integrations (Deposits, Payouts, Refunds, status checks, provider prediction) with this type-safe TypeScript client.
40 lines (39 loc) • 2.75 kB
TypeScript
import { PawaPayConfig, PawaPayDepositPayload, PawaPayDepositResponse, PawaPayDepositSearchResult, PawaPayPayoutPayload, PawaPayPayoutResponse, PawaPayPayoutSearchResult, PawaPayCancelEnqueuedPayoutResponse, PawaPayRefundPayload, PawaPayRefundResponse, PawaPayRefundSearchResult, PawaPayCancelEnqueuedRefundResponse, PawaPayActiveConfiguration, PawaPayActiveConfigurationQuery, PawaPayPredictProviderResponse, PawaPayWalletBalancesResponse } from './types';
export declare class PawaPayClient {
private readonly apiToken;
private readonly axiosInstance;
constructor(config: PawaPayConfig);
/**
* Initiates a deposit (collecting a payment from a customer).
* @param payload - The deposit details. depositId is optional; the SDK generates a UUIDv4 if omitted.
*/
requestDeposit(payload: PawaPayDepositPayload): Promise<PawaPayDepositResponse>;
/** Checks the current status of a previously initiated deposit. */
checkDepositStatus(depositId: string): Promise<PawaPayDepositSearchResult>;
/**
* Initiates a payout (sending money to a customer).
* @param payload - The payout details. payoutId is optional; the SDK generates a UUIDv4 if omitted.
*/
requestPayout(payload: PawaPayPayoutPayload): Promise<PawaPayPayoutResponse>;
/** Checks the current status of a previously initiated payout. */
checkPayoutStatus(payoutId: string): Promise<PawaPayPayoutSearchResult>;
/** Cancels a payout that is still in the ENQUEUED state. */
cancelEnqueuedPayout(payoutId: string): Promise<PawaPayCancelEnqueuedPayoutResponse>;
/**
* Initiates a refund for a previous deposit.
* @param payload - The refund details. refundId is optional; the SDK generates a UUIDv4 if omitted.
*/
requestRefund(payload: PawaPayRefundPayload): Promise<PawaPayRefundResponse>;
/** Checks the current status of a previously initiated refund. */
checkRefundStatus(refundId: string): Promise<PawaPayRefundSearchResult>;
/** Cancels a refund that is still in the ENQUEUED state. */
cancelEnqueuedRefund(refundId: string): Promise<PawaPayCancelEnqueuedRefundResponse>;
/** Retrieves the countries, providers, and currencies active on your account. */
getActiveConfiguration(query?: PawaPayActiveConfigurationQuery): Promise<PawaPayActiveConfiguration>;
/** Predicts the mobile money provider for a given phone number (including country code). */
predictProvider(phoneNumber: string): Promise<PawaPayPredictProviderResponse>;
/** Retrieves your account's wallet balances, optionally filtered by country. */
getWalletBalances(country?: string): Promise<PawaPayWalletBalancesResponse>;
private handleApiError;
}
export default PawaPayClient;