Angularjs Ionic

Payumoney payment gateway integration in Ionic

Payumoney payment gateway integration in Ionic

Hello Everyone, In this tutorial we are going to see how to integrate payumoney payment gateway in ionic. Normally payumoney providing sdk for native android and ios applications. They does’t providing the sdk for hybrid applications like ionic. Here we are going to see how to integrate payumoney in ionic.

It’s really very easy to integrate in ionic with the help of cordova inapp browser.

Normally payment gateway has 2 return urls. One is success and anothe one is failure. In hybrid app we can return success and failure url. Instead you can provide your
api success and failure urls.

Step 1

Create Payumoney Account and get sandbox integration credentials SALT and MERCHANT KEY.

Step 2

Step 3

Create your html file which is having payumoney payment form

In my case www/payumoney/payuBiz.html

Step 4

Write a code to collect payment data params and send it to your above html page

Here I have called my js file which will collect all above params and inject in my html inputs

$cordovaInAppBrowser:loadstop => Event will trigger only when given url load complete

Mandatory Params are : amount, productinfo, name, email, salt, hash and txnid

By using sha512.min.js I have encrypted My datas.

Step 5

Create your js file which is used to get a params from inapp browser and inject in above html

In my case payumoney/payumoneyPaymentGateway.js

It will inject all datas to html input and will submit the form

Step 6

Create your success.php

Step 7

Create your failure.php

Here you can update the payment status based on transction id.


Payumoney payment gateway integration in Ionic

Thats it. Now you can successfully able to integrate payumoney in your application.
Thanks for reading.
Please don’t forget to share and comment.