import { t as StandardSchemaV1 } from "../../standard-DIedMFAS.js"; //#region src/core/commerce/stripe.d.ts interface CartItem { slug: string; name: string; qty: number; /** Unit price in cents. */ unitAmountCents: number; } /** * Create a PaymentIntent for an embedded Payment Element checkout. The cart * is carried in metadata so the webhook can build the order without trusting * the client. * * `options.currency` is the ISO 4217 code the site sells in, in either case. * It defaults to `"usd"`; pass it for a site that sells in anything else. */ declare function createPaymentIntent(secretKey: string, items: CartItem[], options?: { currency?: string; }): Promise<{ id: string; clientSecret: string; amountCents: number; }>; /** * Re-fetch a PaymentIntent by id—the webhook treats events as pointers * (v2-style thin-event handling) instead of trusting the delivered payload. */ declare function retrievePaymentIntent>(secretKey: string, id: string): Promise; /** * Verify a Stripe webhook signature. `header` is the raw `Stripe-Signature` * value (`t=…,v1=…`); `payload` is the raw request body. Rejects signatures * older than `toleranceSeconds` (default 5 min). */ declare function verifyStripeSignature(payload: string, header: string, secret: string, nowSeconds: number, toleranceSeconds?: number): Promise; /** * A Stripe webhook event, validated to the fields this integration reads. * Run it via {@link import("./index.js").parseWebhookEvent} AFTER * {@link verifyStripeSignature}—the signature proves the sender, this proves * the shape. The handler treats events as thin pointers and re-fetches the * PaymentIntent by id (see {@link retrievePaymentIntent}), so this locks down * `id` + `type` + the presence of `data.object` and leaves the polymorphic * object (PaymentIntent / Invoice / …) as an untyped record for the handler to * narrow per `type`. Extra envelope keys (api_version, created, …) are dropped. */ declare const stripeWebhookEventSchema: StandardSchemaV1; }; }>; interface StripeAddress { name?: string; line1?: string; line2?: string; city?: string; state?: string; postalCode?: string; country?: string; } /** * Create + finalize + send a Stripe invoice; returns the hosted pay URL. * `input.currency` is the ISO 4217 code to bill in, and defaults to `"usd"`. */ declare function createAndSendInvoice(secretKey: string, input: { email: string; amountCents: number; description: string; currency?: string; }): Promise<{ id: string; hostedUrl: string | null; }>; interface InvoiceLineItem { description: string; /** Unit price in cents. */ amountCents: number; quantity: number; } /** * Create or reuse a Stripe customer. Pass `customerId` to reuse; otherwise a * customer is created with the email/name/address (address is what makes * automatic tax work). Returns the id and whether it was newly created. */ declare function ensureStripeCustomer(secretKey: string, input: { email: string; name?: string; address?: StripeAddress; customerId?: string; }): Promise<{ id: string; created: boolean; }>; /** * Create + finalize + send a Stripe invoice with line items and (optionally) * automatic tax. Auto tax requires Stripe Tax enabled on the account and a * customer address. Returns the id, hosted pay URL, number, and total. */ declare function createLineItemInvoice(secretKey: string, input: { customerId: string; lineItems: InvoiceLineItem[]; automaticTax?: boolean; daysUntilDue?: number; currency?: string; }): Promise<{ id: string; hostedUrl: string | null; number: string | null; amountCents: number; }>; //#endregion export { CartItem, InvoiceLineItem, StripeAddress, createAndSendInvoice, createLineItemInvoice, createPaymentIntent, ensureStripeCustomer, retrievePaymentIntent, stripeWebhookEventSchema, verifyStripeSignature };