> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Razorpay payments to Spree Commerce

> Configuring Razorpay in Your Spree Store: A Setup & Management Walkthrough.

Razorpay is a secure payment gateway that enables businesses to accept online payments via cards, UPI, net banking, and wallets. It also supports international transactions across multiple currencies.

<Info>
  Razorpay integration is maintained and developed by [Umesh Ravani](https://github.com/umeshravani).

  To support this development, please star the [GitHub repository](https://github.com/umeshravani/spree_razorpay) ❤️
</Info>

## Installation

Before you can enable Razorpay, it must be installed. To do so, you need to add this line in Gemfile:

```bash theme={"theme":"night-owl"}
bundle add spree_razorpay_checkout && bundle exec rails g spree_razorpay_checkout:install
```

After that, you need to make sure to restart the server.

## Connect Razorpay

Sign in to your Spree admin dashboard and navigate to **Settings → Payments**.

<img src="https://mintcdn.com/spreecommerce/cQFxCIv2IPZLev6h/images/integrations/razorpay/razorpay_payment_method_list.png?fit=max&auto=format&n=cQFxCIv2IPZLev6h&q=85&s=70816ad7927c06398479ff05f1677e4f" alt="" width="2242" height="1452" data-path="images/integrations/razorpay/razorpay_payment_method_list.png" />

Find Razorpay under Available Payment Methods and click **Add**.

This will redirect you to the Razorpay setup form.

<img src="https://mintcdn.com/spreecommerce/cQFxCIv2IPZLev6h/images/integrations/razorpay/razorpay_form.png?fit=max&auto=format&n=cQFxCIv2IPZLev6h&q=85&s=bd58ca37dba61006ea46502781c6d09c" alt="" width="2242" height="1472" data-path="images/integrations/razorpay/razorpay_form.png" />

You will need Key and Key Secret from your [Razorpay dashboard credentials page](https://dashboard.razorpay.com/app/website-app-settings/api-keys).

<Tip>
  To get your credentials, Navigate to Account & Settings → API Keys (under Website and app settings) → Generate new key to generate key for the selected mode.
</Tip>

<img src="https://mintcdn.com/spreecommerce/cQFxCIv2IPZLev6h/images/integrations/razorpay/razorpay_credentials.png?fit=max&auto=format&n=cQFxCIv2IPZLev6h&q=85&s=d529ac1ff1e5cd9be96e2ed1f7b6ba66" alt="" width="2372" height="1470" data-path="images/integrations/razorpay/razorpay_credentials.png" />

You should see your live and test credentials. Copy both API key into `Key` and Secret into `Key Secret`, also Test API key into `Test Key` and Test Key Secret into `Test Key Secret`

If you wish to test the Razorpay payments before going live, just select `Test Mode` option in Spree.

Click **Create** to enable Razorpay as a payment method on your store.
