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 can assist you in integrating a payment gateway with your online store.
Various examples of payment gateways: PayUMoney, Stripe, PayPal, etc.
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.
Now, let’s see how we can integrate PayuMoney with Spree Commerce development.
PayU provides 2 ways to integrate web checkouts with an eCommerce store.
- Redirect Checkout
- BOLT 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?
- Requires a few lines of code
- No PCI-DSS Compliance Required
- Mobile-Friendly checkouts
- Sign up to Payu
- The merchant and salt keys are available on the merchant’s dashboard.
Configurations to Spree Store:
- 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.
- 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:
Add a blank partial for the PayU payment method in the path app/views/spree/checkout/payment/_payu_in.html.erb
You can now see your payment method on the frontend in the standard checkout process as shown below:
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? appeared first on BoTree Technologies.