AtEx v0.20.21 AtEx.Gateway.Payments.Query.FetchProductTransactions View Source

Fetch transactions of a particular payment product by sending a HTTP GET request to the following endpoint

Link to this section Summary

Functions

Fetch transactions of a particular payment product by sending a HTTP GET request to the following endpoint

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

fetch_product_transactions(attrs)

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

Fetch transactions of a particular payment product by sending a HTTP GET request to the following endpoint

Parameters

attrs: - a map containing:

  • productName - The name of the payment product whose transactions you’d like to fetch.
  • pageNumber - The number of the page you’d like to read results from. Please Note: This STARTS from 1 and NOT 0
  • count - The number of transaction results you would like for this query. Must be > 1 and < 1,000
  • and optional parameters startDate, endDate, category, provider, status, source, destination and providerChannel For more on how to use these keys https://build.at-labs.io/docs/payments%2Fquery%2Ffetch_product_transactions

Example

  iex>AtEx.Gateway.Payments.Query.FetchProductTransactions.fetch_product_transactions(%{productName: "AtEx", pageNumber: 1, count: 10})
  {:ok,
  %{
  "status" => "Success",
  "responses" => %{
      "requestMetadata" => %{
          "reason" => "Testing things..."
      },
      "sourceType" => "Wallet",
      "source" => "PaymentWallet",
      "provider" => "Mpesa",
      "destinationType" => "PhoneNumber",
      "description" => "The service request is processed successfully.",
      "providerChannel" => "824879",
      "transactionFee" => "KES 1.0000",
      "providerRefId" => "SAMPLE_MPESA_CODE",
      "providerMetadata" => %{
          "recipientIsRegistered" => "true",
          "recipientName" => "254724XXXYYY - John Doe"
      },
      "status" => "Success",
      "productName" => "testing",
      "category" => "MobileB2C",
      "transactionDate" => "12.05.2018 21:46:13",
      "destination" => "+254708663158",
      "value" => "KES 2900.0000",
      "transactionId" => "ATPid_b9379b671fee8ccf24b2c74f94da0ceb",
      "creationTime" => "2018-05-12 18:46:12"
  }
  }}

Process results from calling the gateway