# Razorpay Stripe Billing

> Implement production-grade dual-gateway billing with Razorpay, Stripe, and GST-compliant invoicing for Next.js.

Razorpay Stripe Billing is a paid AI agent skill on Agensi by Zeeonix Digital, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $14.99 (one-time purchase)
- Creator: [Zeeonix Digital](https://www.agensi.io/creators/zeeonix-digital)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/razorpay-stripe-billing
- Tags: api, nextjs, stripe, razorpay, fintech, billing

## About this skill

Integrating global payments usually involves high risk and repetitive boilerplate. This skill implements a production-ready billing layer that handles both Razorpay for Indian markets and Stripe for global customers. It prevents double-charging and ensures tax compliance without manual logic.

### What it does
- **Dual-gateway routing** automatically directs users to Razorpay for INR/UPI or Stripe for USD/EUR based on currency.
- **Cryptographic verification** secures webhooks using HMAC and native SDK methods to prevent tampered payment signals.
- **Idempotent processing** uses database constraints to safely handle webhook retries without double-crediting accounts.
- **Tax-compliant invoicing** calculates CGST, SGST, IGST for Indian transactions and zero-rated VAT for international exports.
- **Server-side price enforcement** ignores client-side amount inputs, fetching plan costs strictly from your database or config.

### How it works
1. **Initialize environment** by installing SDKs and generating a secure `.env.example` template for both providers.
2. **Sync database models** using the provided Prisma schema for orders, webhook event tracking, and invoices.
3. **Configure checkout API** to authenticate sessions and route orders to the correct gateway based on the user's currency.
4. **Implement webhook listeners** that verify signatures and execute database transactions for payment fulfillment.
5. **Generate invoices** with sequential numbering and specific tax breakdowns for India and international regions.

### Frameworks & tools
Built for Next.js App Router and Node.js. Uses Prisma for database operations, Zod for schema validation, and official `stripe` and `razorpay` SDKs.

### Why this beats prompting it yourself
Writing billing logic from scratch often leads to security holes like price manipulation or race conditions during webhook processing. This skill provides a tested architecture for idempotency and specific Indian GST logic that generic prompts usually miss.

### Use cases
- Launching a SaaS that needs UPI/Netbanking in India and cards globally.
- Adding automated GST-compliant PDF invoicing to an existing agency platform.
- Migrating from a single-gateway setup to a multi-currency billing system.
- Hardening existing payment endpoints against webhook spoofing and double-processing.

### Known limitations
Requires a database with unique constraint support for idempotency. Does not include frontend UI components for the checkout buttons.

## Requires

- tsc
- Node.js
- typescript
- prisma

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Razorpay Stripe Billing skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill differ from simply asking an AI to write a payment integration?

This skill provides a pre-architected backend billing layer for Next.js that manages both Razorpay (for India) and Stripe (globally), handling complex logic like GST compliance and webhook security that standard AI prompts often overlook.

### What specific files or assets are included in this billing skill?

The skill provides a complete backend implementation including a Prisma schema for transaction tracking, API routes for secure checkouts, and specialized webhook handlers designed to prevent double-charging.

### Does this skill handle the tax calculation requirements for Indian SaaS companies?

Yes, the skill includes specialized logic for Indian GST (CGST, SGST, IGST) and provides the necessary structure to generate zero-rated VAT invoices for international exports.

### What are the specific technical requirements for integrating this into my project?

It is optimized for the Next.js App Router and Node.js environments using Prisma ORM; it requires a database that supports unique constraints to ensure payment idempotency.

### Does this skill include pre-built UI components for the checkout page?

While it provides the full backend logic and API infrastructure for routing payments, you will still need to create your own frontend buttons or checkout UI to trigger the provided functions.

### How does the skill ensure that webhooks are secure and not spoofed?

The skill uses HMAC cryptographic verification and native SDK methods to ensure that payment signals are legitimate and have not been tampered with by external actors.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
