OpenPayments.Types.PublicIncomingPayment (open_payments_elixir v1.0.0)

Copy Markdown View Source

An incoming payment returned without an access token.

Accepts the pinned incoming-payment-without-access-token schema and the minimal public shape used by the Node SDK and deployed servers: authServer with optional receivedAmount. Minimal responses leave detail fields nil. If any detail field is present, the complete pinned response is required, including unique payment methods. Amounts and ILP methods become typed structs. Omitted optional fields become nil; explicit nulls are invalid. Additional JSON fields are preserved in extensions.

URI fields and RFC 3339 timestamps remain strings with their original spelling, offsets and fractional precision. Timestamp validation checks calendar/clock bounds; leap-second notation must fall in the final UTC minute of a month, without consulting a historical leap-second table. It does not compare expiration to creation or current time. Schema validation does not compare amounts or asset identities.

Inspection omits payment methods and extensions. Explicit map/JSON exports include ILP shared secrets and must be treated as sensitive. This type makes no requests. Validate manually constructed or modified structs with validate/1; to_map/1 converts their shape without validating it.

Summary

Functions

Decodes a full pinned response or minimal public authorization information.

Converts supplied protocol fields, including method secrets, without validating.

Validates a full or minimal struct, treating nil optional fields as omitted.

Types

t()

@type t() :: %OpenPayments.Types.PublicIncomingPayment{
  auth_server: String.t(),
  completed: boolean() | nil,
  created_at: String.t() | nil,
  expires_at: String.t() | nil,
  extensions: %{optional(String.t()) => term()},
  id: String.t() | nil,
  incoming_amount: OpenPayments.Types.Amount.t() | nil,
  methods: [OpenPayments.Types.ILPPaymentMethod.t()] | nil,
  received_amount: OpenPayments.Types.Amount.t() | nil
}

Functions

from_map(data)

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

Decodes a full pinned response or minimal public authorization information.

to_map(payment)

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

Converts supplied protocol fields, including method secrets, without validating.

validate(payment)

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

Validates a full or minimal struct, treating nil optional fields as omitted.