MollieEx.Customers (mollie_ex v0.4.0)

Copy Markdown View Source

Create, retrieve, list, update, delete, and inspect payments for Mollie customers.

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

Customer creation accepts a caller-owned idempotency key. The SDK never generates idempotency keys implicitly.

{:ok, customer} =
  MollieEx.Customers.create(
    client,
    %{
      name: "Jane Doe",
      email: "jane@example.org"
    },
    idempotency_key: "0e4f812e-5d50-4fcb-8c42-153f17e52147"
  )

Summary

Functions

Creates a Mollie customer.

Creates a Mollie payment for a customer.

Deletes a Mollie customer by ID.

Retrieves a Mollie customer by ID.

Lists Mollie customers.

Lists payments linked to a Mollie customer.

Updates a Mollie customer by ID.

Types

create_option()

(since 0.2.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.2.0)
@type create_params() :: map()

create_payment_option()

(since 0.2.0)
@type create_payment_option() ::
  {:idempotency_key, String.t()}
  | {:include, String.t()}
  | {:profile_id, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

create_payment_params()

(since 0.2.0)
@type create_payment_params() :: map()

delete_option()

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

get_option()

(since 0.2.0)
@type get_option() ::
  {:include, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

list_option()

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

list_payments_option()

(since 0.2.0)
@type list_payments_option() ::
  {:from, String.t()}
  | {:limit, pos_integer()}
  | {:sort, :asc | :desc | String.t()}
  | {:profile_id, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

update_option()

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

update_params()

(since 0.2.0)
@type update_params() :: map()

Functions

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

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

Creates a Mollie customer.

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

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

(since 0.3.0)
@spec create_payment(MollieEx.Client.t(), String.t(), create_payment_params(), [
  create_payment_option()
]) ::
  {:ok, MollieEx.Payment.t()} | {:error, MollieEx.Error.t()}

Creates a Mollie payment for a customer.

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

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

(since 0.2.0)
@spec delete(MollieEx.Client.t(), String.t(), [delete_option()]) ::
  {:ok, :no_content} | {:error, MollieEx.Error.t()}

Deletes a Mollie customer by ID.

Customer deletion supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.

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

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

Retrieves a Mollie customer by ID.

list(client, opts \\ [])

(since 0.2.0)
@spec list(MollieEx.Client.t(), [list_option()]) ::
  {:ok, MollieEx.List.t(MollieEx.Customer.t())} | {:error, MollieEx.Error.t()}

Lists Mollie customers.

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

(since 0.3.0)
@spec list_payments(MollieEx.Client.t(), String.t(), [list_payments_option()]) ::
  {:ok, MollieEx.List.t(MollieEx.Payment.t())} | {:error, MollieEx.Error.t()}

Lists payments linked to a Mollie customer.

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

(since 0.2.0)
@spec update(MollieEx.Client.t(), String.t(), update_params(), [update_option()]) ::
  {:ok, MollieEx.Customer.t()} | {:error, MollieEx.Error.t()}

Updates a Mollie customer by ID.

Customer updates support caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.