Back

VibeFox Razorpay for OpenCart — Help

Requirements

OpenCart: 3.0.x (tested on 3.0.5.0) or 4.0.2 and later (tested on 4.1.0.3).

PHP: 8.0 or later.

Razorpay account: you need the Key ID and Key Secret of your Razorpay account for test mode, and for live mode once your account is activated. A webhook with a secret of your choice is strongly recommended (see Configuration). Payments in currencies other than INR need International Payments enabled on your Razorpay account.

VibeFox license key: bought on vibefox.net. One key works on one domain.

Installation

The download is one zip file with the packages for both OpenCart versions. Unpack it on your computer. It contains README.txt, the OpenCart 3 package wcp_razorpay_payment-oc3-(version).ocmod.zip and the OpenCart 4 package wcp_razorpay_payment.ocmod.zip. Install only the package for your OpenCart version. The license key is the same for both versions.

OpenCart 3

1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_razorpay_payment-oc3-(version).ocmod.zip. The extension has no OCMOD modifications, so Extensions > Modifications does not need a refresh. Instead of the installer you can copy the contents of the upload folder of this package into the root folder of your store.

2. Go to Extensions > Extensions and choose the type Payments. Find VibeFox Razorpay Payment and click Install (the green + button). Your admin user needs the right to modify the payment extensions list.

3. Click Edit (the pencil button) to open the settings page. Paste your VibeFox license key into License key in the license block at the top of the page and click Activate (see License key).

4. Enter your Test Key ID and Test Key Secret, set up the webhook in the Razorpay Dashboard and enter its secret (see Configuration).

5. Turn on Enable/Disable and click Save. Make a test payment with Test mode on. When you are ready, enter the Live keys and turn off Test mode.

OpenCart 4

1. In the admin go to Extensions > Installer, click Upload and choose the file wcp_razorpay_payment.ocmod.zip. Do not rename the file: OpenCart 4 takes the extension code from the file name, and a renamed package does not work.

2. The package appears in the list of installed extensions on the same page. Click Install (the green + button) next to it.

3. Go to Extensions > Extensions and choose the type Payments. Find VibeFox Razorpay Payment, click Install (the green + button), then Edit (the pencil button).

4. Enter the license key, the Razorpay keys and the webhook as in steps 3 to 5 for OpenCart 3. The settings page and its fields are the same in both versions. Only the webhook URL is different (see Webhook).

A new install starts with the payment method turned off and test mode on.

Configuration

All settings are on the extension page: Extensions > Extensions > Payments > VibeFox Razorpay Payment > Edit. The sections are listed on the left; the Save button under the list saves the whole page. Without the right to modify the extension the page shows the settings but cannot save them.

Above the settings the page explains that the order gets a status only after the payment is verified with Razorpay, and shows notices: the keys of the current mode are missing (Razorpay is then not shown at checkout), the Key ID does not start with rzp_test_ in test mode or rzp_live_ in live mode, test mode is on, the webhook secret is empty, or the default currency of the store is not INR and needs International Payments on your Razorpay account. The notices are updated after each save.

When you save, Title must be 1 to 128 characters long (Enter a title for the payment method (1 to 128 characters).), Sort Order must be a whole number (negative numbers are allowed), Total must be a number, 0 or greater, and the geo zone and every order status must exist. Otherwise nothing is saved. Spaces pasted with the Key IDs are removed.

Razorpay

Enable/Disable: Enable Razorpay Payment Gateway turns the payment method on or off. Default: off.

Title: the payment method name customers see at checkout. It is also the payment method name stored in the order. Default: UPI, Cards, NetBanking. Required, up to 128 characters.

Description: the text shown to the customer at the Confirm Order step, above the confirm button. Default: Pay securely via UPI, Credit/Debit Card, or Internet Banking through Razorpay.

Sort Order: the position of Razorpay among the payment methods at checkout. Leave it empty or enter a whole number.

Geo Zone: offer Razorpay only for payment addresses in the selected geo zone. Default: All zones. Geo zones are set up in System > Localisation > Geo Zones.

