Payment Gateways — Razorpay/Stripe/Cashfree Setup
11. Payment Gateways — Razorpay/Stripe/Cashfree Setup
Reading Time: 6 min
Goal: Set up payment gateways so customers can make online payments
Video Tutorial
Watch this step-by-step video tutorial:
Step 1: Navigate to Payment Settings
- Left sidebar → Settings 🔽 → Payment Gateway
- You'll see a list of available payment gateways
Available Gateways
| Gateway | Country | Features |
|---|---|---|
| Razorpay | India | UPI, Cards, Net Banking, Wallet, EMI |
| Stripe | International | Cards (Visa, Mastercard, Amex), Apple Pay, Google Pay |
| Cashfree | India | UPI, Cards, Net Banking, PayLater |
Note: Cashfree and Stripe are feature-toggled — they need to be enabled first. If you don't see them, contact WithCart support.
Step 2: Setting Up Razorpay
Prerequisites:
You need a Razorpay account. Sign up at Razorpay website if you don't have one.
Get Your Credentials:
- Log in to your Razorpay dashboard
- Go to Settings → API Keys
- Copy the Key ID and Key Secret
Setup in WithCart:
- Click "Configure" next to Razorpay
- Enter these details:
| Field | Value |
|---|---|
| Key ID | From Razorpay (e.g., rzp_live_xxxxxxxx) |
| Key Secret | From Razorpay |
| Webhook Secret | The secret you set in Razorpay webhooks |
- Click Save
- Toggle ON
Pro Tip: First use Test Mode with Razorpay test keys. Once everything works, switch to Live Mode.
<!-- TODO: Image - Razorpay setup form -->
Step 3: Setting Up Stripe
Prerequisites:
You need a Stripe account. Sign up at Stripe website.
Get Your Credentials:
- Stripe dashboard → Developers → API Keys
- Copy the Publishable Key and Secret Key
Setup in WithCart:
- Click "Configure" next to Stripe
- Enter the Publishable Key and Secret Key
- Click Save
- Toggle ON
<!-- TODO: Image - Stripe setup form -->
Step 4: Testing Your Gateway
Place a test order after setup:
- Add a product to the cart on the storefront
- Go to checkout
- Select the payment gateway
- Complete a test payment
- Check that the order is created successfully
Important: If webhooks are not set up correctly, payments won't be verified. Webhook URLs:
- Razorpay: https://yourstore.com/shop/{slug}/payment/verify
- Stripe: requires callback setup
Step 5: Toggling Gateways
On the payment settings page:
- Toggle ON — Gateway is active, customers can use it
- Toggle OFF — Gateway is deactivated
- You can have multiple gateways active simultaneously
Pro Tip: Keep at least one gateway ON at all times. Having two gateways provides a backup if one fails.
Common Issues
| Problem | Solution |
|---|---|
| Payment won't start | Check credentials (Key ID / Secret) |
| Order stays on Pending after payment | Check webhook URL |
| "Invalid Signature" error | Webhook secret mismatch, verify credentials |
| Gateway not visible on storefront | Check if toggle is ON |