npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@maasters/razorpay

v0.1.0

Published

Full Razorpay - Card, UPI, Netbanking, Wallet, Bank Verification, Payouts.

Readme

@maasters/razorpay

Full Razorpay - Card, UPI, Netbanking, Wallet, Bank Verification, Payouts.

Setup

Env:

RAZORPAY_KEY_ID=rzp_test_...
RAZORPAY_KEY_SECRET=...
RAZORPAY_WEBHOOK_SECRET=...
RAZORPAYX_ACCOUNT_NUMBER=...

Create Order (Backend)

import { createRazorpayClient, getCheckoutOptions } from '@maasters/razorpay';

const rzp = createRazorpayClient({ keyId, keySecret });

const order = await rzp.createOrder({
  amount: 50000, // 500 INR in paise
  receipt: `receipt_${Date.now()}`,
  notes: { userId: '123' }
});

// Send to frontend
const checkoutOptions = getCheckoutOptions(order, keyId, {
  name: 'Maasters Store',
  description: 'Order #123',
  themeColor: '#3399cc',
  prefill: { name: 'Arvind', email: '[email protected]', contact: '9999999999' }
});

Verify Payment (Backend - after checkout)

import { verifyPaymentSignature } from '@maasters/razorpay';

const isValid = verifyPaymentSignature({
  orderId: req.body.razorpay_order_id,
  paymentId: req.body.razorpay_payment_id,
  signature: req.body.razorpay_signature
}, process.env.RAZORPAY_KEY_SECRET!);

if (!isValid) throw new Error('Payment verification failed');
// Update order as paid in DB

Bank Account Verification (Penny Drop)

const result = await rzp.verifyBankAccount({
  account_number: '1234567890',
  ifsc: 'HDFC0001234',
  name: 'Arvind Kumar'
});
// Check result.result.active

UPI Verification

const result = await rzp.verifyUPI('arvind@okhdfcbank');

Payouts (RazorpayX)

// 1. Create fund account
const fundAccount = await rzp.createFundAccount({
  account_type: 'bank_account',
  bank_account: { name: 'Arvind', ifsc: 'HDFC0001234', account_number: '1234567890' }
});

// 2. Create payout
await rzp.createPayout({
  account_number: process.env.RAZORPAYX_ACCOUNT_NUMBER!,
  fund_account_id: fundAccount.id,
  amount: 10000, // 100 INR
  mode: 'IMPS',
  purpose: 'payout'
});

Webhooks

import { createWebhookHandler } from '@maasters/razorpay';

const handler = createWebhookHandler(process.env.RAZORPAY_WEBHOOK_SECRET!, {
  'payment.captured': async ({ payload }) => {
    await prisma.order.update({ where: { razorpayOrderId: payload.payment.entity.order_id }, data: { status: 'PAID' } });
  },
  'order.paid': async ({ payload }) => {
    // fulfill
  }
});

// Next.js route
export async function POST(req: Request) {
  const body = await req.text();
  const signature = req.headers.get('x-razorpay-signature')!;
  return Response.json(await handler(body, signature));
}

Frontend (Next.js)

'use client';
import { useEffect } from 'react';

export default function Checkout({ orderOptions }: { orderOptions: any }) {
  const pay = () => {
    const rzp = new (window as any).Razorpay(orderOptions);
    rzp.open();
  };
  useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://checkout.razorpay.com/v1/checkout.js';
    document.body.appendChild(script);
  }, []);
  return <button onClick={pay}>Pay {orderOptions.amount/100} INR</button>;
}