India is the world's leader in digital payments. India processes over 10 billion UPI transactions per month — more than any other country's payment system. If your website doesn't accept UPI, you're turning away the majority of Indian digital payment users.
This guide covers everything you need to integrate Indian payment gateways into your website, from technical setup to choosing between Razorpay, PayU, and Cashfree.
For maximum conversion in the Indian market, your website must accept:
Market position: India's most popular payment gateway for startups and SMEs
Transaction fees:
Key features:
Documentation quality: Excellent. Best-in-class API documentation in India. Multiple SDK options (JavaScript, PHP, Python, Node.js, Java).
Settlement time: T+3 days (next working day available for fee)
Best for: Startups, ecommerce, web apps, subscriptions
Market position: One of India's oldest payment gateways, trusted by large enterprises
Transaction fees:
Key features:
Best for: Established businesses, high-volume transactions, those needing buy-now-pay-later options
Market position: Growing rapidly with focus on developer experience and fast settlements
Transaction fees:
Key features:
Best for: Businesses where settlement speed is critical, marketplaces, B2B payments
Here's how to integrate Razorpay into a PHP-based website:
Add to your HTML:
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<?php
// Install Razorpay PHP SDK: composer require razorpay/razorpay
require "vendor/autoload.php";
use RazorpayApiApi;
$api = new Api("YOUR_KEY_ID", "YOUR_KEY_SECRET");
$order = $api->order->create([
"amount" => 50000, // Amount in paise (₹500 = 50000 paise)
"currency" => "INR",
"receipt" => "order_" . time(),
"payment_capture" => 1
]);
$orderId = $order["id"];
?>
var options = {
"key": "YOUR_KEY_ID",
"amount": "50000",
"currency": "INR",
"name": "Your Business Name",
"description": "Service Description",
"image": "https://yourdomain.com/logo.png",
"order_id": "<?php echo $orderId; ?>",
"handler": function (response) {
// Verify payment on server
document.getElementById("payment_id").value = response.razorpay_payment_id;
document.getElementById("payment_form").submit();
},
"prefill": {
"name": "Customer Name",
"email": "customer@email.com",
"contact": "9XXXXXXXXX"
},
"theme": { "color": "#404E3B" }
};
var rzp = new Razorpay(options);
rzp.open();
<?php
$paymentId = $_POST["razorpay_payment_id"];
$orderId = $_POST["razorpay_order_id"];
$signature = $_POST["razorpay_signature"];
$api = new Api("YOUR_KEY_ID", "YOUR_KEY_SECRET");
try {
$attributes = [
"razorpay_order_id" => $orderId,
"razorpay_payment_id" => $paymentId,
"razorpay_signature" => $signature
];
$api->utility->verifyPaymentSignature($attributes);
// Payment is verified - update database, send confirmation email
echo "Payment Successful!";
} catch(Exception $e) {
echo "Payment Verification Failed";
}
?>
For mobile apps or WhatsApp checkout flows, you can open the UPI app directly:
// UPI payment intent (works across all UPI apps) upi://pay?pa=yourvpa@ybl&pn=YourName&am=500&cu=INR&tn=ServiceDescription
This opens the user's default UPI app with payment pre-filled. Better UX than a payment gateway for simple one-time payments.
All major gateways provide refund API:
Payment gateway fees attract 18% GST. This GST is claimable as input tax credit if your business is GST registered. Factor this into your pricing.
Example: Razorpay charges 2% on ₹1,000 = ₹20. GST on ₹20 = ₹3.60. Total deducted = ₹23.60. You receive ₹976.40.
Integrating Indian payment gateways is essential for any ecommerce or service business website. Start with Razorpay for the best developer experience, then consider alternatives as your volume grows and you need to negotiate better rates.
Need help integrating Razorpay, PayU, or Cashfree into your website? Contact me — I have extensive experience integrating Indian payment gateways for clients across India.
Hire Bunty Arora — Best Full Stack Developer. Call: +91-97296-21995
Get Free Quote