PaymentStep

sealed interface PaymentStep

One observable step in a payment's lifecycle, emitted by the orchestrator as a stream. The Lab screen renders these as a live timeline (order created → launching → client result → verifying → terminal), each carrying its RedactedPayload so the user sees the actual data at every hop.

This is the app's teaching surface: the sequence, and the fact that a client Success still has to pass through Verifying before it's trusted, is the whole point.

Inheritors

Types

Link copied to clipboard
data class ClientResult(val result: PaymentResult, val payload: RedactedPayload) : PaymentStep

The SDK returned a client-side result — a hint, not yet trusted.

Link copied to clipboard
data class Compensated(val walletAmount: Money, val refundTxnId: String, val payload: RedactedPayload) : PaymentStep

The wallet leg was reversed because the gateway leg failed (or the split couldn't complete) — the compensating credit from the split-payment design. Net wallet movement is zero.

Link copied to clipboard
data class Errored(val message: UiText, val payload: RedactedPayload = RedactedPayload.EMPTY) : PaymentStep

The flow itself broke (network, config, unexpected) — distinct from a declined payment.

Link copied to clipboard
data class Launching(val gatewayId: GatewayId, val payload: RedactedPayload = RedactedPayload.EMPTY) : PaymentStep

About to hand off to the provider SDK / UPI chooser. Journal row already written.

Link copied to clipboard
data class LegSettled(val leg: SplitLeg, val settled: PaymentStep.Settled, val payload: RedactedPayload = settled.payload) : PaymentStep

One leg of a split payment (PaymentOrchestrator.paySplit) reached a terminal state. Wraps the leg's own Settled step so the Lab timeline can render "wallet leg settled" / "gateway leg settled" distinctly, while still carrying the same server-authoritative outcome.

Link copied to clipboard
data class OrderCreated(val orderId: String, val amount: Money, val payload: RedactedPayload) : PaymentStep

Backend created the order; price came from the server.

Link copied to clipboard
data class Settled(val status: PaymentStatus, val snapshot: PaymentSnapshot, val payload: RedactedPayload) : PaymentStep

Server-authoritative terminal outcome.

Link copied to clipboard
data class Verifying(val payload: RedactedPayload = RedactedPayload.EMPTY) : PaymentStep

Confirming the client result against the server (signature check / status).

Properties

Link copied to clipboard
abstract val payload: RedactedPayload