AtEx v0.20.21 AtEx.Gateway.Payments.TopupStash View Source
This is the Topup stash module that implements APIs to allow you to move money from a Payment Product to an Africa’s Talking application stash. An application stash is the wallet that funds your service usage expences.
Link to this section Summary
Functions
Process results from calling the gateway
Topup stash APIs allow you to move money from a Payment Product to an Africa’s Talking application stash. An application stash is the wallet that funds your service usage expences.
Link to this section Types
Link to this type
option()
View Sourceoption() :: {:method, Tesla.Env.method()} | {:url, Tesla.Env.url()} | {:query, Tesla.Env.query()} | {:headers, Tesla.Env.headers()} | {:body, Tesla.Env.body()} | {:opts, Tesla.Env.opts()}
Link to this section Functions
Process results from calling the gateway
Topup stash APIs allow you to move money from a Payment Product to an Africa’s Talking application stash. An application stash is the wallet that funds your service usage expences.
Parameters
map: - a map containing:
productName
Africa’s Talking Payment product to initiate this transaction.currencyCode
3-digit ISO format currency code for the value of this transaction (e.g KES, UGX, USD)amount
Amount - in the provided currency - that the application will be topped up with.metadata
A map of any metadata that you would like us to associate with the request. Use this field to send data that will map notifications to topup stash requests. It will be included in the notification we send once the topup stash request is completed.
Example
iex> AtEx.Gateway.Payments.TopupStash.topup(%{ currencyCode: "KES", amount: 1500, productName: "AtEx", metadata: %{ message: "I am here"}})
{:ok,
%{
"status" => "Success",
"description" => "Topped up user stash. New Stash Balance: KES 1500.00",
"transactionId" => "ATPid_SampleTxnId123"
}
}