Back

VibeFox Razorpay for PrestaShop — Help

Requirements

PrestaShop: 8.0 to 9.x.

PHP: 8.0 or later. The module refuses to install on older PHP versions.

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

1. In the back office go to Modules > Module Manager and click Upload a module. Choose the module ZIP file.

2. When the upload finishes, click Configure, or find VibeFox Razorpay Payment in the module list later and click Configure.

3. Paste your VibeFox license key into License key in the license block at the top of the Configure 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.

On install the module creates two order statuses, Razorpay payment authorized and Razorpay payment on hold. PrestaShop offers a new payment module for all currencies, countries and customer groups. You can limit them in Payment > Preferences.

Configuration

All settings are on the module page: Modules > Module Manager > VibeFox Razorpay Payment > Configure. Each section has its own Save button, which saves the whole page. Above the fields the page 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 shop is not INR and needs International Payments on your Razorpay account. Spaces pasted with the Key IDs are removed when you save.

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: an empty title gives the error Enter a title for the payment method.

Description: the text shown under the payment method at checkout. Default: Pay securely via UPI, Credit/Debit Card, or Internet Banking through Razorpay.

API keys

Get your keys in the Razorpay Dashboard under Account & Settings > API Keys. 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.

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.

Clear saved secrets: tick Test Key Secret, Live Key Secret or Webhook Secret and click Save to remove it. An empty field keeps the saved value.

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 module captures it.
Authorize Only: the money is reserved. The order is created in the status Razorpay payment authorized, and you capture the payment later with Capture Razorpay payment in the Razorpay block 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. With friendly URLs it looks like https://your-shop/module/wcp_razorpay_payment/webhook, possibly with a language code such as /en/. 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 module 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.

Advanced

Enable Logging: the log is written to logs/razorpay_p_debug.log.php in the module folder. 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 module removes the module settings and the log. Orders, the Razorpay transactions and refunds and the module's order statuses always stay. Default: off.

Checkout

At the payment step the customer chooses the payment method (by default UPI, Cards, NetBanking) and confirms. The module creates a Razorpay order for the exact cart total and currency and opens the Razorpay payment page of your shop. The Razorpay Checkout popup opens there automatically, with the customer's name, e-mail and phone filled in. The payment shows in Razorpay as Cart and the cart number. No PrestaShop order exists yet at this point. 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. In test mode the page shows Razorpay Test mode: no real money will be charged.

After a successful payment the customer sees Please wait while we process your payment... The module checks the Razorpay signature, fetches the payment from the Razorpay API and compares the amount and currency with the cart. The order is marked paid only after Razorpay confirms it. The order is then created and the customer sees the standard order confirmation page. If the signature is valid but the payment cannot be fetched at that moment, the order is created in Razorpay payment on hold and the webhook confirms it later.

If the customer starts the payment again for the same cart, the module reuses its Razorpay order when the amount, currency and mode are unchanged. If that Razorpay order was already paid, for example because the customer closed the browser and there is no webhook, the module creates the order from that payment instead of asking for a second one. If the cart total changed, a new Razorpay order is created.

Messages the customer can see:

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.

The webhook works while the shop is in maintenance mode and is not blocked by the country restriction of your shop.

The module 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 order yet: the customer has not paid, or Razorpay has not confirmed the payment yet. Only the cart exists. A failed payment attempt does not create an order; the customer can pay again.

Payment accepted: the payment was captured and confirmed. The payment is recorded with the Razorpay payment ID (pay_...) as the transaction ID, and a note shows the payment ID, the amount and how it was confirmed (callback, webhook, sync or admin).

Razorpay payment authorized: the payment was only authorized (Authorize Only). Capture it to complete the order.

Razorpay payment on hold: set in these cases, each with a note: the paid amount or currency did not match the cart (for example, the cart was changed after the payment started), the payment was captured for a cancelled order, or the payment could not be verified via the Razorpay API at that moment. A paid amount in the order currency is recorded on the order. Check the order and fulfil it or refund the payment.

Cancelled: 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 Razorpay payment on hold. A repeated notification of the payment that already paid the order changes nothing, even if you cancelled the order afterwards.

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.failed for a paid order only adds a note.

Razorpay payment block

The order page shows a Razorpay payment block with the Razorpay payment ID, the Razorpay order, the payment status, Paid / refunded (the amount Razorpay charged and the amount refunded), a Test mode badge for test payments, the refund history and the Razorpay notes of the order. Capture and refunds need the right to edit orders; access to the module configuration is not needed.

Capture (Authorize Only)

Open the order in Razorpay payment authorized, click Capture Razorpay payment in the Razorpay block and confirm. The payment is captured in the mode it was authorized in, and the order becomes Payment accepted. If Razorpay refuses, the block 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 Razorpay block enter the amount (the amount not refunded yet is filled in), optionally a reason, 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 block 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. A partial refund does not change the status. Refunds are available once the payment is captured.

The module does not create credit slips. The standard PrestaShop refund buttons of the order page 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 and the notes. When the order is fully refunded, its status becomes Refunded. 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 module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Razorpay Payment is the first block on Modules > Module Manager > VibeFox Razorpay Payment > Configure, 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 shop. Below them are the line Product: presta-payment-razorpay and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only employees with the Configure permission for the module can change the key. The texts of the block follow the back office 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 shop address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the module keeps working on the last known status.

One key works on one domain: the domain of the main shop, also in a multistore setup. Removing the key from the shop 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. The PrestaShop storefront does not know that you are logged in to the back office, so the payment method is hidden for you too: you can set up the module before you buy a key, but not test it at checkout. A reminder appears in Modules > Module Manager on the Alerts tab. Existing orders are not affected: payments already started are still confirmed, and captures and refunds work.

When a license expires, the module keeps working, but updates and support need a renewal. The status is checked again automatically while you work in the back office: once a day for the first 14 days after the key is entered, then once a week. No cron job is needed. Uninstalling or resetting the module 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. In Payment > Preferences check that the module is allowed for the cart currency, the customer's country and the customer's group.

The payment went through, but no order was created: 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 is also created 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 module could not confirm a capture with the Razorpay API, the order could not be created (for example, the module is disabled), 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 Razorpay payment on hold: read the notes in the Razorpay block. The amount or currency did not match the cart, 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 module 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.

Capture or refund fails with a message about the mode: the payment was made in Test or Live mode, and the keys of that mode are not set. Enter them and try again.

Uninstall

Go to Modules > Module Manager, open the menu next to VibeFox Razorpay Payment and choose Uninstall. The license key and license status of this module are always removed. If Delete Data on Uninstall is on, the module settings and the log are removed. If it is off, all settings are kept for a later re-install. The Razorpay transactions and refunds and the order statuses Razorpay payment authorized and Razorpay payment on hold are always kept, so orders paid before can still be captured and refunded after a re-install. Existing orders keep their payment notes and transaction IDs.

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