MollieEx.Refunds (mollie_ex v0.4.0)

Copy Markdown View Source

Create, retrieve, list, and cancel Mollie 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

Lists all Mollie refunds.

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

all_option()

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

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

all(client, opts \\ [])

(since 0.3.0)
@spec all(MollieEx.Client.t(), [all_option()]) ::
  {:ok, MollieEx.List.t(MollieEx.Refund.t())} | {:error, MollieEx.Error.t()}

Lists all Mollie refunds.

This is the top-level refund list endpoint. Use list/3 to list refunds for a specific payment.

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.