Skip to main content

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

  1. Log in as administrator
  2. Navigate to Settings > Addons
  3. Find Razorpay Gateway and click Enable
  4. Run migrations if prompted

Enable via Command Line

php artisan module:enable RazorpayGateway
php artisan migrate
note

The Multi-Tenancy module must be installed and enabled before enabling this module.

Configuration

Enabling the Gateway

  1. Navigate to SaaS Management > SaaS Settings
  2. Toggle Razorpay gateway to enabled
  3. Click the Razorpay settings to configure API credentials

Razorpay Settings

The Razorpay settings are accessible from the SaaS Settings page. Configure the following:

SettingDescription
Key IDYour Razorpay Key ID (starts with rzp_)
Key SecretYour Razorpay Key Secret
Webhook SecretYour Razorpay webhook secret for signature verification

Webhook Setup

Configure webhooks in your Razorpay Dashboard:

  1. Go to Razorpay Dashboard > Settings > Webhooks
  2. Add webhook URL: https://yourdomain.com/razorpaygateway/webhook
  3. Select events to listen for:
    • payment.captured
    • payment.authorized
    • payment.failed
    • order.paid
  4. 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

  1. Enable the module (see Installation above)
  2. Navigate to SaaS Management > SaaS Settings
  3. Toggle Razorpay gateway to enabled
  4. Enter your Razorpay Key ID and Key Secret
  5. 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

  1. A tenant selects a plan and chooses Razorpay as the payment method
  2. The system creates a Razorpay order with the payment amount (converted to paise)
  3. The Razorpay inline checkout is displayed to the tenant
  4. After payment, the payment signature is verified server-side
  5. On successful verification, the subscription is automatically activated
  6. 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