UNPKG

modem-pay

Version:

A TypeScript SDK for integrating with the Modem Pay payment gateway, enabling seamless payment processing and financial services in your applications.

168 lines (167 loc) 3.9 kB
export type TransferParams = { /** * The amount to be transferred. */ amount: number; /** * The currency code for the transfer (e.g., "GMD", "USD"). */ currency: string; /** * Optional description or note for the transfer. */ narration?: string; /** * The payment network to use for the transfer (e.g., "afrimoney", "wave"). */ network: string; /** * Name of the beneficiary receiving the transfer. */ beneficiary_name: string; /** * Optional additional metadata associated with the transfer. */ metadata?: object; /** * The account number of the beneficiary. */ account_number: string; /** * The URL to which Modem Pay will send a callback or webhook notification after payout processing. */ callback_url?: string; }; /** * Representation of a transfer transaction. */ export type Transfer = { /** * Unique identifier for the transfer. */ id: string; /** * ID of the business initiating the transfer. */ business_id: string; /** * ID of the account from which the transfer is made. */ account_id: string; /** * ID of the merchant associated with the transfer. */ merchant_id?: string; /** * ID of the recipient business, if applicable. */ recipient_business_id?: string; /** * Amount to be transferred. */ amount: number; /** * Fee charged for the transfer. */ fee: number; /** * Currency code for the transfer (e.g., "GMD", "USD"). */ currency: string; /** * Type of transfer (self, modem-pay, mobile-money, or bank). */ type: "self" | "modem-pay" | "mobile-money" | "bank"; /** * Current status of the transfer. */ status: "pending" | "completed" | "failed" | "cancelled"; /** * Account balance before the transfer. */ balance_before: number; /** * Account balance after the transfer. */ balance_after: number; /** * Name of the account holder. */ account_name?: string; /** * Payment network used for the transfer. */ network?: string; /** * Bank name for bank transfers. */ bank?: string; /** * Amount received by the beneficiary. */ amount_received?: number; /** * Mobile number for mobile money transfers. */ mobile_number?: string; /** * Account number for bank transfers. */ account_number?: string; /** * Unique reference number for the transfer. */ transfer_reference: string; /** * Indicates if the transfer is in test mode. */ test_mode: boolean; /** * Record of events related to the transfer. */ events: object; /** * Additional notes about the transfer. */ note?: string; /** * One-time password for transfer verification. */ otp?: string; /** * Additional metadata associated with the transfer. */ metadata: object; }; export type TransferFeeCheckParams = { /** * The amount to be transferred. */ amount: number; /** * The currency code for the transfer amount (e.g., "GMD", "USD"). */ currency: string; /** * The payment network to be used for the transfer (e.g., "afrimoney", "wave"). */ network: string; }; export type TransferFeeCheckResponse = { /** * The fee amount charged for the transfer. */ fee: number; /** * The currency code for the fee amount (e.g., "GMD", "USD"). */ currency: string; /** * The payment network used for the transfer (e.g., "afrimoney", "wave"). */ network: string; /** * The total amount to be transferred including fees. */ amount: number; };