Total: the checkout total, in the default currency of the store, that an order must reach before Razorpay is offered: a number, 0 or greater. Leave it empty to offer Razorpay for any total.

API keys

Get your keys in the Razorpay Dashboard under Account & Settings > API Keys (the page links there). Switch the Dashboard to Test mode to generate test keys (rzp_test_...). Live keys (rzp_live_...) are available after your account is activated.

Test mode: uses the Test mode keys, so no real money is charged. Default: on. Turn it off to take real payments. Payments, captures and refunds of an order always use the keys of the mode in which the order was paid, so switching the mode later does not affect existing orders. While it is on, customers see Razorpay Test mode: no real money will be charged. at the Confirm Order step and on the payment page.

Test Key ID: the Key ID from the Razorpay Dashboard in Test mode. It starts with rzp_test_.

Test Key Secret: the Key Secret from the Razorpay Dashboard in Test mode.

Live Key ID: the Key ID from the Razorpay Dashboard in Live mode. It starts with rzp_live_.

Live Key Secret: the Key Secret from the Razorpay Dashboard in Live mode.

Saved secrets are never shown again. The field stays empty and shows Saved — leave empty to keep it. Type a new value only to change it. To remove a saved value, tick Clear the saved value on save under the field and click Save.

Payment

Payment Action: when the money is taken. Default: Authorize & Capture.

Authorize & Capture: the customer is charged immediately. If Razorpay reports an authorized payment, the extension captures it.
Authorize Only: the money is reserved. The order gets the Authorized Status, and you capture the payment later with Capture Razorpay payment in the Razorpay tab of the order page, or in the Razorpay Dashboard. Razorpay refunds authorized payments automatically if they are not captured in time.

Webhook

The webhook confirms payments even when the customer closes the browser right after paying, and records refunds made in the Razorpay Dashboard. In the Razorpay Dashboard go to Account & Settings > Webhooks and add a webhook in Test mode and another one in Live mode. Use the URL shown in Webhook URL in this section. On OpenCart 3 it looks like https://your-store/index.php?route=extension/payment/wcp_razorpay_payment/webhook, on OpenCart 4 like https://your-store/index.php?route=extension/wcp_razorpay_payment/payment/wcp_razorpay_payment.webhook. It is built from the storefront address of your OpenCart installation. Copy it exactly as the settings show it. Enter a secret of your choice in Razorpay and select these events (they are also listed in this section):

payment.authorized: a payment was authorized.
payment.captured: a payment was captured, also when you capture it in the Razorpay Dashboard.
payment.failed: a payment attempt failed.
order.paid: the Razorpay order of the payment was paid.
refund.created: a payment was refunded, for example in the Razorpay Dashboard.

Webhook Secret: the secret you entered when creating the webhook. Use the same secret for the Test and the Live webhook, because the extension has one field for both. Webhooks without a valid signature are rejected. Without the webhook, a payment is confirmed only when the customer returns from the popup, or when the customer starts the payment for the same cart again later.

Orders

OpenCart creates the order at the Confirm Order step without a status (a missing order). The order gets a status only after Razorpay has confirmed the payment. A failed or abandoned payment leaves it without a status, and the cart is kept. OpenCart has no Authorized and no On hold status, so you choose existing ones; the order notes explain the reason. Each field below lists your OpenCart order statuses.

Order Status After Payment: the payment is captured and the amount and currency match. Default: Processing.

Authorized Status: Authorize Only: the money is reserved, not captured yet. Default: Pending.

On Hold (Review) Status: manual review: the paid amount or currency differs from the order total, a payment arrived for a cancelled order, or the popup signature was valid but the payment could not be verified via the Razorpay API. Default: Pending. You can create your own statuses in System > Localisation > Order Statuses and select them here.

Cancelled Status: the extension never sets this status. It only tells the extension which orders are cancelled: a payment captured later for such an order puts it in review instead of reopening it; an authorized one only adds a note. Default: Canceled.

Refunded Status: set after the payment is fully refunded, from the order tab or in the Razorpay Dashboard. Default: Refunded.

