Knowledge Base

Payment Gateways — Razorpay/Stripe/Cashfree Setup

6 min read Payments

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

  1. Left sidebar → Settings 🔽 → Payment Gateway
  2. 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:

  1. Log in to your Razorpay dashboard
  2. Go to Settings → API Keys
  3. Copy the Key ID and Key Secret

Setup in WithCart:

  1. Click "Configure" next to Razorpay
  2. 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
  1. Click Save
  2. Toggle ON
Pro Tip: First use Test Mode with Razorpay test keys. Once everything works, switch to Live Mode.

<!-- TODO: Image - Razorpay setup form -->

Screenshot of Razorpay setup form - add image URL

Step 3: Setting Up Stripe

Prerequisites:

You need a Stripe account. Sign up at Stripe website.

Get Your Credentials:

  1. Stripe dashboard → Developers → API Keys
  2. Copy the Publishable Key and Secret Key

Setup in WithCart:

  1. Click "Configure" next to Stripe
  2. Enter the Publishable Key and Secret Key
  3. Click Save
  4. Toggle ON

<!-- TODO: Image - Stripe setup form -->

Screenshot of Stripe setup form - add image URL

Step 4: Testing Your Gateway

Place a test order after setup:

  1. Add a product to the cart on the storefront
  2. Go to checkout
  3. Select the payment gateway
  4. Complete a test payment
  5. 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

Related Articles