gocardless v1.0.3 Gocardless.Behaviour.CustomerBankAccount behaviour

Link to this section Summary

Callbacks

Creates a new Customer Bank Account

Gets a Customer Bank Account based on their ID in GoCardless

Lists Customer Bank Accounts from GoCardless

Updates a Customer Bank Account metadata based on their ID in GoCardless. Only the metadata parameter is allowed

Link to this section Callbacks

Link to this callback create_customer_bank_account(map)
create_customer_bank_account(map) :: tuple

Creates a new Customer Bank Account

Examples

iex> params = %{
  customer_bank_accounts: %{
    account_holder_name: "FirstName LastName", 
    account_number: "55779911", 
    branch_code: "200000", 
    country_code: "GB", 
    links: %{
      customer: "CU000999999998"
    }
  }
}
iex> Gocardless.Client.create_customer_bank_account(params)
{:ok,
%{"customer_bank_accounts" => %{"account_holder_name" => "FirstName LastName",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-23T13:37:09.967Z",
    "currency" => "GBP", "enabled" => true, "id" => "BA000999999998",
    "links" => %{"customer" => "CU000999999998"}, "metadata" => %{}}}}
Link to this callback disable_customer_bank_account(arg0)
disable_customer_bank_account(String.t) :: tuple

Examples

iex> Gocardless.Client.disable_customer_bank_account("BA000999999998")
{:ok,
%{"customer_bank_accounts" => %{"account_holder_name" => "FirstName LastName",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-23T13:37:09.967Z",
    "currency" => "GBP", "enabled" => false, "id" => "BA000999999998",
    "links" => %{"customer" => "CU000999999998"},
    "metadata" => %{}}}}
Link to this callback get_customer_bank_account(arg0)
get_customer_bank_account(String.t) :: tuple

Gets a Customer Bank Account based on their ID in GoCardless

Examples

iex> Gocardless.Client.get_customer_bank_account("BA000999999998")
{:ok,
%{"customer_bank_accounts" => %{"account_holder_name" => "FirstName LastName",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-23T13:37:09.967Z",
    "currency" => "GBP", "enabled" => true, "id" => "BA000999999998",
    "links" => %{"customer" => "CU000999999998"},
    "metadata" => %{"account_holder_name" => "FirstName LastName"}}}}
Link to this callback list_customer_bank_accounts(map)
list_customer_bank_accounts(map) :: tuple

Lists Customer Bank Accounts from GoCardless

Examples

iex> Gocardless.Client.list_customer_bank_accounts
{:ok,
%{"customer_bank_accounts" => [%{"account_holder_name" => "FirstName LastName",
      "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
      "country_code" => "GB", "created_at" => "2017-06-23T13:37:09.967Z",
      "currency" => "GBP", "enabled" => true, "id" => "BA000999999998",
      "links" => %{"customer" => "CU000999999998"},
      "metadata" => %{"account_holder_name" => "FirstName LastName"}}],
  "meta" => %{"cursors" => %{"after" => nil, "before" => nil}, "limit" => 50}}}
Link to this callback update_customer_bank_account(arg0, map)
update_customer_bank_account(String.t, map) :: tuple

Updates a Customer Bank Account metadata based on their ID in GoCardless. Only the metadata parameter is allowed.

Examples

iex> params = %{
  customer_bank_accounts: %{
    metadata: %{
      db_id: "1234"
    }
  }
}
iex> Gocardless.Client.update_customer_bank_account("BA000999999998", params)
{:ok,
%{"customer_bank_accounts" => %{"account_holder_name" => "FirstName LastName",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-23T13:37:09.967Z",
    "currency" => "GBP", "enabled" => true, "id" => "BA000999999998",
    "links" => %{"customer" => "CU000999999998"},
    "metadata" => %{"db_id" => "1234"}}}}