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

# Razorpay Integration

> Accept payments via Razorpay payment gateway

## Setup

1. Create account at [razorpay.com](https://razorpay.com)
2. Get API keys from Dashboard → Settings → API Keys
3. Add to environment variables:

```bash theme={null}
NEXT_PUBLIC_RAZORPAY_KEY_ID=rzp_test_xxxxx
RAZORPAY_KEY_SECRET=xxxxx
RAZORPAY_WEBHOOK_SECRET=xxxxx
```

## Configure Webhook

URL: `https://mypopup.shop/api/webhooks/razorpay`

Events:

* `payment.captured`
* `payment.failed`

## Test Mode

Test cards:

```
4111 1111 1111 1111 (Success)
4000 0000 0000 0002 (Declined)
```

<Card title="Payment Flow" href="/architecture/payment-flow">
  Full payment integration guide
</Card>
