Razorpay Integration

This article shares step by step information on how to get started with Razorpay as a payment gateway, connect your Razorpay account with Knorish to automate payment collection and assign courses.

Note: Razorpay can process a minimum of 1 INR and 1 USD or a maximum of 5,00,000 INR or a similar USD amount. For more updated details please refer to Razorpay documentation.

How to integrate Razorpay Payment Gateway with your Knorish Site

Setting up Razorpay Account

Note: The onboarding process and KYC Documentation needed for opening any payment gateway accounts depends on the existing regulations and processes laid down. For the latest information, please refer to the RazorPay Documentation here: Razorpay documentation on KYC Documents.

 

  1. Sign up or Log in
  2. Activate your account, if not activated already
  3. Go to Dashboard 
  4. Switch to Live Mode
  5. Scroll down to Settings on the bottom left corner 
  6. Click on API keys
  7. Generate your new keys to integrate on the Knorish platform
  8. Copy or download key details

Steps to follow on the Knorish platform

  1. Login to your Knorish account 
  2. Open Integrations under Settings > Payment Gateway
  3. Under Razorpay, enter the downloaded key ID and key secret details
  4. Click Save

Addition of Webhook URL

Ensuring a smooth integration, Webhooks help Razorpay perform better, connect seamlessly for data flow, and more.

This step is to be completed on Razorpay in the next steps:

  1. Login to your Razorpay Account
  2. Scroll down to Settings on the bottom left corner 
  3. Click on Webhooks
  4. Open + Add New Webhook
  5. Paste the copied Webhook URL from the knorish dashboard
  6. Secret - leave this blank
  7. Alert Email - leave this blank
  8. In Active events, select Order Events > order. paid and Subscription Events > check all events (all subscription events checked are required for selling bundles and subscriptions)
  9. Click on Create Webhook

That's it. You are done!

Confirm complete activation with a test purchase of your course as a student. You may do this in incognito mode. Make sure to log out of your academy before this test purchase. You can also use the test mode of Razorpay to test course purchase flow.

Note: Getting Internal Server Error on Payment Page?

Possible reasons:

  • Wrong key-id or key secret used.
  • All course currencies should be activated, if the course price is in USD that currency should be activated.

Razorpay Subscriptions

Subscriptions: Subscription payments are usually not enabled on Razorpay gateway accounts. Please reach out to Razorpay to enable this feature on your account. Learn more here: Razorpay Subscriptions

Note: When the user purchases a subscription using Razorpay, they can change their credit card on file.

Common Razorpay Errors

If you notice any error or unusual functionality while trying to checkout on your Knorish site, it might be due to any of the following reasons:

  1. KYC issue - when you have just set up your Razorpay account and KYC is not yet completed.
  2. Domain issue - when domain is not whitelisted on the Razorpay dashboard, payments will fail with "Payment failed" error and sometimes Razorpay payment popup will not close post payment.
  3. Currency issue - when Razorpay has approved for INR currency but your course is priced in USD.
  4. Pricing issue - when Razorpay has approved for 1 lac per transaction and your course price is higher.
  5. API Issue -  your Razorpay APIs, may have expired or been removed.