PHPackages                             razorpay/magento - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. razorpay/magento

ActiveMagento2-module[Payment Processing](/categories/payments)

razorpay/magento
================

Razorpay Magento 2.0 plugin for accepting payments.

4.2.1(4mo ago)3076.5k↓12%43[16 issues](https://github.com/razorpay/razorpay-magento/issues)[25 PRs](https://github.com/razorpay/razorpay-magento/pulls)1MITPHPPHP 7.\*|^8.1CI passing

Since Mar 29Pushed 1mo ago185 watchersCompare

[ Source](https://github.com/razorpay/razorpay-magento)[ Packagist](https://packagist.org/packages/razorpay/magento)[ Docs](https://razorpay.com)[ RSS](/packages/razorpay-magento/feed)WikiDiscussions master-2.x Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (357)Used By (1)

Razorpay Payment Extension for Magento
--------------------------------------

[](#razorpay-payment-extension-for-magento)

This extension utilizes Razorpay API and provides seamless integration with Magento, allowing payments for Indian merchants via Credit Cards, Debit Cards, Net Banking, Wallets and EMI without redirecting away from the magento site.

### Installation

[](#installation)

**Install through the "code.zip" file**
---------------------------------------

[](#install-through-the-codezip-file)

### `bin/magento` is executable command, this is to be executed from Magento installation directory.

[](#binmagento-is-executable-command-this-is-to-be-executed-from-magento-installation-directory)

1. Extract the attached code.zip
2. Go to the "app" folder
3. Overwrite content of the "code" folder with step one "code" folder (Note: if the code folder does not exist just place the code folder from step 1).
4. Run following command to enable Razorpay Magento module:

```
bin/magento module:enable Razorpay_Magento

```

5. Run following command to install Magento cron jobs :

```
bin/magento cron:install

```

6. Run `bin/magento setup:di:compile` to compile dependency code.
7. Run `bin/magento setup:upgrade` to upgrade the Razorpay Magento module from the Magento installation folder.
8. On the Magento admin dashboard, open Razorpay payment method settings and click on the Save Config button. **Note**: If you see this message highlighted in yellow (One or more of the Cache Types are invalidated: Page Cache. Please go to Cache Management and refresh cache types.) on top of the Admin page, please follow the steps mentioned and refresh the cache.
9. Run `bin/magento cache:flush` once again.

### **OR**

[](#or)

Install the extension through composer package manager.

```
composer require razorpay/magento
bin/magento module:enable Razorpay_Magento

```

You can check if the module has been installed using `bin/magento module:status`

You should be able to see `Razorpay_Magento` in the module list

#### Execute following commands from Magento installation directory:

[](#execute-following-commands-from-magento-installation-directory)

```
bin/magento setup:di:compile
bin/magento setup:upgrade
bin/magento cache:flush

```

Go to `Admin -> Stores -> Configuration -> Payment Method -> Razorpay` to configure Razorpay

If you do not see Razorpay in your gateway list, please clear your Magento Cache from your admin panel (System -&gt; Cache Management).

### Setting up the cron with Magento

[](#setting-up-the-cron-with-magento)

Setup cron with Magento to execute Razorpay cronjobs for following actions:

#### Cancel pending orders

[](#cancel-pending-orders)

It will cancel order created by Razorpay as per timeout saved in configuration if Cancel Pending Order is enabled.

#### Update order to processing

[](#update-order-to-processing)

Accepts response from Razorpay Webhook for events `payment.authorized` and `order.paid` and updates pending order to processing.

#### Magento cron can be installed using following command:

[](#magento-cron-can-be-installed-using-following-command)

```
bin/magento cron:install

```

### Working with GraphQL

[](#working-with-graphql)

Razorpay GraphQL Support added with Magento ver. 2.3.6

Order flow for placing Magento Order using Razorpay as payment method with GraphQL

1. set Payment Method on Cart

```
mutation {
  setPaymentMethodOnCart(input: {
      cart_id: "{{cart_ID}}"
      payment_method: {
          code: "razorpay"
      }
  }) {
    cart {
      selected_payment_method {
        code
      }
    }
  }
}

```

2. Place Magento Order

```
mutation {
  placeOrder(input: {cart_id: "{{cart_ID}}"}) {
    order {
      order_number
    }
  }
}

```

3. Create Razorpay Order ID against the Magento Order ID and the checkout page URL as referrer.

```
mutation {
  placeRazorpayOrder (
      order_id: "{{order_ID}}"
      referrer: "{{referrer}}"
  ){
    success
    rzp_order_id
    order_id
    amount
    currency
    message
  }
}

```

4. Use Razorpay Order ID `rzp_order_id` and other details from step-3 and create frontend form using razorpay's checkout.js , complete the payment and obtain razorpay\_payment\_id &amp; razorpay\_signature
5. Save Razorpay Response Details against Cart after payment success with Magento orderID, RZP paymentId , orderId and signature

```
mutation {
  setRzpPaymentDetailsForOrder (
    input: {
      order_id: "{{order_ID}}"
      rzp_payment_id: "{{RAZORPAY_PAYMENT_ID}}"
      rzp_signature: "{{RAZORPAY_SIGNATURE}}"
    }
  ){
  order{
    order_id
  }
  }
}

```

6. Pass the Magento Order ID to reset the cart.

```
mutation {
  resetCart (
      order_id: "{{order_ID}}"
  ){
    success
  }
}

```

**Upgrade Razorpay plugin through composer**
--------------------------------------------

[](#upgrade-razorpay-plugin-through-composer)

If you are an existing user, you can upgrade the Magento extension using the composer. Enter the command given below:

```
composer update razorpay/magento
bin/magento setup:upgrade

```

Using Custom Order Status in Razorpay Magento
---------------------------------------------

[](#using--custom-order-status-in-razorpay-magento)

### Step 1: Create Custom Order Status

[](#step-1-create-custom-order-status)

- On the Magento Admin Dashboard, Stores &gt; Settings &gt; Order Status.
- In the upper-right corner, click on Create New Status.
- Under Order Status Information section, Insert a Status Code for the internal reference. This field required to contain letters (a-z), the number (0-9) and the underscore, it is required to use letters at first character and the rest can be a combination of letters and numbers.
- Set the Status Label for Admin and storefront.
- Set the Store View specific labels for each store view on your store.
- Save status to complete.

### Step 2: Un-assign existing status

[](#step-2-un-assign-existing-status)

- Un-assign existing status code which is in use.
    - If State Code and Title is `processing[Processing]`, then `processing` status is already in use for state `processing`.
    - Un-assign this status from existing state code `processing`, so that state will be available for your custom status code.

### Step 3: Assign an order status to a state

[](#step-3-assign-an-order-status-to-a-state)

- Go to the Order Status page, click on Assign Status to State button.
- In the Assign Order Status to State section,
    - From the existing list of the order status, select the Order Status to assign.
    - Choose the Order State to include the order status you’ve just assigned. **Use Order state as `processing`**
    - Accept the order status as a default status, tick the Use Order Status as Default checkbox.
    - Enable the order status on the storefront, please tick the Visible On Storefront checkbox.
- Click on ` Save Status Assignment` to complete.

### Step 4: Using Custom order status for Razorpay Magento

[](#step-4-using-custom-order-status-for-razorpay-magento)

- On the Magento admin dashboard, open Razorpay payment method settings.
- At field `Custom Paid Order Status` select `Yes` to enable custom order status, select `No` to disable custom order status.
- Insert Custom Paid Order Status value at input field provided with same value which has been used as Status Code while creating custom status.
- Save configuration &amp; refresh the cache.

Uninstall OR Rollback to older versions
---------------------------------------

[](#uninstall-or-rollback-to-older-versions)

To rollback, you will be required to uninstall existing version and install a new version again. Following are actions used for rollback &amp; reinstall:

### Uninstall Razorpay Magento

[](#uninstall-razorpay-magento)

**If composer is used for installation, use following commands from Magento installation directory to uninstall Razorpay Magento module**

```
php bin/magento module:disable Razorpay_Magento
php bin/magento module:uninstall Razorpay_Magento

```

**If code.zip is used for installation, to uninstall following steps can be used:**Disabled Razorpay Magento module

```
php bin/magento module:disable Razorpay_Magento

```

To remove module directory, execute following command from Magento install directory

```
rm -rf app/code/Razorpay

```

Remove module schema from MYSQL database

```
DELETE FROM `setup_module` WHERE `setup_module`.`module` = 'Razorpay_Magento';

```

### Re-Install Razorpay Magento

[](#re-install-razorpay-magento)

To install Razorpay Magento module, follow installation steps provided at this release document. Following are previously released versions [3.7.5](https://github.com/razorpay/razorpay-magento/releases/tag/3.7.5) and [4.0.4](https://github.com/razorpay/razorpay-magento/releases/tag/4.0.5).

### FAQ

[](#faq)

How to upgrade plugin using code.zip?
-------------------------------------

[](#how-to-upgrade-plugin-using-codezip)

Download the latest code.zip and replace all the contents of the code folder with the new code.zip content. Then follow the same steps which are there for installation through code.zip.

I am getting the following error message "Column not found: 1054 Unknown column 'main\_table.rzp\_webhook\_notified\_at' in 'field list', query was: SELECT main\_table.entity\_id, main\_table.rzp\_webhook\_notified\_at FROM sales\_order AS main\_table."
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#i-am-getting-the-following-error-message-column-not-found-1054-unknown-column-main_tablerzp_webhook_notified_at-in-field-list-query-was-select-main_tableentity_id-main_tablerzp_webhook_notified_at-from-sales_order-as-main_table)

If you encounter this error message, update the plugin to the latest version to resolve the issue.

### Support

[](#support)

Visit  for support requests or email .

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance74

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Recently: every ~99 days

Total

74

Last Release

122d ago

Major Versions

1.1.24 → 2.3.02017-07-31

2.9.4 → 3.0.02020-07-28

3.8.6-beta → 4.0.02022-09-19

PHP version history (4 changes)2.0.2PHP ~5.5.0|~5.6.0|~7.0.0

2.6.0PHP ~5.5.0|~5.6.0|^7.0

3.8.3-betaPHP ~5.5.0|~5.6.0|7.\*|^8.0

4.0.1PHP 7.\*|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/adc4d2b7a7a7a8624e7b5683af11ed8ebbee623936635933c9694358827bc170?d=identicon)[crims0n](/maintainers/crims0n)

![](https://avatars.githubusercontent.com/u/7713209?v=4)[Razorpay](/maintainers/razorpay)[@razorpay](https://github.com/razorpay)

---

Top Contributors

[![enishant](https://avatars.githubusercontent.com/u/1423510?v=4)](https://github.com/enishant "enishant (172 commits)")[![yashgit891](https://avatars.githubusercontent.com/u/56789472?v=4)](https://github.com/yashgit891 "yashgit891 (112 commits)")[![ramth05](https://avatars.githubusercontent.com/u/45222925?v=4)](https://github.com/ramth05 "ramth05 (81 commits)")[![nikhilsharma1100](https://avatars.githubusercontent.com/u/102040769?v=4)](https://github.com/nikhilsharma1100 "nikhilsharma1100 (31 commits)")[![ChetanGN](https://avatars.githubusercontent.com/u/54831964?v=4)](https://github.com/ChetanGN "ChetanGN (19 commits)")[![mayankamencherla](https://avatars.githubusercontent.com/u/18058797?v=4)](https://github.com/mayankamencherla "mayankamencherla (8 commits)")[![shubham-razorpay](https://avatars.githubusercontent.com/u/195720046?v=4)](https://github.com/shubham-razorpay "shubham-razorpay (8 commits)")[![jampulanaveen](https://avatars.githubusercontent.com/u/17045054?v=4)](https://github.com/jampulanaveen "jampulanaveen (8 commits)")[![seherkdc](https://avatars.githubusercontent.com/u/47523938?v=4)](https://github.com/seherkdc "seherkdc (7 commits)")[![swati31196](https://avatars.githubusercontent.com/u/30949703?v=4)](https://github.com/swati31196 "swati31196 (6 commits)")[![ccrims0n](https://avatars.githubusercontent.com/u/4971419?v=4)](https://github.com/ccrims0n "ccrims0n (6 commits)")[![rohitcbr](https://avatars.githubusercontent.com/u/162538340?v=4)](https://github.com/rohitcbr "rohitcbr (5 commits)")[![ankurvr](https://avatars.githubusercontent.com/u/3338156?v=4)](https://github.com/ankurvr "ankurvr (5 commits)")[![ankitdas13](https://avatars.githubusercontent.com/u/89454448?v=4)](https://github.com/ankitdas13 "ankitdas13 (4 commits)")[![73SL4](https://avatars.githubusercontent.com/u/102838748?v=4)](https://github.com/73SL4 "73SL4 (3 commits)")[![abdulwahidsharief](https://avatars.githubusercontent.com/u/91587447?v=4)](https://github.com/abdulwahidsharief "abdulwahidsharief (3 commits)")[![captn3m0](https://avatars.githubusercontent.com/u/584253?v=4)](https://github.com/captn3m0 "captn3m0 (3 commits)")[![harman28](https://avatars.githubusercontent.com/u/4201494?v=4)](https://github.com/harman28 "harman28 (3 commits)")[![sskop99](https://avatars.githubusercontent.com/u/146944495?v=4)](https://github.com/sskop99 "sskop99 (3 commits)")[![root-lib](https://avatars.githubusercontent.com/u/84492897?v=4)](https://github.com/root-lib "root-lib (2 commits)")

---

Tags

magentopaymentspayment gatewayindiarazorpaywalletsnetbanking

### Embed Badge

![Health badge](/badges/razorpay-magento/health.svg)

```
[![Health](https://phpackages.com/badges/razorpay-magento/health.svg)](https://phpackages.com/packages/razorpay-magento)
```

###  Alternatives

[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
