1pospay logo

Payments · Setup guide

Set Up Razorpay on Magento 2 in Singapore

How to add Razorpay to a Magento 2 store in Singapore: Composer install commands, admin configuration, cron, webhooks, test cards, going live and refunds.

By 1 POS Pay ·

General information for Singapore businesses, not financial or legal advice. Fees and terms are set by each payment provider and can change. Check the provider's current terms and its licence status on the MAS Financial Institutions Directory.

Razorpay on Magento 2: the short answer

You add Razorpay to Magento 2 with the official razorpay/magento module. Install it with Composer, enable the module, run Magento's setup commands, then enter your Key ID and Key Secret under Stores, Settings, Configuration, Sales, Payment Methods and set Enabled to Yes. Install Magento cron so orders update on time. In Singapore the checkout then accepts cards and PayNow. This is a job for your developer or agency, because it needs command-line access.

Sign up through the 1 POS Pay Razorpay page first if you do not have an account yet: the partner link gives you 2.50% + S$0.15 on domestic cards and PayNow capped at S$4, and the same account works with this integration.

What you need before you start

You need a Razorpay account, API keys, command-line access to the Magento server, the PHP-cURL extension and outbound port 443 open. Razorpay also has a legacy Magento 1 extension, but recommends Magento 2.

In the Razorpay Dashboard, choose Test or Live mode, then go to Account & Settings, API Keys and click Generate Key. Only users with the Owner or Admin role can do this. The Key Secret is shown once, so download and store it safely. Test keys work straight away; Razorpay asks for your website details before it issues Live keys and says it verifies them within 3 working days.

Install the module with Composer

These steps follow Razorpay's Magento documentation for Singapore. Run the commands from the Magento root folder.

Installing the Razorpay module on Magento 2, from Razorpay's Singapore documentation, November 2026.
StepCommand or action
1composer require razorpay/magento
2bin/magento module:enable Razorpay_Magento
3bin/magento setup:di:compile
4bin/magento setup:upgrade
5bin/magento cache:flush
6bin/magento setup:static-content:deploy
7bin/magento cron:install

Configure Razorpay in the Magento admin

Log in to the Magento admin and go to Stores, Settings, Configuration, then Sales, Payment Methods. Under Razorpay, enter your test Key ID and Key Secret, set Enabled to Yes and click Save Config. Refresh the cache if Magento asks.

Cron matters here. The module uses it to cancel orders that stay pending past your timeout and to move paid orders to Processing. Without cron, order statuses lag behind payments.

Set up the webhook

Recent versions of the module create the webhook automatically when you save your keys. The webhook address is shown on the Razorpay settings page in Magento. For an older version, add it by hand: in the Razorpay Dashboard go to Account & Settings, Webhooks, click Add New Webhook, paste the address, enter the same secret you set in Magento, add an alert email, select the order.paid event and create the webhook.

Test a payment, then go live

Razorpay's documentation gives two test cards: Mastercard 5272 0088 0623 5705 and Visa 4111 1111 1111 1112, with any CVV and any future expiry date. In test mode a mock page lets you choose Success or Failure, and PayNow shows the same kind of mock page. After a test payment, open the Razorpay Dashboard, go to Transactions, then Payments, and check that the status is captured.

To go live, switch the Razorpay Dashboard to Live mode, generate Live keys and replace the test keys in the Magento Razorpay settings. Keep payments on automatic capture; Razorpay refunds payments that are authorised but never captured.

Refunds, limits and troubleshooting

Issue refunds from the Magento admin, not from the Razorpay Dashboard. A refund started in Magento shows in Razorpay, but a refund started in the Razorpay Dashboard does not update the Magento order. The module supports PWA storefronts through GraphQL and custom paid-order statuses. Only currencies with two decimal places are supported.

Bad request errors usually mean wrong keys. A cURL error means PHP-cURL is missing or port 443 is blocked. Undefined index: Razorpay is fixed by running bin/magento setup:di:compile. To update, run composer update razorpay/magento and then bin/magento setup:upgrade.

Other platforms: Shopify, WooCommerce, Magento, and WordPress, PrestaShop and WHMCS.

Common questions

Does Razorpay work with Magento in Singapore?

Yes. Razorpay's Singapore documentation covers the official Magento 2 module, razorpay/magento, which adds cards and PayNow to the checkout. A legacy Magento 1 extension exists, but Razorpay recommends Magento 2.

How do I install Razorpay on Magento 2?

From the Magento root, run composer require razorpay/magento, enable the module with bin/magento module:enable Razorpay_Magento, then run setup:di:compile, setup:upgrade, cache:flush and setup:static-content:deploy. Enter your keys under Stores, Settings, Configuration, Sales, Payment Methods.

Where do I refund a Razorpay payment for a Magento order?

In the Magento admin. A refund made in Magento is reflected in Razorpay, but a refund made in the Razorpay Dashboard does not update the Magento order.

Does the Razorpay Magento module need cron?

Yes. Run bin/magento cron:install. The module uses cron to cancel orders left pending past the timeout and to update paid orders to Processing.

Sources

Find the right payment provider

1 POS Pay matches Singapore businesses with MAS-licensed payment providers for card terminals, online payment gateways and payment links.

Talk to 1 POS Pay →