import type { GraphQLClient } from '../client.js'; import { type MyCheckoutsQuery, type MyCheckoutsConnectionQuery, type MyCheckoutsConnectionQueryVariables, type CheckoutsQuery, type CheckoutsConnectionQuery, type CheckoutsConnectionQueryVariables, type CreateCheckoutMutation, type CreateCheckoutInput, type CheckoutFilterInput, type CapturePaypalCheckoutMutation, type PaymentEventsQuery, type PaymentEventsQueryVariables, type PaymentEventsConnectionQuery, type PaymentEventsConnectionQueryVariables } from '../generated/graphql.js'; /** * Payment checkouts (wallet top-ups, plan purchases) — exposed as * `client.payments` (and grouped under `client.admin`). * * Part of the management surface. {@link create} and {@link mine} require an * authenticated caller and act on their own checkouts; {@link all} is * super-admin only. Amounts are minor currency units (`*Cents`). * * Note: {@link create} starts a real payment-provider checkout (Stripe / * PayPal). In tests use sandbox provider keys only — never trigger real * charges. * * @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` per the notes * above. */ export declare class PaymentsAPI { private readonly api; constructor(api: GraphQLClient); /** * Start a checkout (e.g. an `ORG_WALLET_TOPUP`). Requires authentication. * * @param input - {@link CreateCheckoutInput}: purpose, amount, provider, and * return URLs. * @returns The created checkout including the provider redirect/approval URL. */ create(input: CreateCheckoutInput): Promise; /** * List the authenticated caller's own checkouts (newest first). * * @param opts - Optional `limit` / `offset` (default limit 50). * @returns The caller's checkouts. */ mine(opts?: { limit?: number; offset?: number; }): Promise; /** * List checkouts across all users with an optional filter. **Super-admin * only.** * * @param opts - Optional {@link CheckoutFilterInput} `filter` and `limit` / * `offset`. * @returns The matching checkouts. */ all(opts?: { filter?: CheckoutFilterInput; limit?: number; offset?: number; }): Promise; /** * Capture an approved PayPal order, finalizing the checkout it belongs to. * Call this after the buyer approves the PayPal order returned by * {@link create}. Requires authentication. * * Pass `idempotencyKey` to make retries safe: replaying with the same key * returns the first result instead of re-capturing. * * @param orderId - The PayPal order id to capture. * @param idempotencyKey - Optional key for safe retries. * @returns The finalized {@link Checkout}. */ capturePaypal(orderId: string, idempotencyKey?: string): Promise; /** * Relay-style cursor pagination over the caller's own checkouts — the * preferred alternative to {@link mine}. See * https://docs.crowdedkingdoms.com/overview/pagination. * * @param args - Optional `first` and `after`. * @returns A checkouts connection. */ mineConnection(args?: MyCheckoutsConnectionQueryVariables): Promise; /** * Relay-style cursor pagination over all checkouts (with optional filter) — * the preferred alternative to {@link all}. **Super-admin only.** * * @param args - Optional `first`, `after`, and {@link CheckoutFilterInput}. * @returns A checkouts connection. */ allConnection(args?: CheckoutsConnectionQueryVariables): Promise; /** * List provider webhook events (offset pagination). **Super-admin only** — an * audit view of received Stripe/PayPal/SES events. * * @param opts - Optional `limit` / `offset`. * @returns A page of {@link PaymentEventRecord}s. * @remarks Prefer {@link eventsConnection} (Relay cursor pagination); the * offset args here are deprecated server-side. */ events(opts?: { limit?: PaymentEventsQueryVariables['limit']; offset?: PaymentEventsQueryVariables['offset']; }): Promise; /** * Relay-style cursor pagination over provider webhook events. **Super-admin * only.** See https://docs.crowdedkingdoms.com/overview/pagination. * * @param args - Optional `first` and `after`. * @returns A payment-events connection. */ eventsConnection(args?: PaymentEventsConnectionQueryVariables): Promise; } //# sourceMappingURL=payments.d.ts.map