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

# Test Mode

> Test the full payment flow without real charges

## How test mode works

When your Stripe account is in test mode (key starts with `sk_test_`), Cuprice automatically:

* Uses your **Test Success URL** and **Test Cancel URL** for redirects
* All payments use Stripe's test environment
* No real charges are made

## Testing the flow

<Steps>
  <Step title="Set test redirect URLs">
    In the Integration tab, set your test URLs pointing to your local development server (e.g. `http://localhost:3001`).
  </Step>

  <Step title="Use the test buttons">
    After saving, click **Test Success** or **Test Cancel** to open your redirect URLs directly — no Stripe needed.
  </Step>

  <Step title="Test with Stripe">
    Use test card `4242 4242 4242 4242` to complete a real checkout flow in test mode.
  </Step>
</Steps>

## Quick test (no Stripe needed)

The **Test Success** button in the Integration tab opens your success URL with a fake session ID (`cs_test_...`). Your app should handle this gracefully:

```typescript theme={null}
// In your API route, detect test session IDs
if (sessionId.startsWith("cs_test_") && sessionId.length < 30) {
  // Return all features as enabled for testing
  const allFeatures = await getProjectFeatures(shareId);
  return { planName: "Test Plan", features: allFeatures, testMode: true };
}
```

<Tip>
  This lets you test the complete success → feature activation → dashboard flow without touching Stripe at all.
</Tip>
