/** * @license * Copyright 2026 Aglyn LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Add a card WITHOUT leaving the page or the design (AGL follow-up to the * native billing surface). * * ## Why this is not a dialog any more * * It used to open Stripe's hosted checkout in a modal. Being asked for * payment details by an interface that has just appeared and looks like a * different product is a reason to stop being a customer — and that reaction * is about PRESENTATION, not about where the card data goes. * * Elements answers exactly that half. Each field is its own cross-origin * iframe on Stripe's domain, so the guarantee is unchanged — the PAN, the CVC * and the expiry are typed into Stripe's document and posted to Stripe, and * never touch our DOM, our server or our logs. What changes is that the * fields render inline, at our sizes, in our type, with our Save button * beside them. * * ## The part that is easy to get wrong * * `appearance` must carry LITERAL colors. Elements paints inside Stripe's * origin, where our CSS custom properties do not exist, so a * `var(--mui-palette-…)` string resolves to nothing and the field silently * falls back to Stripe's default styling. `stripeAppearanceFromTheme` * resolves them against the document before they cross that boundary. * * ## Fulfilment still is not here * * Confirming a SetupIntent saves a card; it grants nothing. The default is * set server-side in `finalize-card-setup`, which re-reads the intent from * Stripe rather than trusting this component's word that it succeeded. */ export interface BillingCardFormProps { /** SetupIntent client secret from `create-setup-intent`. */ clientSecret: string; /** Hand back the confirmed intent id; the server verifies it from there. */ onConfirmed: (setupIntentId: string) => Promise | void; onCancel: () => void; } export default function BillingCardFormComponent({ clientSecret, onConfirmed, onCancel, }: BillingCardFormProps): import("react").JSX.Element;