How to Integrate PayUMoney in your Spree Commerce Store with RoR?
Tags: ecommerce, rails, spreecommerce, technology
Published: 2021-01-19 18:10:57

---
title: How to Integrate PayUMoney in your Spree Commerce Store with RoR?
published: true
date: 2020-10-26 13:00:31 UTC
tags: ECommerce,RubyonRails,SpreeCommerce,Technology
canonical_url: https://www.botreetechnologies.com/blog/integrate-payumoney-spree-commerce-store-with-ruby-on-rails
---

![Integrate PayUMoney in your Spree Commerce Store](https://www.botreetechnologies.com/blog/wp-content/uploads/2020/10/integrate-payumoney-spree-commerce-store-with-ruby-on-rails.jpg)

###What is a Payment Gateway?

A payment gateway is a merchant service provided by an eCommerce application service provider to authenticate and process payments via various payment modes.

It plays the role of the third party that securely transfers money from your bank account via any payment mode to the merchant’s payment portal. An [eCommerce web development company](https://www.botreetechnologies.com/ecommerce-app-development) can assist you in integrating a payment gateway with your online store.

**_Various examples of payment gateways: PayUMoney, Stripe, PayPal, etc._**

###Why PayUMoney?

PayUMoney international payment gateway is India’s leading payment gateway with 4,50,000+ merchants in India with over 100+ payment methods. It allows payment with just a single tap. It is a trusted, instant, and most secure payment gateway.

It also provides features like Auto OTP reader, saved cards and transaction management on the merchant’s dashboard. It also allows paying via credit cards, debit cards, UPI, net banking, wallets, etc.

It supports international payments with multi-currency support including Indian currency too.

**_Isn’t it amazing, right!!_**

You can also refer to the Developer Guide [here](https://developer.payumoney.com/redirect/).

Now, let’s see how we can integrate PayuMoney with [Spree Commerce development](https://www.botreetechnologies.com/spree-commerce-development).

###Read more: [Integrate Stripe Payment Gateway in Spree Commerce](https://www.botreetechnologies.com/blog/integrate-stripe-payment-gateway-spree-commerce)

###How to Integrate it into the Spree store?

PayU provides 2 ways to integrate web checkouts with an eCommerce store.

1. Redirect Checkout
2. BOLT Checkout

**ReDirect Checkout:**

It is a quick and easy way to integrate payment checkout. It also allows us to accept payments via credit/debit cards, net-banking, UPI, wallets.

**Why ReDirect checkout?**

1. Requires a few lines of code
2. No PCI-DSS Compliance Required
3. Mobile-Friendly checkouts

**Pre-requisites:**

1. Sign up to [Payu](https://payu.in/)
2. The merchant and salt keys are available on the merchant’s dashboard.

**Configurations to Spree Store:**

1. Adding payment gateway to spree store

 - Add your payment gateway to the app/models/spree/gateway as payu_in_gateway.rb .
 - Configure the gateway to the spree store in spree.rb.

2. Create a payment method for the gateway configured.
 - Login as admin.
 - Go to Configurations > Payment Methods and visit New Payment Method.
  - Add the payment method as shown in the below screenshot:

![Configurations payment methods](https://www.botreetechnologies.com/blog/wp-content/uploads/2020/10/configurations-payment-methods-1024x393.png)

3. Add a blank partial for the PayU payment method in the path app/views/spree/checkout/payment/_payu_in.html.erb

4. You can now see your payment method on the frontend in the standard checkout process as shown below:

![Standard checkout process](https://www.botreetechnologies.com/blog/wp-content/uploads/2020/10/standard-checkout-process-1024x481.png)

**Note**: Don’t forget to add the keys i.e. merchant key and salt key available on the merchant’s dashboard in the payment method we created above.

Now, if we click on the **Save And Continue button** it should pay with PayU, Right?

To send the payment request to PayUMoney ensure that you have valid credentials i.e. valid merchant key and salt that are available on the merchant’s dashboard, set the request parameters as it requires and handle the response as per the requirement.

The post [How to Integrate PayUMoney in your Spree Commerce Store with Ruby on Rails?](https://www.botreetechnologies.com/blog/integrate-payumoney-spree-commerce-store-with-ruby-on-rails) appeared first on [BoTree Technologies](https://www.botreetechnologies.com/blog).