Library/RazorpayButton

RazorpayButton

One-click Razorpay payment button with server-side order creation and signature verification.

Modular Build
Interactive Preview
Initialising Operative...

Architecture

Component Architecture
RazorpayButton/

Prop Usage

PropTypeDefaultDescription
amountrequired
numberAmount in smallest currency unit (paise for INR).
currency
string"INR"ISO 4217 currency code.
namerequired
stringBusiness / product name shown in the Razorpay modal.
description
stringShort description of the purchase.
onSuccess
(paymentId: string) => voidCalled after successful payment verification.
onError
(error: Error) => voidCalled if payment fails.
className
stringAdditional classes on the button.

Usage

import { RazorpayButton } from '@/ui/features/RazorpayButton'; <RazorpayButton amount={49900} currency="INR" name="Hackathon Kit" description="Lifetime access" onSuccess={(id) => toast.success('Payment successful! ID: ' + id)} onError={(err) => toast.error(err.message)} />