Advanced

Enable Logging: the log is written to razorpay_p_debug.log.php in the OpenCart logs folder (storage/logs). The file cannot be opened from the web. Errors and warnings are always logged; this option adds the debug details. Keys, signatures and customer contact data are never logged. Default: off.

Log: shows the size and the latest entries of the log. Click Clear log to empty it.

Delete Data on Uninstall: when on, uninstalling the extension removes the gateway settings and the log. Orders and their Razorpay transactions and refunds always stay. Default: off.

Import / Export

Export: Download JSON saves the settings as a JSON file. Secret keys are not exported.

Import: paste previously exported JSON and click Import to restore the settings. Saved secret keys are kept.

Checkout

At the Payment Method step the customer chooses the payment method (by default UPI, Cards, NetBanking). At the Confirm Order step the customer sees your description and the note After "Confirm Order" the Razorpay Checkout window opens to pay securely (UPI, cards, NetBanking, wallets). OpenCart creates the order at this step, still without a status. When the customer clicks Confirm Order, the extension creates a Razorpay order for the exact order total and currency and opens the Razorpay payment page of your store. The Razorpay Checkout popup opens there automatically, with the customer's name, e-mail and phone filled in. On OpenCart 4 the customer picks the payment method with the Choose button of the payment method block, in the window Payment method options, and clicks Confirm Order at the bottom of the checkout page. The payment shows in Razorpay as Order # and the order number. If the popup is closed, the customer can click Pay Now to open it again or Choose another payment method to go back to checkout. The cart is kept.

After a successful payment the customer sees Please wait while we process your payment... The extension checks the Razorpay signature, fetches the payment from the Razorpay API and compares the amount and currency with the order. The order is marked paid only after Razorpay confirms it. The order then gets its status the standard OpenCart way, with the usual order e-mails and stock update, and the customer sees the OpenCart order success page. If the signature is valid but the payment cannot be fetched at that moment, the order gets the On Hold (Review) Status and the webhook confirms it later.

OpenCart 3 creates a new order every time the Confirm Order step is shown. OpenCart 4 keeps one order for the checkout and updates it, so after the popup is closed or Choose another payment method the customer pays the same order. Before a new payment starts, the extension checks the open Razorpay orders of the same cart: one that is already paid, for example because the customer closed the browser and there is no webhook, is applied instead of asking for a second payment, and the others are no longer offered. If the customer pays the same order again, its Razorpay order is reused when the amount, currency and mode are unchanged; otherwise a new one is created. If the cart is already paid by another order, the customer goes straight to the success page.

Messages the customer can see:

Payment was cancelled. Please click "Pay Now" to try again.
Payment could not be completed. Please try again.
Your session has expired. Please click "Pay Now" to try again.
We could not verify your payment. The message adds that the order will be updated automatically once Razorpay confirms it if money was debited.
This payment method is not available right now. Please choose another payment method. The keys are missing or wrong.
Razorpay is temporarily unavailable. Please try again in a few minutes.
Razorpay could not accept this payment: followed by the reason from Razorpay.
The order amount is too small to be paid with Razorpay.
Razorpay Checkout could not be loaded. The popup script is blocked; the message asks to check the connection, disable content blockers and reload the page.

On OpenCart 4, if the order of the checkout was closed by the store or is already paid for a different cart (for example the cart has changed since, including a new quantity), the customer is sent back to the checkout with Your previous order is already closed or paid. Please confirm the order again: the cart will be paid with a new order., and the next Confirm Order pays a new order. On OpenCart 4 the messages that lead back to the checkout, such as this one, Payment session not found. Please try again. and We could not verify your payment., are shown above the checkout page.

The webhook also works while the store is in maintenance mode: OpenCart 3 lets payment extension requests through, and on OpenCart 4 the extension adds a startup action for the webhook and the result of the popup.

The extension takes one-time payments only. It has no subscriptions or recurring payments, no saved cards, no Razorpay Magic Checkout, Payment Links or Route (split payments), and no offer or affordability widgets.

Orders and refunds

