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

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

Summary

Functions

This function initiates a mobile checkout request by sending a HTTP POST request to the Africa's talking Mobile Checkout endpoint.

Process results from calling the gateway

Functions

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

This function initiates a mobile checkout request by sending a HTTP POST request to the Africa's talking Mobile Checkout endpoint.

Config

Add stk_product_name key to your AtEx configs

Parameters

attrs: - a map containing a phoneNumber, currencyCode and amount key optionally it may also contain providerChannel and a map of metadata see the docs at https://build.at-labs.io/docs/payments%2Fmobile%2Fcheckout for how to use these keys

Example

  iex> AtEx.Gateway.Payments.Mobile.Checkout.mobile_checkout(%{phoneNumber: "254724540000", amount: 10, currencyCode: "KES"})
  {:ok,
  %{
      "description" => "Waiting for user input",
      "providerChannel" => "525900",
      "status" => "PendingConfirmation",
      "transactionId" => "ATPid_ca3ba091736bd8502afd4376a7519cf8"
  }
  }

Process results from calling the gateway