dwolla v1.0.1 Dwolla.Transfer View Source

Functions for transfers endpoint.

Link to this section Summary

Functions

Cancels a transfer

Gets a transfer by id

Gets reason for a transfer's failure

Link to this section Types

Link to this type

location() View Source
location() :: %{id: String.t()}

Link to this type

params() View Source
params() :: %{required(atom()) => any()}

Link to this type

t() View Source
t() :: %Dwolla.Transfer{
  amount: Dwolla.Transfer.Amount.t(),
  can_cancel: boolean(),
  created: String.t(),
  dest_resource: String.t(),
  dest_resource_id: String.t(),
  id: String.t(),
  metadata: Dwolla.Transfer.Metadata.t(),
  source_funding_source_id: String.t(),
  source_resource: String.t(),
  source_resource_id: String.t(),
  status: String.t()
}

Link to this section Functions

Link to this function

cancel(token, id) View Source
cancel(token(), id()) :: {:ok, Dwolla.Transfer.t()} | {:error, error()}

Cancels a transfer.

Link to this function

get(token, id) View Source
get(token(), id()) :: {:ok, Dwolla.Transfer.t()} | {:error, error()}

Gets a transfer by id.

Link to this function

get_transfer_failure_reason(token, id) View Source
get_transfer_failure_reason(token(), id()) ::
  {:ok, Dwolla.Transfer.Failure} | {:error, error()}

Gets reason for a transfer's failure.

Link to this function

initiate(token, params, idempotency_key \\ nil) View Source
initiate(token(), params(), any() | nil) ::
  {:ok, location()} | {:error, error()}

Initiates a transfer.

The parameters are verbose because of the many options available to the user for setting the source and destination of the funds in the href field.

Parameters

%{
  _links: %{
    source: %{
      href: "https://api-sandbox.dwolla.com/funding-sources/..."
    },
    destination: %{
      href: "https://api-sandbox.dwolla.com/funding-sources/..."
    }
  },
  amount: %{
    value: 100.00,
    currency: "USD"
  },
  metadata: %{
    vendor: "Acme Inc.",
    note: "Invoice #12314"
  }
}