OpenPayments.Types.InteractionRequest (open_payments_elixir v1.0.0)

Copy Markdown View Source

Consent interaction preferences sent in a grant request's interact field.

The pinned schema requires a start array whose entries are redirect. It does not require the array to be nonempty or unique. Optional finish becomes a typed InteractionFinish; omission becomes nil, while explicit null is invalid. Additional JSON fields are preserved in extensions at both object levels.

Inspection omits the callback and extensions. Map/JSON export includes callback nonces. This type does not generate nonces, open a consent page, verify callback hashes or continue a grant. Validate manually constructed or modified structs with validate/1; to_map/1 converts shape without validating it.

Summary

Functions

Decodes and validates grant interaction preferences and callback data.

Converts to protocol fields, including callback nonces, without validating.

Validates a struct and its typed callback, treating nil finish as omitted.

Types

t()

@type t() :: %OpenPayments.Types.InteractionRequest{
  extensions: %{optional(String.t()) => term()},
  finish: OpenPayments.Types.InteractionFinish.t() | nil,
  start: [String.t()]
}

Functions

from_map(data)

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

Decodes and validates grant interaction preferences and callback data.

to_map(interaction)

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

Converts to protocol fields, including callback nonces, without validating.

validate(interaction)

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

Validates a struct and its typed callback, treating nil finish as omitted.