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

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

Summary

Functions

Card Checkout APIs allow your application to collect money into your Payment Wallet by initiating transactions that deduct money from a customers Debit or Credit Card.

Process results from calling the gateway

Functions

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

Card Checkout APIs allow your application to collect money into your Payment Wallet by initiating transactions that deduct money from a customers Debit or Credit Card.

Config

Add card_checkout_product_name key to your AtEx configs

Parameters

attrs: - a map containing either paymentCard(a map) or checkoutToken, currencyCode, amount, narration and a map of metadata(optional) see the docs at https://build.at-labs.io/docs/payments%2Fcard%2Fcheckout for how to use these keys

Example

  iex>AtEx.Gateway.Payments.Card.Checkout.card_checkout(%{amount: 1000.00, currencyCode: "KES", narration: "Payment", paymentCard: %{number: "10928873477387", cvvNumber: 253, expiryMonth: 12, expiryYear: 2020, countryCode: "NG", authToken: "jhdguyt6372gsu6q"}})
  {:ok, %{
        status: "PendingValidation",
        description: "Waiting for user input",
        transactionId: "ATPid_SampleTxnId123"
      }}

Process results from calling the gateway