The response to rotating an issued access token.
Required access_token becomes an AccessToken; permitted additional JSON
fields remain in extensions. The wrapper is retained, matching the wire
response and Node's rotate result. All nested access entries are validated.
Inspection omits payload values; explicit map/JSON exports include the token
and any card results. This codec does not update a client, persist a token,
assess expiry or compare old/new access. Validate modified structs with
validate/1; to_map/1 converts shape without validating it.
Summary
Functions
Decodes the issued token wrapper and preserves permitted JSON extensions.
Converts to protocol fields, including token/card values, without validating.
Revalidates the issued token and JSON extension data.
Types
@type t() :: %OpenPayments.Types.TokenRotationResponse{ access_token: OpenPayments.Types.AccessToken.t(), extensions: %{optional(String.t()) => term()} }
Functions
@spec from_map(map()) :: {:ok, t()} | {:error, OpenPayments.Error.t()}
Decodes the issued token wrapper and preserves permitted JSON extensions.
Converts to protocol fields, including token/card values, without validating.
@spec validate(t()) :: :ok | {:error, OpenPayments.Error.t()}
Revalidates the issued token and JSON extension data.