Razorpay Gateway
Razorpay payment gateway integration for SaaS subscriptions. This module enables accepting payments via Razorpay for tenant subscription billing, with an inline checkout experience.
Features
- Razorpay Payments: Accept payments through Razorpay's payment platform
- Inline Checkout: Razorpay checkout page rendered directly in the application
- Payment Verification: Server-side signature verification for secure payment confirmation
- Webhook Handling: Automatic payment status processing via Razorpay webhooks
Requirements
- Open Core Business Suite (Base System)
- MultiTenancyCore module (required)
- Razorpay account with API credentials (Key ID and Key Secret)
Installation
Enable via Admin Panel
- Log in as administrator
- Navigate to Settings > Addons
- Find Razorpay Gateway and click Enable
- Run migrations if prompted
Enable via Command Line
php artisan module:enable RazorpayGateway
php artisan migrate
The Multi-Tenancy module must be installed and enabled before enabling this module.
Configuration
Enabling the Gateway
- Navigate to SaaS Management > SaaS Settings
- Toggle Razorpay gateway to enabled
- Click the Razorpay settings to configure API credentials
Razorpay Settings
The Razorpay settings are accessible from the SaaS Settings page. Configure the following:
| Setting | Description |
|---|---|
| Key ID | Your Razorpay Key ID (starts with rzp_) |
| Key Secret | Your Razorpay Key Secret |
| Webhook Secret | Your Razorpay webhook secret for signature verification |
Webhook Setup
Configure webhooks in your Razorpay Dashboard:
- Go to Razorpay Dashboard > Settings > Webhooks
- Add webhook URL:
https://yourdomain.com/razorpaygateway/webhook - Select events to listen for:
payment.capturedpayment.authorizedpayment.failedorder.paid
- Copy the Webhook Secret and enter it in the Razorpay settings
Usage
This module is a payment gateway addon for the Multi-Tenancy module. Once enabled and configured, Razorpay appears as a payment option when tenants subscribe to or renew a plan. There is no separate admin interface for this module -- configuration is done through SaaS Settings.
Setup Steps
- Enable the module (see Installation above)
- Navigate to SaaS Management > SaaS Settings
- Toggle Razorpay gateway to enabled
- Enter your Razorpay Key ID and Key Secret
- Set up webhooks in your Razorpay Dashboard (see Webhook Setup below)
Tenant Payment Flow
When a tenant selects Razorpay at checkout, the Razorpay inline checkout is displayed directly in the application. After the tenant completes the payment, the payment signature is verified server-side and the subscription is activated automatically.
How It Works
- A tenant selects a plan and chooses Razorpay as the payment method
- The system creates a Razorpay order with the payment amount (converted to paise)
- The Razorpay inline checkout is displayed to the tenant
- After payment, the payment signature is verified server-side
- On successful verification, the subscription is automatically activated
- Razorpay webhooks provide backup confirmation for payment status
Troubleshooting
Payment Not Processing
- Verify the Razorpay Key ID and Key Secret are correct
- Check that the gateway is enabled in SaaS Settings
- Review application logs for Razorpay API errors
Signature Verification Failing
- Ensure the Key Secret matches the one in your Razorpay Dashboard
- Check that the order ID, payment ID, and signature are all being sent correctly
Webhook Not Receiving Events
- Verify the webhook URL is correctly set in Razorpay Dashboard
- Check that the webhook secret is correct
- Ensure the server is accessible from Razorpay's servers
- Review Razorpay Dashboard webhook logs for delivery failures
Changelog: View version history