
Tenant Data Isolation: Patterns and Anti-Patterns
Explore effective patterns and pitfalls of tenant data isolation in multi-tenant systems to enhance security and compliance.
Jul 30, 2025
Read More
Choosing a payment gateway is one of the earliest architectural decisions for any MVP that needs to make money. Pick the wrong one and you'll face painful migration later, higher fees eating your margins, or worse—an inability to accept payments from your target market.
This guide compares three popular payment gateways for startups and MVPs: Stripe (global standard), PayPal (universal recognition), and Razorpay (India-first). We'll cover pricing, developer experience, regional support, compliance considerations, and implementation patterns so you can ship payments quickly without painting yourself into a corner.
Before comparing features, answer these questions:
| Feature | Stripe | PayPal | Razorpay |
|---|---|---|---|
| Best for | Global SaaS, developer-first | Consumer payments, trust + reach | India-first (UPI + local rails) |
| Primary integration | Checkout + Billing + Webhooks | Buttons + Orders API | Checkout + Subscriptions + Webhooks |
| Subscriptions | Excellent (Stripe Billing) | Basic (limited flexibility) | Good (India-focused) |
| Local methods | Strong in EU/US | Wallet-like experience | UPI, netbanking, wallets |
| Marketplace payouts | Excellent (Connect) | Possible but complex | Limited vs Stripe |
| Fraud tooling | Radar | PayPal risk engine | Razorpay Risk |
| Developer experience | Best-in-class | Good | Good |
| Time to ship (MVP) | 1-3 hours | 2-6 hours | 2-5 hours |
Stripe is the default choice for SaaS MVPs in the US/EU because it nails three things: documentation, webhooks, and subscription workflows. If you're launching globally (outside India-specific UPI needs), Stripe is usually the fastest path to a clean, maintainable payment system.
// server.js - Stripe Checkout Session (Node.js)
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const express = require('express');
const app = express();
app.use(express.json());
app.post('/api/checkout', async (req, res) => {
const { priceId, customerEmail } = req.body;
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
customer_email: customerEmail,
line_items: [{ price: priceId, quantity: 1 }],
success_url: `${process.env.APP_URL}/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${process.env.APP_URL}/pricing`,
});
res.json({ url: session.url });
});
// Webhook: source of truth for subscription status
app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['stripe-signature'];
const event = stripe.webhooks.constructEvent(req.body, sig, process.env.STRIPE_WEBHOOK_SECRET);
switch (event.type) {
case 'checkout.session.completed':
// mark user as active
break;
case 'invoice.payment_failed':
// warn user / restrict access
break;
case 'customer.subscription.deleted':
// deactivate
break;
}
res.sendStatus(200);
});
MVP best practice: make Stripe webhooks the source of truth. Never trust the client-side redirect alone. Users can close tabs, retry payments, or dispute charges—webhooks capture reality.
PayPal wins when your biggest problem isn't payment processing—it's trust. Many users, especially international consumers, prefer paying via PayPal rather than typing card details into an unknown checkout.
const paypal = require('@paypal/checkout-server-sdk');
const env = new paypal.core.SandboxEnvironment(
process.env.PAYPAL_CLIENT_ID,
process.env.PAYPAL_SECRET
);
const client = new paypal.core.PayPalHttpClient(env);
app.post('/api/paypal/create-order', async (req, res) => {
const request = new paypal.orders.OrdersCreateRequest();
request.requestBody({
intent: 'CAPTURE',
purchase_units: [{
amount: { currency_code: 'USD', value: req.body.amount },
description: req.body.description
}]
});
const order = await client.execute(request);
res.json({ id: order.result.id });
});
app.post('/api/paypal/capture-order', async (req, res) => {
const request = new paypal.orders.OrdersCaptureRequest(req.body.orderId);
const capture = await client.execute(request);
if (capture.result.status === 'COMPLETED') {
// grant entitlement
}
res.json({ status: capture.result.status });
});
PayPal trade-off: subscription and billing flexibility is typically less ergonomic than Stripe. If subscriptions are core, Stripe is usually the better long-term platform.
If your MVP targets India, Razorpay is the practical choice. UPI is a must-have for conversion in many segments. Razorpay also supports net banking, cards, and wallets in one integration, and it aligns well with Indian business onboarding requirements.
const Razorpay = require('razorpay');
const crypto = require('crypto');
const razorpay = new Razorpay({
key_id: process.env.RAZORPAY_KEY_ID,
key_secret: process.env.RAZORPAY_KEY_SECRET,
});
app.post('/api/razorpay/create-order', async (req, res) => {
const order = await razorpay.orders.create({
amount: req.body.amountPaise, // e.g., 49900 = Rs 499
currency: 'INR',
receipt: `rcpt_${Date.now()}`,
});
res.json(order);
});
app.post('/api/razorpay/verify', async (req, res) => {
const { razorpay_order_id, razorpay_payment_id, razorpay_signature } = req.body;
const body = `${razorpay_order_id}|${razorpay_payment_id}`;
const expected = crypto
.createHmac('sha256', process.env.RAZORPAY_KEY_SECRET)
.update(body)
.digest('hex');
if (expected !== razorpay_signature) {
return res.status(400).json({ ok: false });
}
// grant entitlement
res.json({ ok: true });
});
Regardless of gateway, the same architecture principles apply:
| Component | Responsibility | Implementation Note |
|---|---|---|
| Checkout | Collect payment info | Use hosted checkout for MVP speed |
| Webhook handler | Receive payment events | Verify signatures; log raw events |
| Entitlement service | Grant/revoke access | Idempotent updates by event ID |
| Billing UI | Manage plan/cancel | Link to Stripe portal / simple settings page |
-- Example entitlement table
CREATE TABLE entitlements (
user_id UUID PRIMARY KEY,
plan TEXT NOT NULL,
status TEXT NOT NULL, -- active, past_due, canceled
current_period_end TIMESTAMP,
provider TEXT NOT NULL, -- stripe, paypal, razorpay
provider_customer_id TEXT,
provider_subscription_id TEXT,
updated_at TIMESTAMP DEFAULT NOW()
);
If you want a fast path to launch without compromising future scalability, Propelius can implement payments as part of a 30-day MVP sprint—including webhooks, entitlements, and basic subscription management.
If your customers are primarily in India and you need UPI, choose Razorpay. UPI dramatically improves conversion in India. If you're selling globally and your business is incorporated in a Stripe-supported country, Stripe is often better long-term. Many teams start with Razorpay for India and add Stripe when they expand.
For MVPs, yes. Hosted checkout (Stripe Checkout, Razorpay Checkout, PayPal Smart Buttons) is faster to implement and reduces compliance risk. It handles edge cases like 3D Secure, localization, and device-specific flows. Build a custom form only when you need full UI control and you have the time to manage PCI scope carefully.
Yes. Webhooks are the only reliable source of payment state changes: successful payment, failed renewal, subscription canceled, chargebacks, and refunds. Without webhooks, you'll end up with users who paid but don't get access, or users who canceled but still have access. Webhooks make your payment system correct.
One-time payments are relatively easy to migrate. Subscriptions are not. Subscription migrations require careful handling of customer payment methods, billing cycles, proration, and cancellations. If you expect to scale a subscription SaaS, choosing a strong subscription platform early (often Stripe) reduces migration pain later.
Need an expert team to provide digital solutions for your business?
Book A Free CallDive into a wealth of knowledge with our unique articles and resources. Stay informed about the latest trends and best practices in the tech industry.
View All articlesTell us about your vision. We'll respond within 24 hours with a free AI-powered estimate.
© 2026 Propelius Technologies. All rights reserved.