This document explains how to configure and use the Razorpay Payment Gateway Addon within the KiviCare Clinic Management System. It is intended for administrators who want to accept secure online payments using Razorpay.

Overview

The Razorpay Payment Gateway Addon enables clinics to accept payments using Razorpay’s secure checkout.

It supports multiple payment methods, including:

The integration works by creating an Order in Razorpay, redirecting the patient to a secure checkout, and verifying the payment signature upon completion.

Prerequisites

Before configuring Razorpay, ensure the following requirements are met:

Razorpay Configuration in KiviCare

Step 1: Navigate to Payment Settings
  1. Log in to the WordPress Admin Dashboard.
  2. Go to KiviCare > Settings > Payment Settings.
Step 2: Enable Razorpay Gateway
  1. Locate Razorpay in the list of available payment gateways.
  2. Toggle the Enable switch (Green).
  3. Click Manage (or the edit icon) to open Razorpay settings.
Step 3: Configure Razorpay Settings

Fill in the following fields:

Step 4: Save Settings

Click the Save button to apply and store your Razorpay configuration.

How to Obtain Razorpay API Keys

Follow these steps to generate Razorpay API credentials:

  1. Log in to the Razorpay Dashboard.
  2. Navigate to Settings > API Keys.
Test Mode Keys
  1. Enable Test Mode using the toggle at the top.
  2. Click Generate Test Key.
  3. Copy the Key ID and Key Secret.
Live Mode Keys
  1. Switch to Live Mode.
  2. Click Generate Live Key.
  3. Copy the Key ID and Key Secret.

Important: Test keys only work in Sandbox mode, and Live keys only work in Live mode.

Payment Flow

Razorpay Webhook & Secret Key Configuration

1. Introduction

The Razorpay Webhook integration allows KiviCare to receive real-time notifications from Razorpay regarding payment status. This ensures that appointment bookings are updated instantly, even if a patient closes their browser window before being redirected back to your website.

The addition of the Webhook Secret Key provides an extra layer of security, ensuring that only authentic messages from Razorpay are processed by your clinic system.

2. Configuration Guide
Step 1: KiviCare Setup
  1. Log in to your WordPress Admin Dashboard.
  2. Navigate to KiviCare Settings → Payment Gateways → Razorpay.
  3. Webhook Secret: Create a secure password or string and enter it into the “Webhook Secret” field.
    • Tip: Keep this secret handy as you will need to enter the exact same string in your Razorpay account.
  4. Webhook URL: You will see a unique URL generated in the settings. Copy this URL to your clipboard.
Step 2: Razorpay Dashboard Setup
  1. Log in to your Razorpay Dashboard.
  2. In the left sidebar, go to Settings → Webhooks.
  3. Click on the + Add New Webhook button.
  4. Webhook URL: Paste the URL you copied from your KiviCare settings.
  5. Secret: Enter the exact same Webhook Secret string you created in Step 1.
  6. Active Events: Under the “Select Events” section, check the boxes for:
    • payment.captured
    • payment.failed
    • refund.created
  7. Click Create Webhook to save your settings.
3. Key Benefits & Features
Automated Appointment Confirmation

Once configured, KiviCare will automatically confirm appointments as soon as Razorpay captures the payment. This eliminates the need for manual status updates and prevents “pending” appointments caused by browser closure or network interruptions.

Enhanced Security

The Webhook Secret Key acts as a digital handshake. Every notification sent by Razorpay is signed using this secret. KiviCare verifies this signature before taking any action, preventing unauthorized or fraudulent payment confirmations.

Real-Time Status Mapping

The system automatically synchronizes the following states:

If payment fails or is cancelled, the appointment remains Cancelled.

Troubleshooting

Common Issues and Solutions
Payment Failed
Signature Verification Failed
Currency Issues
Razorpay Checkout Not Loading

Ensure your site is using HTTPS.

Best Practices