Payments (Razorpay)
Accept one-time payments — products, services, donations, tips — using your own Razorpay account
Overview
Accept one-time payments in your app using Razorpay. Whether you're building an e-commerce store, a donation page, or a pay-per-feature product, describe the payment flow you need and the agent wires up the checkout, server-side order creation, signature verification, and post-payment logic.
What it supports
- One-time payments — product purchases, service fees, donations, tips, and more
- INR and USD — configurable default currency per app
- All Razorpay payment methods — UPI, cards, netbanking, wallets (whatever your Razorpay account supports)
- Secure verification — every payment is cryptographically verified on the server before being accepted
- Test and live modes — use Razorpay test keys while building, switch to live keys when you're ready to ship
- Post-payment logic — describe what should happen on success (unlock content, mark order paid, send a receipt email, etc.) and the agent wires it in
Example prompts
"Build an online store where users can browse products and
pay using Razorpay at checkout."
"Add a donation page where visitors can enter a custom
amount and pay with Razorpay."
"Users should be able to purchase premium access for
₹499 with a one-time payment, then unlock the /premium
route after the payment succeeds."Setting up your Razorpay keys
After your app is generated, you provide your own Razorpay API keys so payments land in your account.
- Get your API keys from Razorpay
- Log in to your Razorpay Dashboard
- Go to Settings → API Keys
- Generate or copy your Key ID and Key Secret
- Add keys to your app on Pentoggle
- Open your app and go to the Settings tab
- Find the Payment Gateway section
- Click Set Keys and enter your Razorpay Key ID and Key Secret
- Click Save
Your Razorpay keys are encrypted and stored securely. The secret key is never exposed to your app's frontend — it's only used on the server for order creation and payment verification.
How it works
- A user clicks a payment button in your app
- Your app calls a server function that creates a Razorpay order using your Key ID and Secret
- The Razorpay checkout modal opens with the order amount; the user picks a payment method and pays
- On success, Razorpay returns a payment ID and a signature; Pentoggle verifies the signature server-side using your Key Secret
- Verified payments are logged to your app's database, and the post-payment logic you described (unlock content, mark order paid, send confirmation email, etc.) runs
- The user sees a confirmation screen and Razorpay sends them an automatic email receipt
Testing payments
Razorpay provides test mode keys (starting with rzp_test_) that let you simulate payments without real money. Use test keys while building, then switch to live keys (starting with rzp_live_) when you're ready to go live.
Razorpay also publishes test card and UPI credentials you can use to simulate success, failure, and decline scenarios end-to-end.
Limitations
- One-time payments only — recurring subscriptions are not currently supported via this integration
- Refunds from the dashboard — refunds are issued from your Razorpay Dashboard directly; there's no in-app refund flow yet
- You provide the Razorpay account — Razorpay is a separate service; you need a (free) Razorpay account to use this integration
- Currency per app — an app picks a default currency at setup. To accept both INR and USD on the same app, ask the agent to add explicit currency switching at checkout
Troubleshooting
- "Invalid key" on checkout — check that the Key ID and Key Secret in Settings match a single environment (both test, or both live). Mixing test and live keys causes Razorpay to reject the request
- Payment succeeds but app doesn't unlock content — the signature verification step likely failed; ask the agent to check the server function logs and re-confirm your Key Secret is correct
- Indian users see only cards (no UPI) — UPI works on INR orders only. If you're accepting USD, Razorpay doesn't offer UPI for that currency. Add an INR plan/page for Indian users
- Test card declined unexpectedly — use the official Razorpay test card numbers; arbitrary card numbers will fail validation even in test mode
- Live payments missing from your Razorpay dashboard — confirm your app is using the live keys (starting with
rzp_live_) and that you're looking at the same Razorpay account that owns those keys