View Source Ibanity.Sandbox.FinancialInstitutionAccount (ibanity v1.1.0)
Financial institution account API wrapper
Summary
Functions
Deletes an account belonging to a user and a financial institution.
Deletes an account belonging to a user and a financial institution.
Fetches the financial institution user this account belongs to.
Retrieves an account belonging to a user and a financial institution.
Retrieves an account belonging to a user and a financial institution.
List all accounts belonging to a user, within a financial institution.
List all accounts belonging to a user, within a financial institution.
Fetches the transactions associated to this account.
Functions
Creates a new financial institution account.
Returns {:ok, account}
when successful, {:error, reason}
otherwise.
Example
iex> [
...> subtype: "checking",
...> reference: "BE456789012",
...> reference_type: "IBAN",
...> description: "Savings account",
...> currency: "EUR"
...> ]
...> |> Request.attributes
...> |> Request.id(:financial_institution_id, "b5d6c5f9-e1d2-4cd1-a2aa-7baf964f7bf7")
...> |> Request.id(:financial_institution_user_id, "a64f42ec-c801-41a7-8801-0f815ca42e9e")
...> |> FinancialInstitutionAccount.create
{:ok, %Ibanity.FinancialInstitutionAccount{id: "3034fe85-29ee-4ebc-9a2d-33df4e2f4602", ...}}
Deletes an account belonging to a user and a financial institution.
Returns {:ok, account}
when successful, {:error, reason}
otherwise.
Example
iex> Request.id(:financial_institution_id, "b5d6c5f9-e1d2-4cd1-a2aa-7baf964f7bf7")
...> |> Request.id(:financial_institution_user_id, "a64f42ec-c801-41a7-8801-0f815ca42e9e")
...> |> Request.id(:id, "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7")
...> |> FinancialInstitutionAccount.delete
{:ok, Ibanity.FinancialInstitutionAccount{id: "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7", ...}}
Deletes an account belonging to a user and a financial institution.
Returns {:ok, account}
when successful, {:error, reason}
otherwise.
Example
iex> Ibanity.FinancialInstitutionAccount.delete(
...> "b5d6c5f9-e1d2-4cd1-a2aa-7baf964f7bf7",
...> "a64f42ec-c801-41a7-8801-0f815ca42e9e",
...> "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7",
...> )
{:ok, FinancialInstitutionAccount{id: "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7", ...}}
Fetches the financial institution user this account belongs to.
Returns:
{:ok, institution}
if successful,nil
if no financial institution user link was set on the structure{:error, reason}
otherwise
Retrieves an account belonging to a user and a financial institution.
Returns {:ok, account}
when successful, {:error, reason}
otherwise.
Example
iex> Request.id(:financial_institution_id, "b5d6c5f9-e1d2-4cd1-a2aa-7baf964f7bf7")
...> |> Request.id(:financial_institution_user_id, "a64f42ec-c801-41a7-8801-0f815ca42e9e")
...> |> Request.id(:id, "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7")
...> |> FinancialInstitutionAccount.find
{:ok, Ibanity.FinancialInstitutionAccount{id: "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7", ...}}
Retrieves an account belonging to a user and a financial institution.
Returns {:ok, account}
when successful, {:error, reason}
otherwise.
Example
iex> FinancialInstitutionAccount.find(
...> "b5d6c5f9-e1d2-4cd1-a2aa-7baf964f7bf7",
...> "a64f42ec-c801-41a7-8801-0f815ca42e9e",
...> "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7",
...> )
{:ok, Ibanity.FinancialInstitutionAccount{id: "b1c1e046-309b-49b8-bc5d-c4b1f82f61a7", ...}}
List all accounts belonging to a user, within a financial institution.
Returns {:ok, accounts}
where accounts
is a Ibanity.Collection
where items are Ibanity.FinancialInstitutionAccount
.
Examples
iex> |> Request.id(:financial_institution_id, "b5d6c5f9-e1d2-4cd1-a2aa-7baf964f7bf7")
...> |> Request.id(:financial_institution_user_id, "a64f42ec-c801-41a7-8801-0f815ca42e9e")
...> |> FinancialInstitutionAccount.list
{:ok, %Ibanity.Collection{items: [%Ibanity.FinancialInstitutionAccount{...}], ...}}
List all accounts belonging to a user, within a financial institution.
Returns {:ok, accounts}
where accounts
is a Ibanity.Collection
where items are Ibanity.FinancialInstitutionAccount
.
Fetches the transactions associated to this account.
Returns:
{:ok, transactions}
if successful, wheretransactions
is anIbanity.Collection
nil
if no transaction link was set on the structure{:error, reason}
otherwise