import "server-only"; import type { PaymentRepository } from "./repository"; import { paymentFailure } from "./repository"; const unavailable = paymentFailure( "PAYMENTS_UNAVAILABLE", "Payments are unavailable until a local payment provider and database are configured.", 503, ); function unavailableResult(): { readonly error: typeof unavailable; readonly ok: false } { return { error: unavailable, ok: false }; } export const emptyPaymentRepository: PaymentRepository = Object.freeze({ async applyEvent() { return unavailableResult(); }, async loadAuthorizedPayment() { return null; }, async loadLatestPayment() { return null; }, async recordCheckout() { return unavailableResult(); }, });