MollieEx.PaymentRoutes (mollie_ex v0.3.0)

Copy Markdown View Source

Create, retrieve, update, and list Mollie delayed payment routes.

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

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

{:ok, route} =
  MollieEx.PaymentRoutes.create(
    client,
    "tr_123",
    %{
      amount: %{currency: "EUR", value: "10.00"},
      destination: %{type: "organization", organization_id: "org_123"}
    },
    idempotency_key: "1de10c6a-8b87-4e0c-9c88-52f4c8936d5d"
  )

Summary

Functions

Creates a delayed route for a Mollie payment.

Retrieves a delayed route by payment ID and route ID.

Lists delayed routes for a payment.

Types

create_option()

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

get_option()

(since 0.2.0)
@type get_option() ::
  {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

list_option()

(since 0.2.0)
@type list_option() ::
  {:testmode, boolean()}
  | {:pool_timeout, pos_integer()}
  | {:receive_timeout, pos_integer()}
  | {:request_timeout, pos_integer()}

update_release_date_option()

(since 0.2.0)
@type update_release_date_option() ::
  {:idempotency_key, 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.2.0)
@spec create(MollieEx.Client.t(), String.t(), create_params(), [create_option()]) ::
  {:ok, MollieEx.Route.t()} | {:error, MollieEx.Error.t()}

Creates a delayed route for a Mollie payment.

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

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

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

Retrieves a delayed route by payment ID and route ID.

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

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

Lists delayed routes for a payment.

update_release_date(client, payment_id, route_id, release_date, opts \\ [])

(since 0.3.0)
@spec update_release_date(
  MollieEx.Client.t(),
  String.t(),
  String.t(),
  String.t(),
  [update_release_date_option()]
) :: {:ok, MollieEx.Route.t()} | {:error, MollieEx.Error.t()}

Updates the release date for a delayed route.

The release date must be a date-only YYYY-MM-DD string.

Route release date updates support caller-owned idempotency keys. The SDK never generates idempotency keys implicitly.