AirtelMoney.Collections (airtel_money v0.1.0)

Copy Markdown View Source

Module for Airtel Money Collections API.

Allows collecting payments from customers.

Summary

Functions

Initiates a collection request.

Functions

collect(params)

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

Initiates a collection request.

Parameters

  • params - A map with the following keys:
    • :amount - Amount to collect (string)
    • :msisdn - Customer phone number (string)
    • :reference - Transaction reference (string)
    • :id - Optional unique transaction ID (defaults to reference)

Examples

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