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
| Prop | Type | Default | Description |
|---|---|---|---|
amountrequired | number | — | Amount in smallest currency unit (paise for INR). |
currency | string | "INR" | ISO 4217 currency code. |
namerequired | string | — | Business / product name shown in the Razorpay modal. |
description | string | — | Short description of the purchase. |
onSuccess | (paymentId: string) => void | — | Called after successful payment verification. |
onError | (error: Error) => void | — | Called if payment fails. |
className | string | — | Additional 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)}
/>