kalp707 / maho-razorpay
Razorpay payment gateway module for Maho Commerce
Requires
- php: >=8.2
- mahocommerce/maho: >=26.5
- razorpay/razorpay: 2.*
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Razorpay payment gateway module for Maho Commerce only.
Creates a Razorpay Order per checkout, opens Checkout.js, verifies the payment signature server-side, and optionally handles payment.captured webhooks.
Composer: kalp707/maho-razorpay
Repository: https://github.com/kalp707/maho-razorpay
License: OSL-3.0
Requirements
- Maho Commerce
>=26.5(PHP 8.2+) - Composer package
razorpay/razorpay2.*(pulled automatically) - Not supported on Magento 1 / OpenMage as a first-class target
Install with Composer
From your Maho project root:
composer require kalp707/maho-razorpay php maho cache:flush
Package type is maho-module. Maho loads code and templates from vendor/.
Admin configuration
- System → Configuration → Sales → Payment Methods → Razorpay
- Set Enabled = Yes
- Enter Key ID and Key Secret from the Razorpay Dashboard (use Test keys while developing)
- Optional: Webhook Secret, merchant name, theme color, debug logging
- Save and flush cache
Recommended Razorpay Dashboard settings
- Enable Auto-capture for payments (Dashboard → Settings → Payments)
- Add a webhook:
- URL:
https://YOUR-DOMAIN/razorpay/webhook - Event:
payment.captured - Copy the webhook secret into the Magento config field
- URL:
Payment flow
- Customer places the order with method Razorpay (
pending_payment) - Redirect to
/razorpay/payment/redirect - Server creates a Razorpay Order via the official SDK
- Frontend opens Checkout.js with that
order_id - Callback to
/razorpay/payment/callbackverifies the signature and invoices the order - Optional webhook on
/razorpay/webhookcaptures missed browser callbacks
Online refunds
Credit memos created online (against an invoice) call the Razorpay Refunds API. Partial refunds are supported. The Razorpay refund id is stored as the credit memo / payment transaction id.
Endpoints
| URL | Purpose |
|---|---|
/razorpay/payment/redirect |
Starts Checkout.js |
/razorpay/payment/callback |
Verifies signature and completes the order |
/razorpay/payment/cancel |
Cancels pending payment |
/razorpay/webhook |
Webhook backup for payment.captured |
Module layout
| Piece | Path |
|---|---|
| Declaration | app/etc/modules/Kalp_Razorpay.xml |
| Code | app/code/community/Kalp/Razorpay/ |
| Templates / layout | app/design/frontend/base/default/... |
License
Open Software License 3.0 (OSL-3.0)
This licenses the Maho integration code only. Merchants need their own Razorpay account and API keys. The official PHP client is MIT (razorpay/razorpay).