1.0.2 • Published 6 months ago

react-razorpay-checkout v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

react-razorpay-checkout

Razorpay checkout integration for React.

npm

Installtion

npm i react-razorpay-checkout

Usage

  1. If you are using order_id, use the below way of initializing a standard checkout:

Some options are only available/required for the StandardCheckout ie. order_id, amount and currency.

import { StandardCheckout } from "react-razorpay-checkout"
import type { StandardCheckoutOptions } from "react-razorpay-checkout"

// Define the needed options
const options: StandardCheckoutOptions = {
	key: "RAZORPAY_API_KEY",
	order_id: "sub_00000000000001",
	amount: 240000,
	currency: "INR"
	// other options here
}

// Set up the checkout instance
const razopay = new StandardCheckout(options)

// Open the checkout modal
razorpay.open()

\ 2. If you are using subscription_id, use the below way of initializing a subscription based checkout:

import { SubscriptionCheckout } from "react-razorpay-checkout"
import type { SubscriptionCheckoutOptions } from "react-razorpay-checkout"

// Define the needed options
const options: SubscriptionCheckoutOptions = {
	key: "RAZORPAY_API_KEY",
	subscription_id: "sub_00000000000001",
	// other options here
}

// Set up the checkout instance
const razopay = new SubscriptionCheckout(options)

// Open the checkout modal
razorpay.open()

API

For the complete API reference check the Razorpay's offical documentation.

LICENSE

MIT License © Rocktim Saikia 2025

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago