WalletGateway

A PaymentGateway backed by a device wallet (Apple Pay, Google Pay).

Adds exactly one thing to the base contract — availability — because a wallet is the one payment method whose button must not be drawn until the platform says it will work. Everything else (the prepare/pay split, the host indirection) is unchanged, so a wallet provider drops into the same registry as every card gateway.

Properties

Link copied to clipboard
abstract val id: GatewayId
Link copied to clipboard
Link copied to clipboard
abstract val meta: GatewayMeta

Functions

Link copied to clipboard
abstract suspend fun availability(host: PaymentHost): WalletAvailability

Ask the platform whether the wallet can be presented, before any UI is drawn.

Link copied to clipboard
abstract suspend fun pay(host: PaymentHost, prepared: PreparedPayment): PaymentResult

Launch the provider UI/intent and suspend until the user reaches a terminal state.

Link copied to clipboard
abstract suspend fun prepare(created: CreatedOrder): PreparedPayment

Transform a backend-created order into this provider's session shape. The network round-trip already happened (the orchestrator owns PaymentBackend); most providers just repackage CreatedOrder.providerParams, but the call is suspend for providers that need an extra hop. Throws PaymentPreparationException on failure.