Gocardlex.Behaviour.CreditorBankAccount behaviour (gocardlex v1.0.4)

Lists Creditor Bank Accounts from GoCardless

Examples

iex> Gocardlex.Client.list_creditor_bank_accounts
{:ok,
  %{"creditor_bank_accounts" => [%{"account_holder_name" => "JOHN DOE",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-27T11:16:37.353Z",
    "currency" => "GBP", "enabled" => true, "id" => "BA000999999999",
    "links" => %{"creditor" => "CR000099999999"}, "metadata" => %{}}],
    "meta" => %{"cursors" => %{"after" => nil, "before" => nil}, "limit" => 50}}}

Summary

Callbacks

Creates a new Creditor Bank Account

Disables a Creditor Bank Account based on their ID in GoCardless

Gets a Creditor Bank Account based on their ID in GoCardless

Callbacks

create_creditor_bank_account(map)

@callback create_creditor_bank_account(map()) :: tuple()

Creates a new Creditor Bank Account

Examples

iex> params = %{
  creditor_bank_accounts: %{
    account_holder_name: "John Doe",
    account_number: "55779911",
    branch_code: "200000",
    country_code: "GB",
    links: %{
      creditor: "CR000099999999"
    }
  }
}
iex> Gocardlex.Client.create_creditor_bank_account("BA000999999999")
{:ok,
  %{"creditor_bank_accounts" => %{"account_holder_name" => "JOHN DOE",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-27T11:16:37.353Z",
    "currency" => "GBP", "enabled" => true, "id" => "BA000999999999",
    "links" => %{"creditor" => "CR000099999999"}, "metadata" => %{}},
    "meta" => %{"cursors" => %{"after" => nil, "before" => nil}, "limit" => 50}}}

disable_creditor_bank_account(t)

@callback disable_creditor_bank_account(String.t()) :: tuple()

Disables a Creditor Bank Account based on their ID in GoCardless

Examples

iex> Gocardlex.Client.disable_creditor_bank_account("BA000999999999")
{:ok,
  %{"creditor_bank_accounts" => %{"account_holder_name" => "JOHN DOE",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-27T11:16:37.353Z",
    "currency" => "GBP", "enabled" => false, "id" => "BA000999999999",
    "links" => %{"creditor" => "CR000099999999"}, "metadata" => %{}},
    "meta" => %{"cursors" => %{"after" => nil, "before" => nil}, "limit" => 50}}}

get_creditor_bank_account(t)

@callback get_creditor_bank_account(String.t()) :: tuple()

Gets a Creditor Bank Account based on their ID in GoCardless

Examples

iex> Gocardlex.Client.get_creditor_bank_account("BA000999999999")
{:ok,
  %{"creditor_bank_accounts" => %{"account_holder_name" => "JOHN DOE",
    "account_number_ending" => "11", "bank_name" => "BARCLAYS BANK PLC",
    "country_code" => "GB", "created_at" => "2017-06-27T11:16:37.353Z",
    "currency" => "GBP", "enabled" => true, "id" => "BA000999999999",
    "links" => %{"creditor" => "CR000099999999"}, "metadata" => %{}},
    "meta" => %{"cursors" => %{"after" => nil, "before" => nil}, "limit" => 50}}}

list_creditor_bank_accounts(map)

@callback list_creditor_bank_accounts(map()) :: tuple()