Razorpay

ভারতের জন্য Razorpay Checkout: কী আইডি ও সিক্রেট, ঐচ্ছিক ওয়েবহুক, সিগনেচার যাচাই, ইনভয়েস থেকে রিফান্ড, টেস্ট কী, আর সমস্যার সমাধান।

The Razorpay plugin takes payments through Razorpay Checkout, the payment window of Razorpay, for clients who pay by card, UPI, netbanking or wallet. It is free and made for shops in India (the invoice's currency is sent to Razorpay, so use INR or another currency your Razorpay account has switched on). It also sends refunds back to Razorpay from the invoice. The shared parts of all gateways are in Payment gateways.

Switching it on

  1. Open Setup → Payment Gateways, tab All Payment Gateways, press Activate on Razorpay.
  2. Enter the Key ID and the Key secret and save.
  3. If you want the server-to-server notice, add the webhook in Razorpay (below) and enter its secret.

Activation creates a small table in which the plugin remembers its Razorpay orders; uninstalling drops it.

Settings

SettingMeaning
Display name, Payment instructions, Fee %, Fixed feeThe settings every gateway has.
Test modeRazorpay has no separate sandbox address: use your rzp_test_ keys. This switch only labels the checkout page Test mode.
Key IDrzp_live_... or rzp_test_..., from Settings > API Keys in the Razorpay dashboard.
Key secretThe secret that goes with the key ID. Leave empty to keep the saved one.
Webhook secretOptional. The secret you typed when you made the webhook in Razorpay.
Webhook URLRead only: https://billing.example.com/callback/razorpay.
Checkout colourThe accent colour of the Razorpay window. Default #2563eb.

Without a key ID and secret the invoice shows Razorpay is not set up yet: the key ID or secret is missing.

What Razorpay needs from you

  • A Razorpay account with API keys. Test keys work at once; live keys need your account activated by Razorpay.
  • Optionally a webhook: in Settings > Webhooks add the Webhook URL, tick the event payment.captured and type a secret of your choice; enter the same secret in Webhook secret here. The webhook is the safety net for a client who closes the window before coming back. Without a Webhook secret, webhook calls are refused.
  • Nothing needs whitelisting. You need HTTPS on your site and the PHP curl extension.
  • Leave automatic capture on in your Razorpay account. AIOBilling accepts a payment that is captured or authorized; an authorized payment that is never captured does not bring you the money.

How a payment goes

  1. The client presses Pay ... with Razorpay on an unpaid invoice. A page titled Pay Invoice #number opens, creates a Razorpay order for the balance due and opens the Razorpay window by itself (the Pay now button opens it again; Cancel goes back to the invoice).
  2. The client pays. Razorpay sends the browser to the callback address with the payment ID, the order ID and a signature.
  3. The plugin checks the signature with your key secret. Then it asks Razorpay for the payment and checks the status, the order, the currency and that the amount equals the order's amount. The Razorpay fee is saved with the transaction.
  4. The payment ID becomes the transaction ID and the invoice is marked paid.
  5. If the webhook arrives too, it is checked with the webhook secret and recorded only once.

Refunds

On the invoice open the Refund tab, pick the transaction, give the amount and choose Refund through the payment gateway. AIOBilling calls Razorpay's refund for that payment. If Razorpay refuses, its reason is shown. See Invoices and payments.

Testing

  1. Enter your rzp_test_ Key ID and secret and switch Test mode on. The checkout page then shows a Test mode badge.
  2. Pay a small invoice with one of Razorpay's test cards or test UPI IDs.
  3. The invoice should turn Paid. In the Razorpay dashboard in test mode the payment shows as captured.
  4. For go-live enter the rzp_live_ keys and switch Test mode off.

Troubleshooting

Look in Billing → Gateway Log (filter Razorpay) and Utilities → Module Log.

Message or resultCure
Razorpay could not start the payment: ...Razorpay's own words follow, usually a wrong key or a currency your account does not support.
bad signature / The Razorpay signature is not valid.The key secret is wrong, or test and live keys are mixed.
bad webhook signatureThe Webhook secret here differs from the one in Razorpay, or is empty.
unknown orderThe payment belongs to an order this site did not create.
payment mismatch / Razorpay does not confirm this payment.The payment is not captured, or its amount or currency differs from the order.
Nothing is due on this invoice.The invoice is already paid.

You can always record the payment by hand with Add Payment. More in Troubleshooting.

এই লেখাটি কি কাজে লেগেছে?

হালনাগাদ 2026-11-03