Payment provider interface.
Each provider (Stripe, Square, etc.) implements this interface. Routes call these methods without knowing which provider is active.
checkoutCompletedEventType: string
The webhook event type name that indicates a completed checkout
type: PaymentProviderType
Provider identifier
createCheckoutSession(intent: CheckoutIntent,baseUrl: string): Promise<CheckoutSessionResult>
Create a checkout session for one or more events. Returns a session ID and hosted checkout URL, or null on failure.
isPaymentRefunded(paymentReference: string): Promise<boolean>
Check if a payment has been refunded via the provider API. Used to refresh refund status from the edit attendee page.
refundPayment(paymentReference: string): Promise<boolean>
Refund a completed payment.
resolveWebhookSession(event: WebhookEvent): Promise<ValidatedPaymentSession | "skip" | null>
Resolve a validated session from a webhook event. Each provider knows how to extract/fetch session data from its own event structure, so the webhook handler stays provider-agnostic.
retrieveSession(sessionId: string): Promise<ValidatedPaymentSession | null>
Retrieve and validate a completed checkout session by ID. Returns the validated session or null if not found / invalid.
setupWebhookEndpoint(secretKey: string,webhookUrl: string,existingEndpointId?: string | null): Promise<WebhookSetupResult>
Set up a webhook endpoint for this provider. Some providers (e.g. Stripe) support programmatic creation.
verifyWebhookSignature(): Promise<WebhookVerifyResult>
Verify a webhook request's signature and parse the event payload.