MollieEx.PaymentLinks (mollie_ex v0.4.0)

Copy Markdown View Source

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

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

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

{:ok, payment_link} =
  MollieEx.PaymentLinks.create(
    client,
    %{
      description: "Order #123",
      amount: %{currency: "EUR", value: "10.00"}
    },
    idempotency_key: "fc1693c0-b788-46f5-9d08-61eac31d5ab8"
  )

Summary

Functions

Creates a Mollie payment link.

Deletes a Mollie payment link by ID.

Retrieves a Mollie payment link by ID.

Lists Mollie payment links.

Lists payments created for a Mollie payment link.

Updates a Mollie payment link by ID.

Types

create_option()

(since 0.2.0)
@type create_option() ::
  {:idempotency_key, String.t()}
  | {:profile_id, 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()

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() ::
  {: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()}
  | {: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()}
  | {: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.PaymentLink.t()} | {:error, MollieEx.Error.t()}

Creates a Mollie payment link.

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

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

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

Deletes a Mollie payment link by ID.

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

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

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

Retrieves a Mollie payment link by ID.

list(client, opts \\ [])

(since 0.2.0)

Lists Mollie payment links.

list_payments(client, payment_link_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 created for a Mollie payment link.

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

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

Updates a Mollie payment link by ID.

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