# Checkout success

Back from checkout, in the same app: wait for the payment honestly, then unlock what was paid for in place.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Checkout success. An app with three paid controls: upgrade, the payment confirms, and the list and the controls unlock together in place. Preview: https://chatcn.dev/preview/checkout-success-demo

## Installation

```bash
npx shadcn@latest add @chatcn-pro/checkout-success
```

## Usage

```tsx
import { CheckoutSuccess, Unlockable } from "@/components/ui/chatcn/pro/checkout-success"

<CheckoutSuccess
  status={status}                 // "confirming" until your webhook says paid
  plan="Pro"
  amount="$20.00"
  card={{ brand: "Visa", last4: "4242" }}
  nextCharge="Apr 18"
  receiptHref={receiptUrl}
  unlocked={[{ id: "opus", title: "Claude Opus 5.5", action: "Try it", onAction: openOpus }, …]}
  onDone={close}
/>

<Unlockable locked={!isPro} delay={260} onLockedClick={openUpgrade}>
  <ModelOption model="claude-opus-5-5" />
</Unlockable>
```

Coming back from a hosted checkout, the payment is often not confirmed yet; `confirming` waits for your webhook and unlocks nothing early, so nobody gets a feature that is then taken away. Once `success`, the receipt is one line (amount, card, renewal, receipt link) and the paid features unlock one after another, each lock turning into a check, each with an action to try it now. Wrap the paid controls in your app in `Unlockable`: locked, they are quieter, inert and badged, and clicking them opens your upgrade; when `locked` turns false the badge lifts away in place. Give each `Unlockable` a `delay` of 260 plus its position times `stagger` and the app and the list unlock together. A failed payment says nothing was charged and nothing changed.

## Examples

### States

Example: States. Waiting for the payment to confirm, a declined card, and a locked control on its own. Preview: https://chatcn.dev/preview/checkout-success-states

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `status` | `"confirming" | "success" | "failed"` | Driven by your payment confirmation |
| `plan`, `amount`, `card`, `nextCharge`, `receiptHref` |  | The one line receipt |
| `unlocked` | `UnlockedFeature[]` | `{ id, title, detail?, action?, onAction? }` |
| `stagger` | `number` | Ms between unlocks. Default 140 |
| `onDone`, `onRetry`, `error`, `supportHref` |  |  |
| `Unlockable` `locked`, `badge`, `delay`, `onLockedClick` |  | Wraps one paid control |
| `labels` | `Partial<CheckoutSuccessLabels>` | Every string, for translation |

## Accessibility

- Confirming is a status message; a failed payment is an alert.
- On success focus moves to the welcome heading, so the receipt is read next.
- Locked controls are inert; the badge is the one button, named for the upgrade.

## Motion

Each lock turns into a check 140 ms after the last, and the badge on an Unlockable lifts and fades over 200 ms. Under reduced motion everything unlocks at once.

Source: https://chatcn.dev/docs/components/checkout-success