AirtelMoney.Disbursements (airtel_money v0.1.0)

Copy Markdown View Source

Module for Airtel Money Disbursements API.

Allows sending payments to customers, validating payees, and checking transfer status.

Summary

Functions

Initiates a disbursement request.

Functions

disburse(params)

@spec disburse(map()) :: {:ok, map()} | {:error, AirtelMoney.Error.t()}

Initiates a disbursement request.

Parameters

  • params - A map with the following keys:
    • :msisdn - Recipient phone number (string, required)
    • :amount - Amount to disburse (string, required)
    • :reference - Transaction reference (string, required)
    • :id - Optional unique transaction ID (defaults to reference)
    • :pin - Optional encrypted PIN (required for production)
    • :payee_wallet_type - Wallet type (default: "COLL")
    • :payee_currency - Payee currency (default: config currency)
    • :payee_name - Optional payee name
    • :transaction_type - Transaction type (default: "B2C")
    • :version_tag - API version (default: "v2")

Examples

iex> _params = %{amount: "5000", msisdn: "2439xxxxxxx", reference: "PAY-001"}
iex> # This would normally call the API, but for doctest we skip the actual call
iex> :ok
:ok