AtEx v0.20.21 AtEx.Gateway.Payments.Card.Validate View Source

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

Link to this section Summary

Functions

Card checkout validation APIs allow your application to validate card checkout charge requests.

Process results from calling the gateway

Link to this section Types

Link to this type

option()

View Source
option() ::
  {: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

Link to this function

card_validate(attrs)

View Source
card_validate(map()) :: {:ok, term()} | {:error, term()}

Card checkout validation APIs allow your application to validate card checkout charge requests.

Parameters

attrs: - a map containing transactionId and otp see the docs at https://build.at-labs.io/docs/payments%2Fcard%2Fvalidate for how to use these keys

Example

  iex>AtEx.Gateway.Payments.Card.Validate.card_validate(%{transactionId: "ATPid_SampleTxnId123", otp: "password"})
  {:ok,
  %{
      status: "Success",
      description: "Payment completed successfully",
      checkoutToken: "ATCdTkn_SampleCdTknId123"
  }}

Process results from calling the gateway