MollieEx.Mandates (mollie_ex v0.4.0)

Copy Markdown View Source

Create, retrieve, list, and revoke Mollie mandates for customers.

All functions return result tuples. They do not raise for ordinary API, transport, or validation failures.

Summary

Functions

Creates a mandate for a customer.

Retrieves a customer mandate by ID.

Lists customer mandates.

Types

create_option()

(since 0.4.0)
@type create_option() ::
  {:idempotency_key, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

create_params()

(since 0.4.0)
@type create_params() :: map()

get_option()

(since 0.4.0)
@type get_option() ::
  {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

list_option()

(since 0.4.0)
@type list_option() ::
  {:from, String.t()}
  | {:limit, pos_integer()}
  | {:scopes, [String.t()]}
  | {:sort, :asc | :desc | String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

revoke_option()

(since 0.4.0)
@type revoke_option() ::
  {:idempotency_key, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

Functions

create(client, customer_id, params, opts \\ [])

(since 0.4.0)
@spec create(MollieEx.Client.t(), String.t(), create_params(), [create_option()]) ::
  {:ok, MollieEx.Mandate.t()} | {:error, MollieEx.Error.t()}

Creates a mandate for a customer.

Mandate creation supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.

get(client, customer_id, mandate_id, opts \\ [])

(since 0.4.0)
@spec get(MollieEx.Client.t(), String.t(), String.t(), [get_option()]) ::
  {:ok, MollieEx.Mandate.t()} | {:error, MollieEx.Error.t()}

Retrieves a customer mandate by ID.

list(client, customer_id, opts \\ [])

(since 0.4.0)

Lists customer mandates.

revoke(client, customer_id, mandate_id, opts \\ [])

(since 0.4.0)
@spec revoke(MollieEx.Client.t(), String.t(), String.t(), [revoke_option()]) ::
  {:ok, :no_content} | {:error, MollieEx.Error.t()}

Revokes a customer mandate.

Mandate revocation supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.