Integration Steps
Steps to integrate your OpenCart Extension with Razorpay Payment Gateway.
Follow the steps given below to integrate Razorpay Payment Gateway with your OpenCart Extension.
Follow the steps given below:
-
Download the latest Source code zip file of the required version of the plugin.
-
Download the latest release of the OpenCart 4 plugin from the
in GitHub. Tags for OpenCart 4 are opencart4-6.x.y.Watch Out!
When installing the Razorpay plugin for Opencart 4, ensure that your zip folder only contains the following folders and file, with no hidden files:
admin/
catalog/
system/
install.json
-
Download the latest release of the OpenCart 3 plugin from the
in GitHub. Tags for OpenCart 3 are opencart3-1.x.y. -
For OpenCart 2,
from GitHub. Tags for OpenCart 2 are opencart2-3.x.y. -
For OpenCart 1.5,
from GitHub. Tags for OpenCart 1.5 are opencart1.5-1.x.y. -
Navigate to Extensions → Installer and click Upload. Choose the zip file.
Configure OpenCart as given below:
-
Log in to
. -
Navigate to the Admin Panel → Extensions → Payments to install the Razorpay Payment Gateway extension.
-
Click Edit. Complete the following steps:
- Add in your Key_ID and Key_Secret generated from the .
- Change extension status to Enabled.
- Click Save to save the extension settings.
Handy Tips
Webhook is auto-configured on OpenCart 3 (versions 5.0.0 and above) and OpenCart 4 when you enter and save the API key ID and secret on the plugin settings page. You need to verify if webhooks are enabled on your
.
However, for versions lower than 5.0.0, you must .Create a Cron for Webhook using cpanel, follow the steps given below:
- Log on to your cPanel Interface.
- Go to Advanced section.
- Click Cron Jobs.
- Select the specific time from the lists provided (every 5 minutes).
- Enter
https://<shop_url>/index.php?route=extension/payment/razorpay/rzpWebhookCron/
in the Command field.
For more information about Cron, refer to
.
After the integration, Razorpay will appear as a payment option on your webpage/app. You need to click the button and make a test transaction to ensure the integration works as expected. You can start accepting actual payments from your customers once the test is successful.
You can make test payments using one of the payment methods configured at the Checkout.
- No money is deducted from the customer's account as this is a simulated transaction.
- Ensure you have entered the API keys generated in the test mode in the Checkout code.
You can select any of the listed banks. After choosing a bank, Razorpay will redirect to a mock page where you can make the payment a success
or a failure
. Since it is the Test mode, we will not redirect you to the bank login portals.
You can enter one of the following UPI IDs:
success@razorpay
: To make the payment successful.failure@razorpay
: To fail the payment.
Handy Tips
You can use Test Mode to test UPI payments, and Live Mode for UPI Intent and QR payments.
You can select any of the listed wallets. After choosing a wallet, Razorpay will redirect to a mock page where you can make the payment a success
or a failure
. Since it is the Test mode, we will not redirect you to the wallet login portals.
You can use one of the test cards to make transactions in the Test mode. Use any valid expiration date in the future and any random CVV to create a successful payment.
You can track the payment status from the Razorpay Dashboard or poll our APIs.
To verify the payment status from the Dashboard:
- Log in to the and navigate to Transactions → Payments.
- Check if a
payment_ID
has been generated and note the status. In case of a successful payment, the status is marked ascaptured
.
Follow these steps before taking the integration live:
You can perform an end-to-end simulation of funds flow in the Test Mode. Once confident that the integration is working as expected, switch to the Live Mode and start accepting payments from customers.
Watch Out!
Ensure you are switching your test API keys with API keys generated in Live Mode.
To generate API Keys in Live Mode on your Razorpay Dashboard:
- Log in to the and switch to Live Mode on the menu.
- Navigate to Account & Settings → API Keys → Generate Key to generate the API Key for Live Mode.
- Download the keys and save them securely.
- Replace the Test API Key with the Live Key in the Checkout code and start accepting actual payments.
After payment is authorized
, you need to capture it to settle the amount to your bank account as per the settlement schedule. Payments that are not captured are auto-refunded after a fixed time.
Watch Out
- You should deliver the products or services to your customers only after the payment is captured. Razorpay automatically refunds all the uncaptured payments.
- You can track the payment status using our or webhooks.
Authorized payments can be automatically captured. You can auto-capture all payments
on the Razorpay Dashboard. Know more about .Watch Out!
Payment capture settings work only if you have integrated with Orders API on your server side. Know more about the
.Is this integration guide useful?