Order statuses

No status (missing order): the customer has not paid, the payment attempt failed, or Razorpay has not confirmed the payment yet. In Sales > Orders such orders are shown only with the filter Order Status set to Missing Orders.

Order Status After Payment (default Processing): the payment was captured and confirmed. A note shows the Razorpay payment ID (pay_...), the amount and how it was confirmed (callback, webhook, sync or admin).

Authorized Status (default Pending): the payment was only authorized (Authorize Only). Capture it to complete the order.

On Hold (Review) Status (default Pending): set in these cases, each with a note: the paid amount or currency did not match the order, the payment was captured for a cancelled order, or the payment could not be verified via the Razorpay API at that moment. Check the order and fulfil it or refund the payment.

Cancelled Status: a payment that arrives later for a cancelled order does not reopen it automatically: an authorized payment is not captured and only gets a note, and a captured payment puts the order in review. A repeated notification of the payment that already paid the order changes nothing, even if you cancelled the order afterwards.

Refunded Status (default Refunded): the payment was fully refunded.

If an additional payment arrives for an order that is already paid, the order is not changed. A note asks you to refund it in the Razorpay Dashboard if it is not intended. A late payment of an older order of a cart that is already paid leaves that older order without a status, and the paid order gets the note. A late payment.failed for a paid order only adds a note.

Notes are entries in the order History that the customer does not see.

VibeFox Razorpay Payment tab

In Sales > Orders open an order paid with Razorpay. At the bottom of the order page, next to History and Additional, the VibeFox Razorpay Payment tab shows the Payment ID with a Test mode label for test payments, the Razorpay order, the payment Status, Paid / refunded (the amount Razorpay charged and the amount refunded), the capture button, the refund form, the refund history and the Razorpay notes of the order. The tab is shown to users who have access to the extension. Capture and refunds need the right to modify the extension (set in System > Users > User Groups).

Capture (Authorize Only)

Open the order in the Authorized Status, click Capture Razorpay payment in the tab and confirm Capture the authorized Razorpay payment? The payment is captured in the mode it was authorized in, and the order is set to Order Status After Payment, without notifying the customer and without changing stock, like a manual status change. If Razorpay refuses, the tab and the notes show Razorpay capture failed: with the reason. A capture made in the Razorpay Dashboard completes the order by the webhook.

Refunds

In the tab enter the Amount (the amount not refunded yet is filled in), optionally a Reason (optional), and click Refund via Razorpay. Confirm the question Refund this amount through Razorpay? This cannot be undone. Full and partial refunds are supported. Refunds are made in the amount and currency Razorpay charged, so after an amount mismatch you can refund up to what the customer actually paid, not the order total. A larger amount gives Invalid refund amount: at most followed by the amount. The refund is sent with the keys of the mode the payment was made in. If Razorpay does not accept the refund, the tab shows Razorpay refund failed: with the reason, and no refund is recorded. A successful refund is added to the refund history and the notes with the Razorpay refund ID, amount and status. A full refund sets the order to Refunded Status without notifying the customer and without returning products to stock. A partial refund does not change the status. Refunds are available once the payment is captured.

Product returns in Sales > Returns do not send money back through Razorpay.

Refunds made in the Razorpay Dashboard arrive by the webhook and are recorded once in the refund history (marked Razorpay Dashboard) and the notes. When the order is fully refunded, its status becomes Refunded Status. A Dashboard refund in another currency or larger than the refundable amount is not recorded automatically; a note asks you to record it manually.

License key

The extension works with a VibeFox license key from vibefox.net. The license block License — VibeFox Razorpay Payment is the first block on Extensions > Extensions > Payments > VibeFox Razorpay Payment > Edit, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this store. Below them are the line Product: opencart-payment-razorpay and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only admin users with the Modify permission for the extension can change the key. The texts of the block follow the admin language (English and Russian are included).

If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the store address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the extension keeps working on the last known status.

One key works on one domain: the store address from the OpenCart configuration. Removing the key from the store does not free its domain slot. Free the slot in your vibefox.net account.

