Gocardlex.Behaviour.CustomerBankAccount behaviour (gocardlex v1.1.0)
Summary
Callbacks
Creates a new Customer Bank Account
Examples
iex> Gocardlex.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" => %{}}}}
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.
Callbacks
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> Gocardlex.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" => %{}}}}
Examples
iex> Gocardlex.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" => %{}}}}
Gets a Customer Bank Account based on their ID in GoCardless
Examples
iex> Gocardlex.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"}}}}
Lists Customer Bank Accounts from GoCardless
Examples
iex> Gocardlex.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}}}
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> Gocardlex.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"}}}}