Skip to main content

Setup

  1. Create account at razorpay.com
  2. Get API keys from Dashboard → Settings → API Keys
  3. Add to environment variables:
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)

Payment Flow

Full payment integration guide