interface PaymentProvider

Operations every configured payment provider supplies.

Properties

The webhook event type name that indicates a completed checkout

Set up the provider's webhook endpoint where supported.

Provider identifier

Methods

Create a checkout for one or more listings.

readCharge(paymentReference: string): Promise<ProviderRead<ChargeMoney>>

Read what the provider says about the money on one charge: what it took, and what has gone back. Every refund route asks this before it sends money, and the edit-attendee page asks it to refresh a booking's refund state.

refundCharge(request: AuthorizedRefundRequest): Promise<RefundAttemptResult>

Ask for the observed charge to be refunded and preserve the provider's exact completed, accepted, rejected, unsent, or uncertain answer.

Resolve a validated session from a webhook event. Each provider extracts or fetches session data from its own event structure, so the webhook handler stays provider-agnostic.

retrieveSession(
sessionId: string,
paidPaymentId?: string,
): Promise<RetrieveSessionResult>

Retrieve and validate a completed checkout session by ID. Returns the validated session, a rejection when the provider reported a paid charge the boundary could not read, or null if not found.

paidPaymentId is a payment the caller has already been told is complete — a webhook has one, a redirect does not. A provider whose session lags behind the payment uses it so a captured charge is not read as unpaid.

verifyWebhookSignature(
payload: string,
signature: string,
webhookUrl: string,
payloadBytes: Uint8Array,
): Promise<WebhookVerifyResult>

Verify a webhook request's signature and parse the listing payload.