OpenPayments.Types.InteractionFinish (open_payments_elixir v1.0.0)

Copy Markdown View Source

A grant interaction request's completion callback configuration.

The pinned schema requires method redirect, an absolute callback uri and a string nonce. Additional JSON fields are preserved in extensions. The caller must supply a unique, unguessable nonce for each grant request; this data codec checks its type without generating or assessing its randomness.

URI spelling is preserved without HTTP request-target restrictions. Inspection omits the nonce and extensions; explicit map/JSON exports include them for the protocol. This type does not follow redirects or verify a callback hash.

Struct literals can bypass validation. Call validate/1 after constructing or modifying a struct; to_map/1 converts its shape without validating it.

Summary

Functions

Decodes and validates interaction callback configuration.

Converts to protocol fields, including the nonce, without validating.

Validates a callback configuration without retaining rejected field values.

Types

t()

@type t() :: %OpenPayments.Types.InteractionFinish{
  extensions: %{optional(String.t()) => term()},
  method: String.t(),
  nonce: String.t(),
  uri: String.t()
}

Functions

from_map(data)

@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}

Decodes and validates interaction callback configuration.

to_map(finish)

@spec to_map(t()) :: map()

Converts to protocol fields, including the nonce, without validating.

validate(finish)

@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}

Validates a callback configuration without retaining rejected field values.