Skip to main content

Crate r402_server

Crate r402_server 

Source
Expand description

Resource server, paymentFlow, and authorization SettlementMode scheduler.

Structs§

BackgroundSettlementTracker
Shared in-flight counter for background settlement tasks.
CancellationGuard
Ensures on_verified_payment_canceled runs at most once for a payment.
CompletedSettlement
Successful settle captured for a later phase (echo / cancel).
HookPolicyError
Hook violated an enrichment mutation policy.
IncompatibleSettlementMode
Concurrent or Background used with a flow that settles before the handler.
PaymentFlowConfig
Supported payment flows for one assetTransferMethod.
PaymentFlowPhases
Verify/settle phase flags for a PaymentFlowName.
PaymentFlowScheme
Scheme fields required to resolve ATM + payment flow.
PaymentHookContext
Shared context for resource-server payment hooks.
PaymentRequiredBuildContext
Inputs for ResourceServer::create_payment_required_response.
ResolvedPaymentFlow
Result of resolve_payment_flow.
ResourceServer
Server-side payment orchestrator.
SchemePaymentRequiredContext
Context for scheme 402 enrichment.
SettleContext
Context for before-settle / settle-failure hooks.
SettleResponseCoreSnapshot
Facilitator-settled fields that extensions must not rewrite.
SettleResultContext
Context for after-settle hooks.
SettlementSchedule
Result of schedule.
SkipHandlerDirective
In-process directive when an after-verify hook skips the resource handler.
VerifiedPaymentCanceledContext
Context for verified-payment cancellation.
VerifyPaymentOutcome
Successful verify path outcome (after hooks).
VerifyResultContext
Context for after-verify hooks (includes facilitator result).

Enums§

AfterHandler
After-handler action selected by schedule.
AfterVerifyDecision
Decision from an after-verify hook.
BeforeOpDecision
Decision from a “before verify/settle” hook.
CancelReason
Why a verified payment was canceled before settlement.
FacilitatorSupportError
Facilitator /supported kind is missing or its extra is unusable.
PaymentFlowError
Failures from payment-flow resolution or wire-name parsing.
PaymentFlowName
Closed set of payment-flow names (when on-chain value moves relative to the handler).
ScheduledSettlement
Outcome of run (Concurrent / Background).
SequentialFinish
Outcome of finish (Sequential).
SettlePhase
Which settle invocation is running.
SettlementMode
After-handler settle scheduler for PaymentFlowName::Authorization.

Constants§

PAYMENT_FLOWS
Closed PAYMENT_FLOWS table (authorization, upfront, escrow).
RESERVED_PAYMENT_FLOW_EXTRA_KEYS
Protocol-reserved extra keys. Enrichment must not add or change them.
SDK_DEFAULT_ASSET_TRANSFER_METHOD
SDK-only ATM key for schemes with no on-wire assetTransferMethod.

Traits§

DynResourceServerHooks
Object-safe erasure of ResourceServerHooks.
DynSchemeNetworkServer
Object-safe erasure of SchemeNetworkServer.
ResourceServerHooks
Lifecycle hooks for the resource server (transport-agnostic).
SchemeNetworkServer
Scheme/network adapter registered on crate::ResourceServer.

Functions§

apply_payment_flow_wire_extra
Applies resolved payment-flow rules to 402 extra:
assert_accepts_additive_extra_after_scheme_enrich
Scheme 402 enrich may only add extra keys on matching accepts.
assert_accepts_allowlisted_after_extension_enrich
Extension 402 enrich: vacant payTo / amount / asset may be filled.
assert_additive_payload_enrichment
Ensures scheme settlement-payload enrichment only adds new keys.
assert_additive_settlement_extra
Ensures scheme response enrichment only adds new extra fields, including nested objects.
assert_settle_response_core_unchanged
Ensures enrichSettlementResponse did not rewrite facilitator outcome fields.
build_failure_path_settlement_response
Settlement receipt attached when the resource handler fails after verify.
extra_payment_flow
extra.paymentFlow when extra is a JSON object.
finish
Sequential after-handler settle. Does not take a handler.
is_authorization_payment_flow
Whether the accept is authorization (omit, JSON null, or "authorization").
is_recognized_payment_flow
Whether extra.paymentFlow is absent/null or a closed payment-flow name.
is_vacant_string_field
True when a string field is treated as unset and may be filled by enrichment.
merge_additive_settlement_extra
Merges server-owned settlement response fields after additive policy validation.
resolve_payment_flow
Resolves assetTransferMethod and paymentFlow from a scheme table and requirements.
resolve_payment_flow_phases
Resolves the phase table for a payment flow name.
run
Concurrent / Background after-handler settle. Does not inspect transport status.
schedule
Selects the after-handler settle action for one resolved flow × mode pair.
snapshot_payment_requirements_list
Deep snapshot of accepts entries before enrichment.
snapshot_settle_response_core
Captures facilitator-settled fields for later comparison.
validate_accepts_against_supported
Checks each accept against facilitator /supported kinds.

Type Aliases§

WirePaymentPayload
Wire payment payload with typed requirements and opaque scheme body.