View Source Dwolla.Transfer (dwolla v1.0.1)

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

Specs

error() :: HTTPoison.Error.t() | Dwolla.Errors.t() | tuple()

Specs

id() :: String.t()

Specs

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

Specs

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

Specs

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()
}

Specs

token() :: String.t()

Link to this section Functions

Specs

cancel(token(), id()) :: {:ok, t()} | {:error, error()}

Cancels a transfer.

Specs

get(token(), id()) :: {:ok, t()} | {:error, error()}

Gets a transfer by id.

Link to this function

get_transfer_failure_reason(token, id)

View Source

Specs

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

Specs

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"
  }
}