Payments (Razorpay)
Accept one-time payments and recurring subscriptions using your own Razorpay account, connected in one click
Overview
Accept payments in your app using Razorpay. Whether you're building an e-commerce store, a donation page, a pay-per-feature product, or a subscription SaaS, describe the payment flow you need and the agent wires up the checkout, server-side order creation, signature verification, and post-payment logic.
You connect your Razorpay account once with a single click. There are no API keys to generate or paste: Pentoggle uses Razorpay's official partner authorization, so your account stays yours and money always lands directly in it.
What it supports
- One-time payments: product purchases, service fees, donations, tips, and more
- Recurring subscriptions: create plans and let users subscribe; your app reads each user's subscription status with a single call
- One-click Connect: authorize your Razorpay merchant account without copying any keys
- 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 and subscription event is cryptographically verified on the server before being accepted
- Test and live modes: try the flow end-to-end in test mode, then go live when you're ready
- 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 subscribe to a Pro plan for
₹499/month with Razorpay, and only Pro subscribers can
access the /premium route."Connecting your Razorpay account
After your app is generated, you connect your Razorpay account so payments land in it. There are no keys to copy.
- Open your app's Settings
- Go to the Settings tab in your app, and find the Razorpay section
- Click "Connect with Razorpay"
- You're sent to Razorpay to authorize your merchant account, then returned to Pentoggle
- That's it: the connection is stored securely and the subscriptions webhook is registered for you automatically. There is nothing to paste
Pentoggle never sees or stores your Razorpay password or secret key. The connection uses Razorpay's official authorization and can be revoked at any time from your app's Settings or your Razorpay dashboard. To accept subscriptions, make sure the Subscriptions product is enabled on your Razorpay account.
How it works
- A user clicks a payment button in your app
- Your app calls a server function that creates a Razorpay order on your connected account
- 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 before accepting the payment
- 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
Subscriptions
For recurring billing, the agent creates a Razorpay subscription plan (for example, "Pro at ₹499/month") and subscribes the user to it at checkout. Pentoggle keeps each subscription's status up to date on the server from verified Razorpay events, so your app never has to track billing state itself.
To gate premium features, your app asks Pentoggle whether the signed-in user is currently subscribed: if the subscription is active, unlock the feature; otherwise, prompt them to subscribe. Cancellations, failed renewals, and expiries are reflected automatically, so access stays correct without any extra webhook code in your app.
Testing payments
Try the full flow in test mode before you go live: no real money moves. Razorpay publishes test card and UPI credentials you can use to simulate success, failure, and decline scenarios end-to-end, including subscription charges.
When you're ready, switch to live mode and run a small real payment to confirm everything lands in your Razorpay account as expected.
Limitations
- 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 connect
- Subscriptions product must be enabled: recurring billing requires the Subscriptions product to be active on your Razorpay account
- 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
- "Connect with Razorpay" doesn't finish: make sure you complete the authorization on Razorpay and are returned to Pentoggle. If it was interrupted, open Settings and click Connect again
- Payment succeeds but app doesn't unlock content: the post-payment step likely failed; ask the agent to check the server function logs for the order
- Subscriber can't access premium features: confirm the subscription shows as active and that the Subscriptions product is enabled on your Razorpay account
- 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 dashboard: confirm you're in live mode and looking at the same Razorpay account you connected