Ibanity.PontoConnect.ReauthorizationRequest (ibanity v1.0.0)
Link to this section Summary
Functions
Same as create/2, but :attributes
and :token
must be set in request.
Link to this section Functions
Link to this function
create(request)
Same as create/2, but :attributes
and :token
must be set in request.
examples
Examples
Set id and token to request a reauthorization
iex> %Ibanity.PontoConnect.Token{}
...> |> Ibanity.Request.token()
...> |> Ibanity.Request.id(:account_id, account_id)
...> |> Ibanity.Request.attribute(:redirect_uri, "https://fake-tpp.com/account-reauthorization-confirmation")
...> |> Ibanity.PontoConnect.Reauthorization.create()
{:ok, %Ibanity.PontoConnect.Reauthorization{
redirect: "https://authorize.myponto.com/organizations/dd311734-9762-457e-989f-03292a1e55c9/sandbox/integrations/ad15e188-9385-44ef-a641-1cce3852c520/accounts/10cffaaf-f793-4672-bca1-4f150161b97e/reauthorization-requests/21bd0546-4ec2-4da3-8117-56b265255dec"
}}
Link to this function
create(request_or_token, account_or_id, attrs)
Requests an account reauthorization.
Returns {:ok, %__MODULE__{}}
if successful, {:error, reason}
otherwise.
example
Example
Fetch an account before each example, or use a valid account id
iex> {:ok, account_or_id} = token |> Ibanity.PontoConnect.Account.find("03ebe0ae-f630-4414-b37b-afde7de67229")
Or
iex> account_or_id = "03ebe0ae-f630-4414-b37b-afde7de67229"
"03ebe0ae-f630-4414-b37b-afde7de67229"
Attributes
iex> attributes = [redirect_uri: "https://fake-tpp.com/account-reauthorization-confirmation]
With token
iex> Ibanity.PontoConnect.ReauthorizationRequest.create(token, account_or_id, attributes)
{:ok, %Ibanity.PontoConnect.ReauthorizationRequest{
redirect: "https://authorize.myponto.com/organizations/dd311734-9762-457e-989f-03292a1e55c9/sandbox/integrations/ad15e188-9385-44ef-a641-1cce3852c520/accounts/10cffaaf-f793-4672-bca1-4f150161b97e/reauthorization-requests/21bd0546-4ec2-4da3-8117-56b265255dec"
}}
With request
iex> token
...> Ibanity.Request.token()
...> |> Ibanity.PontoConnect.ReauthorizationRequest.create(account_or_id, attributes)
{:ok, %Ibanity.PontoConnect.ReauthorizationRequest{
redirect: "https://authorize.myponto.com/organizations/dd311734-9762-457e-989f-03292a1e55c9/sandbox/integrations/ad15e188-9385-44ef-a641-1cce3852c520/accounts/10cffaaf-f793-4672-bca1-4f150161b97e/reauthorization-requests/21bd0546-4ec2-4da3-8117-56b265255dec"
}}