MollieEx.Captures (mollie_ex v0.4.0)

Copy Markdown View Source

Create, retrieve, and list Mollie payment captures.

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

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

{:ok, capture} =
  MollieEx.Captures.create(
    client,
    "tr_123",
    %{amount: %{currency: "EUR", value: "10.00"}},
    idempotency_key: "7da9444e-4360-4ab4-b411-73b33ac52b1f"
  )

Summary

Functions

Creates a capture for an authorized Mollie payment.

Retrieves a Mollie capture by payment ID and capture ID.

Lists Mollie captures for a payment.

Types

create_option()

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

get_option()

(since 0.1.0)
@type get_option() ::
  {: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()}
  | {:embed, String.t()}
  | {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

Functions

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

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

Creates a capture for an authorized Mollie payment.

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

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

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

Retrieves a Mollie capture by payment ID and capture ID.

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

(since 0.1.0)

Lists Mollie captures for a payment.