View Source AtEx.Gateway.Payments.Mobile.B2b (AtEx v0.20.23)

This module holds the implementation for the HTTP Gateway that runs calls against the Africas Talking Mobile B2B API

Summary

Functions

Mobile Business To Business (B2B) APIs allow you to send payments to businesses e.g banks from your Payment Wallet.

Process results from calling the gateway

Functions

@spec b2b_checkout(map()) :: {:ok, term()} | {:error, term()}

Mobile Business To Business (B2B) APIs allow you to send payments to businesses e.g banks from your Payment Wallet.

Config

Add b2b_product_name key to the AtEx config values

Parameters

attrs: - a map containing a provider(Mpesa,TigoTanzania,Athena), transferType(BusinessBuyGoods,BusinessPayBill, DisburseFundsToBusiness, BusinessToBusinessTransfer), currencyCode amount, destinationChannel, destinationAccount and a map of metadata see the docs at https://build.at-labs.io/docs/payments%2Fmobile%2Fb2b for how to use these keys

Example

  iex>AtEx.Gateway.Payments.Mobile.B2b.b2b_checkout(%{provider: "Athena", transferType: "DisburseFundsToBusiness", amount: 10, currencyCode: "KES", destinationChannel: "Mine", destinationAccount: "Mine", metadata: %{ message: "I am here"}})
  {:ok,
  %{
  "providerChannel" => "525900",
  "status" => "Queued",
  "transactionFee" => "KES 0.1000",
  "transactionId" => "ATPid_2504d5f5d28256fa264e815518e3ab0d"
  }}

Process results from calling the gateway