Without an active key, Razorpay is not shown to customers at checkout. If a payment is started anyway, the customer sees This payment method is not available. Please choose another one. An admin user who is logged in to the admin in the same browser still sees the payment method in the store, marked (unlicensed — visible to admins only), so you can set up and test the extension before you buy a key. On OpenCart 4 this preview is not available: the store does not see the admin login, so without an active key the payment method is hidden for everybody. After you have opened the Edit page once, a reminder appears on the admin Dashboard. Close it with × to hide it for 7 days. Existing orders are not affected: payments already started are still confirmed, and captures and refunds work.

When a license expires, the extension keeps working, but updates and support need a renewal. The status is checked again automatically when you open the admin Dashboard or the Edit page: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling the extension always removes the license key and license status.

Troubleshooting

Razorpay does not appear at checkout: check that the license is active, Enable/Disable is on and the current mode has both keys: Test Key ID and Test Key Secret in test mode, Live Key ID and Live Key Secret in live mode. The settings page shows a notice when they are missing. Also check that the payment address is in the selected Geo Zone and that the order reaches the Total set in the settings.

The payment went through, but the order stays without a status: the webhook is not working. In the Razorpay Dashboard check that the webhook exists in the mode you use (Test or Live), that its URL is exactly the one shown in Webhook URL and that the five events are selected. Check that Webhook Secret is the same secret as in Razorpay. The order also gets its status when the customer returns from the popup, or starts the payment for the same cart again.

Webhook answers Webhook secret not configured: Webhook Secret is empty. Enter the secret of the Razorpay webhook. Razorpay delivers the event again later.

Webhook answers Invalid signature or Missing signature: the secret in the settings differs from the secret of the Razorpay webhook. Enter the same secret in both places, for the Test and the Live webhook.

Webhook answers Retry later: the extension could not confirm a capture with the Razorpay API, the order status could not be set, or the cart was being updated by another request at the same moment. Razorpay delivers the event again automatically. The reason is in the Log.

The webhook URL shows Method not allowed in the browser: this is normal. The URL accepts only requests from Razorpay.

An order is in the review status: read the notes in the VibeFox Razorpay Payment tab. The amount or currency did not match the order, the payment arrived for a cancelled order, or it could not be verified via the Razorpay API at that moment and waits for the webhook.

The customer sees an error when paying: look at the Log field on the extension page. Errors are logged even with Enable Logging off. Wrong keys give the message that the payment method is not available right now. Other reasons from Razorpay are shown after Razorpay could not accept this payment:.

The popup does not open: the Razorpay Checkout script was blocked by a content blocker or the connection. The customer sees a message and can reload the page.

No capture or refund form in the tab: the tab says why: the payment is not captured yet, it is fully refunded, your user group has no right to modify the extension, or the keys of the mode the payment was made in are not set (The payment was made in Test mode, but the Test Key ID / Key Secret are not configured. or the same for Live mode). Enter the keys of that mode and try again.

Uninstall

Go to Extensions > Extensions, choose the type Payments and click Uninstall (the red − button) next to VibeFox Razorpay Payment. The license key and license status of this extension are always removed. OpenCart always removes its own settings of the extension: Enable/Disable, Sort Order, Geo Zone, Total and the order statuses of the Orders section, which return to their defaults on a re-install. On OpenCart 4 the events of the extension and its startup action, which lets the webhook through in maintenance mode, are removed too. If Delete Data on Uninstall is on, the other gateway settings (title, description, test mode, keys, payment action, webhook secret, logging) and the log are removed. If it is off, they are kept for a later re-install. The Razorpay transactions and refunds are always kept, so orders paid before can still be captured and refunded after a re-install. Existing orders keep their payment notes.

On OpenCart 4, to remove the files of the extension as well, go to Extensions > Installer after the uninstall and click Uninstall (the orange − button) next to VibeFox Razorpay Payment in the list of installed extensions, then Delete (the red bin button) to remove the uploaded package.

Razorpay is a trademark of its respective owner. This extension is not affiliated with or endorsed by Razorpay.