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

# Stripe

> Accept credit and debit card payments with Stripe.

## Prerequisites

* A [Stripe](https://stripe.com) account (free to create)
* Your domain must use HTTPS for webhooks

## 1. Get your API keys

In the Stripe dashboard:

1. Go to **Developers → API keys**
2. Copy your **Publishable key** and **Secret key**
3. Use **test** keys during development, **live** keys in production

## 2. Configure in StartMyVPN

Navigate to **Admin → Settings → Payments → Stripe** and enter:

| Field           | Where to find it               |
| --------------- | ------------------------------ |
| Publishable Key | Stripe → Developers → API keys |
| Secret Key      | Stripe → Developers → API keys |
| Webhook Secret  | Created in step 3 below        |

## 3. Set up the webhook

Stripe needs to notify StartMyVPN when payments succeed.

1. In Stripe, go to **Developers → Webhooks**
2. Click **Add endpoint**
3. Set the endpoint URL to:
   ```
   https://yourdomain.com/stripe/webhook
   ```
4. Select these events to listen for:
   * `payment_intent.succeeded`
   * `invoice.payment_succeeded`
   * `customer.subscription.deleted`
5. Copy the **Signing secret** and paste it into the Webhook Secret field in StartMyVPN

## 4. Test the integration

In test mode, use Stripe's test card numbers:

| Scenario           | Card number           |
| ------------------ | --------------------- |
| Successful payment | `4242 4242 4242 4242` |
| Declined card      | `4000 0000 0000 0002` |
| 3D Secure required | `4000 0025 0000 3155` |

Use any future expiry date, any 3-digit CVV, and any ZIP code.

## Subscription vs. one-time payments

StartMyVPN supports both:

* **One-time invoice payments** — customer pays each billing cycle manually
* **Stripe recurring subscriptions** — Stripe charges the customer automatically at renewal

Whether a plan uses recurring billing depends on the plan configuration in **Admin → Plans**.

<Warning>
  Never expose your Stripe **Secret Key** in client-side code or public repositories. It is stored encrypted in the database.
</Warning>
