MollieEx.Payments (mollie_ex v0.3.0)

Copy Markdown View Source

Create, retrieve, list, update, cancel, and release authorizations for Mollie payments.

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

Write operations accept caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.

{:ok, payment} =
  MollieEx.Payments.create(
    client,
    %{
      description: "Order #123",
      amount: %{currency: "EUR", value: "10.00"},
      redirect_url: "https://example.com/checkout/return"
    },
    idempotency_key: "9f0f9a78-9d56-4d2b-a7b6-7fdb8cc7d5f3"
  )

Summary

Functions

Cancels a Mollie payment by payment ID.

Creates a Mollie payment.

Retrieves a Mollie payment by payment ID.

Lists Mollie payments.

Releases the remaining authorization for a Mollie payment.

Updates a Mollie payment by payment ID.

Types

cancel_option()

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

create_option()

(since 0.1.0)
@type create_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_params()

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

get_option()

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

list_option()

(since 0.1.0)
@type list_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()}

release_authorization_option()

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

update_option()

(since 0.1.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.1.0)
@type update_params() :: map()

Functions

cancel(client, payment_id, opts \\ [])

(since 0.1.0)
@spec cancel(MollieEx.Client.t(), String.t(), [cancel_option()]) ::
  {:ok, MollieEx.Payment.t()} | {:error, MollieEx.Error.t()}

Cancels a Mollie payment by payment ID.

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

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

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

Creates a Mollie payment.

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

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

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

Retrieves a Mollie payment by payment ID.

list(client, opts \\ [])

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

Lists Mollie payments.

release_authorization(client, payment_id, opts \\ [])

(since 0.1.0)
@spec release_authorization(MollieEx.Client.t(), String.t(), [
  release_authorization_option()
]) ::
  {:ok, :accepted} | {:error, MollieEx.Error.t()}

Releases the remaining authorization for a Mollie payment.

Authorization release supports caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.

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

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

Updates a Mollie payment by payment ID.

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