MollieEx.Refunds (mollie_ex v0.2.0)

Copy Markdown View Source

Create, retrieve, list, and cancel Mollie payment refunds.

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

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

{:ok, refund} =
  MollieEx.Refunds.create(
    client,
    "tr_123",
    %{amount: %{currency: "EUR", value: "10.00"}},
    idempotency_key: "f7f88f02-9a60-4a1f-bab8-8ef9e29cfeaf"
  )

Summary

Functions

Cancels a Mollie refund by payment ID and refund ID.

Creates a refund for a Mollie payment.

Retrieves a Mollie refund by payment ID and refund ID.

Lists Mollie refunds for a payment.

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()}
  | {: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

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

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

Cancels a Mollie refund by payment ID and refund ID.

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

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

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

Creates a refund for a Mollie payment.

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

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

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

Retrieves a Mollie refund by payment ID and refund ID.

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

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

Lists Mollie refunds for a payment.