dwolla v1.0.2 Dwolla.Customer View Source

Functions for customers endpoint.

Link to this section Summary

Functions

Creates a customer

Creates a customer funding source

Creates an unverified customer

Creates a verified customer

Gets a customer by id

Lists a customer's funding sources

Searches customer by first name, last name and email. Results paginated

Searchs a customer's transfers. Results paginated

Suspends a customer

Updates a customer's metadata

Updates a customer to verified status

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()) => String.t() | integer()}

Link to this type

t() View Source
t() :: %Dwolla.Customer{
  address1: String.t(),
  address2: String.t(),
  city: String.t(),
  created: String.t(),
  email: String.t(),
  first_name: String.t(),
  id: String.t(),
  last_name: String.t(),
  phone: String.t(),
  postal_code: String.t(),
  state: String.t(),
  status: String.t(),
  type: String.t()
}

Link to this section Functions

Link to this function

create(token, params) View Source
create(token(), params()) :: {:ok, location()} | {:error, error()}

Creates a customer.

See Dwolla.Customer.create_unverified/2 and Dwolla.Customer.create_verified/2.

Link to this function

create_funding_source(token, id, params) View Source
create_funding_source(token(), id(), params()) ::
  {:ok, location()} | {:error, error()}

Creates a customer funding source.

Parameters

%{
  routing_number: "222222226",
  account_number: "123456789",
  type: "checking",
  name: "Ben's checking"
}
Link to this function

create_unverified(token, params) View Source
create_unverified(token(), params()) :: {:ok, location()} | {:error, error()}

Creates an unverified customer.

Validates payload for required fields before calling Dwolla API.

Parameters

%{first_name: "Steve", last_name: "Rogers", email: "cap@example.com"}
Link to this function

create_verified(token, params) View Source
create_verified(token(), params()) :: {:ok, location()} | {:error, error()}

Creates a verified customer.

Validates payload for required fields before calling Dwolla API.

Parameters

%{
  first_name: "Steve",
  last_name: "Rogers",
  email: "cap@example.com",
  type: "personal",
  address1: "1600 Pennsylvania Ave",
  city: "Washington",
  state: "DC",
  postal_code: "20500",
  date_of_birth: "1918-07-04",
  ssn: "1776"
}
Link to this function

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

Gets a customer by id.

Link to this function

list_funding_sources(token, id, removed \\ true) View Source
list_funding_sources(token(), id(), boolean()) ::
  {:ok, [Dwolla.FundingSource.t()]} | {:error, error()}

Lists a customer's funding sources.

Link to this function

search(token, params \\ %{}) View Source
search(token(), params()) :: {:ok, [Dwolla.Customer.t()]} | {:error, error()}

Searches customer by first name, last name and email. Results paginated.

Parameters (optional)

%{limit: 50, offset: 0, search: "Steve"}
Link to this function

search_transfers(token, id, params \\ %{}) View Source
search_transfers(token(), id(), params()) ::
  {:ok, [Dwolla.Transfer.t()]} | {:error, error()}

Searchs a customer's transfers. Results paginated.

Parameters

%{startDate: "2017-04-01", endDate: "2017-04-30", status: "pending"}
Link to this function

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

Suspends a customer.

Link to this function

update(token, id, params) View Source
update(token(), id(), params()) ::
  {:ok, Dwolla.Customer.t()} | {:error, error()}

Updates a customer's metadata.

Link to this function

verify(token, id, params) View Source
verify(token(), id(), params()) ::
  {:ok, Dwolla.Customer.t()} | {:error, error()}

Updates a customer to verified status.

Parameters

%{
  first_name: "Steve",
  last_name: "Rogers",
  email: "cap@example.com",
  address1: "1600 Pennsylvania Ave",
  city: "Washington",
  state: "DC",
  postal_code: "20500",
  date_of_birth: "1918-07-04",
  ssn: "1776"
}