import type { StorageAdapter, PaymentProviderAdapter, RateProvider, Page, PageOptions, PayLogger, Authorizer } from "../interfaces.js"; import type { ID } from "../types.js"; import type { PaymentPage } from "../schemas.js"; import { type CreatePaymentPageInput } from "../schemas.js"; import type { CheckoutSessionsDomain, CreateCheckoutSessionsDomainFn } from "./checkout-sessions.js"; /** Mutable fields when updating a payment page. */ export interface UpdatePaymentPageInput { /** New display title. */ title?: string; /** Whether the page accepts new sessions. */ active?: boolean; /** Arbitrary metadata to merge into the page record. */ metadata?: Record; } /** * Payment pages domain — create and manage hosted payment pages that accept * multi-provider checkout sessions. */ export interface PaymentPagesDomain { /** * Create a new payment page. * * Validates that the settlement wallet exists and its currency matches * `settlementCurrency`, and that all `allowedProviders` are registered. * * @param input - Payment page configuration. * @returns The newly created payment page. * @throws {WalletNotFoundError} if the settlement wallet does not exist. * @throws {CurrencyMismatchError} if the settlement wallet currency ≠ `settlementCurrency`. * @throws {ProviderNotConfiguredError} if any entry in `allowedProviders` is not registered. * * @example * ```ts * const page = await pay.paymentPages.create({ * title: "Upgrade to Pro", * settlementCurrency: "NGN", * settlementWalletId: revenueWallet.id, * allowedProviders: ["paystack"], * acceptedCurrencies: ["NGN"], * amountMinor: 500000, // ₦5,000 * }); * ``` */ create(input: CreatePaymentPageInput): Promise; /** * Fetch a payment page by its id. * * @param pageId - The page's ULID identifier. * @returns The payment page, or `null` if it does not exist. */ get(pageId: ID): Promise; /** * List all payment pages for this tenant. * * @param page - Optional pagination cursor and limit. * @returns A paginated list of payment pages. */ list(page?: PageOptions): Promise>; /** * Update mutable fields on a payment page (title, active status, metadata). * * @param pageId - The page to update. * @param patch - Fields to update. * @returns The updated payment page. * @throws {PaymentPageNotFoundError} if the page does not exist. */ update(pageId: ID, patch: UpdatePaymentPageInput): Promise; /** * Archive a payment page (soft-deactivation). * * Sets `active: false`. Blocks if any session transit wallet has a non-zero * balance — sets `requiresManualReconciliation: true` on the page in that case. * * @param pageId - The page to archive. * @throws {PaymentPageNotFoundError} if the page does not exist. */ archive(pageId: ID): Promise; /** Checkout sessions sub-domain scoped to this payment page domain instance. */ readonly sessions: CheckoutSessionsDomain; } export declare function createPaymentPagesDomain(tenantId: ID, storage: StorageAdapter, providers: Map, createSessionsDomainFn: CreateCheckoutSessionsDomainFn, logger?: PayLogger, authorizer?: Authorizer, rateProvider?: RateProvider): PaymentPagesDomain; //# sourceMappingURL=payment-pages.d.ts.map