PaymentBackend

interface PaymentBackend

The app's view of the server. Implemented in core:network (Ktor) against the core:protocol DTOs; consumed by the orchestrator in domain terms only, so the orchestrator never sees a DTO or an HTTP concern. This is the seam that lets the tested core run against a fake backend.

Functions

Link copied to clipboard
abstract suspend fun createOrder(catalogItemId: String, gatewayId: GatewayId, idempotencyKey: String): CreatedOrder

POST /orders — price is resolved server-side from catalogItemId; the client never sets it.

Link copied to clipboard
abstract suspend fun status(orderId: String): PaymentSnapshot

GET /payments/{id} — poll the server-authoritative state (updated by webhooks).

Link copied to clipboard
abstract suspend fun verify(request: VerificationRequest): PaymentSnapshot

POST /payments/{id}/verify — hand the client's proof to the server for authoritative checking.