Lithic.Resources.Payments (Lithic v1.0.0)

Copy Markdown View Source

ACH Payments — create, list, retry, return, and simulate.

Creating a payment

{:ok, payment} = Lithic.Payments.create(%{
  financial_account_token: "fa_token",
  external_bank_account_token: "eba_token",
  amount: 5000,
  direction: "DEBIT",
  method: "ACH_NEXT_DAY",
  method_attributes: %{sec_code: "PPD"},
  type: "PAYMENT"
})

Sandbox simulation

{:ok, _} = Lithic.Payments.simulate_receipt(%{
  token: payment["token"],
  financial_account_token: "fa_token",
  amount: 5000
})

{:ok, _} = Lithic.Payments.simulate_release(payment["token"])

Summary

Functions

create(params, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

get(payment_token, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

get_transfer_limits(opts \\ [])

@spec get_transfer_limits(keyword()) :: {:ok, map()} | {:error, Lithic.Error.t()}

Get transfer limits for ACH payments.

list(opts \\ [])

@spec list(keyword()) :: {:ok, Lithic.Page.t(map())} | {:error, Lithic.Error.t()}

retry(payment_token, opts \\ [])

@spec retry(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

return(payment_token, params \\ %{}, opts \\ [])

@spec return(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Lithic.Error.t()}

simulate_payment_lifecycle(payment_token, params, opts \\ [])

@spec simulate_payment_lifecycle(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, Lithic.Error.t()}

simulate_receipt(params, opts \\ [])

@spec simulate_receipt(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

simulate_release(payment_token, opts \\ [])

@spec simulate_release(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

simulate_return(payment_token, opts \\ [])

@spec simulate_return(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Lithic.Error.t()}

stream(opts \\ [])

@spec stream(keyword()) :: Enumerable.t()