Mollie.Connect (mollie v0.7.2)
Mollie Connect is a set of APIs and tools that allows you to connect multiple Mollie accounts together.
More info at: https://docs.mollie.com/connect/overview
Link to this section Summary
Functions
Generates the authorization URL
Exchange the auth code received at the Authorize endpoint for an actual access token, with which you can communicate with the Mollie API.
Revoke an access- or a refresh token. Once revoked the token can not be used anymore.
Link to this section Functions
authorization_url(client, params)
Specs
authorization_url(Mollie.Client.t(), map() | Keyword.t()) :: binary()
Generates the authorization URL
Params example
%{
"client_id" => "app_dnR5f6uPDWhrvZkiL9ex7Wjj",
"state" => "a63f5cfcdaa209e2302be84da28008e8",
"scope" => "payments.read payments.write profiles.read organizations.read",
"response_type" => "code",
"approval_prompt" => "auto",
"redirect_uri" => "https://example.com"
}
example
Example
Mollie.Connect.authorization_url client, params
More info at: https://docs.mollie.com/reference/oauth2/authorize
create_token(client, body)
Specs
create_token(Mollie.Client.t(), map()) :: Mollie.response()
Exchange the auth code received at the Authorize endpoint for an actual access token, with which you can communicate with the Mollie API.
Token body example
%{
"grant_type" => "authorization_code",
"code" => "auth_IbyEKUrXmGW1J8hPg6Ciyo4aaU6OAu"
}
example
Example
Mollie.Connect.create_token client, token_body
More info at: https://docs.mollie.com/reference/oauth2/tokens
revoke_token(client, body)
Specs
revoke_token(Mollie.Client.t(), map()) :: Mollie.response()
Revoke an access- or a refresh token. Once revoked the token can not be used anymore.
When you revoke a refresh token, all access tokens based on the same authorization grant will be revoked as well.
Token body example
%{
"token_type_hint" => "access_token",
"token" => "auth_IbyEKUrXmGW1J8hPg6Ciyo4aaU6OAu"
}
example
Example
Mollie.Connect.revoke_token client, token_body
More info at: https://docs.mollie.com/reference/oauth2/tokens