> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# <PaymentForm />

> Stripe Elements input for Stripe-only online checkout.

# PaymentForm

<Snippet file="api-key-location.mdx" />

Renders Stripe Elements for an `ONLINE` order submission. Crave persists the
canonical order before it creates or recovers the connected-account PaymentIntent.

## Preview

Desktop

Mobile

## Behavior

* Read `checkout.getCollectionOptions` for the current cart before rendering.
  Mount this component only when the server-returned `ONLINE` option is available.
* Submit the order with `collectionMode: "ONLINE"`; online responses never
  select Square, Clover, or Toast.
* Mount Stripe Elements with the returned `clientSecret` and immutable
  `connectedAccountId`.
* Poll `getOrderSubmissionOutcome` with the returned `attemptId` after confirmation,
  redirects, ambiguous responses, or browser restarts.
* Reuse the original submission idempotency key. Never create a second order to
  recover a response.
* Handle every online outcome status: `PAID` is settled, `PROCESSING` is still
  resolving, `CUSTOMER_ACTION_REQUIRED` needs the customer back in Stripe with
  the returned `clientSecret`, and `ACTION_REQUIRED` carries a `safeErrorCode`
  and needs a decision. `ACCEPTED` with a `verification` object belongs to
  pay-at-store collection and is never returned for `ONLINE`.
* Raw card data stays in Stripe-hosted fields and is never accepted or logged by
  Crave application code.

> [!WARNING]
>
> Square, Clover, and Toast are POS-native order and reconciliation
> integrations. Do not load their browser payment SDKs or tokenize a POS payment
> source in the storefront. Pay-at-store checkout has no payment form.

> [!WARNING]
>
> While the outcome is `PROCESSING`, do not offer a retry that submits again.
> The attempt is unresolved rather than failed, and a second submission charges
> the customer twice. Re-poll with the same `attemptId` instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.