Connect Ionic with PayU (payment gateway)


#1

Hi guys, I’m trying to setup PayU as payment gateway with Ionic using their tokenization service
http://developers.payulatam.com/en/api/tokenization.html, first I tried to implement a simple call to their API and I found out they don’t receive direct calls from the app, so all calls have to be handled by server language such as PHP. I want to ask you if you guys have some samples of how to do this or if you can guide me on how to setup each step… I found this resource online of how to send data to php http://www.nikola-breznjak.com/blog/codeproject/posting-data-from-ionic-app-to-php-server/ but I’m kind of lost…

Thanks all for the help!!!


#2

HI @juliocastrop did you got any solution?


#3

If you got any solutions means please post this answer, i’m also struggling in this.


#4

Hi Guys,
able to integrate payumoney??? Please share if yes.


#5

Hi guys, did u get any solutions about payumoney integration please share us…


#7

HI Harish,
Did you get any solution for integrating payumoney with ionic 2 ?If you could,then can you please share us the details.That will be really helpful


#8

This is relay ,rubbish Ionic no documentation available for it to integrate payu money.


#9

Hi
I have been able to do it partially in ionic 2 .What I did is like below:

-End user select PayUMoney as payment option on my app.
-I take the user to next page(through navCtrl.setRoot ) which display the transaction amount and a continue button. The same html contains transaction request parameters as hidden html type.As soon as end user clicks on continue the user is taken to the PayUMoney server.

But now I am stuck at passing success/failure URL . How would I handle the success/failure case.As soon as the transaction gets completed on PayUMoney the user needs to be redirected to my App again . I don’t know how to do this.
Can anybody help in this case ?


#10

Hello guy’s anyone did Implement it with ionic. Please provide sample code how to pass success/failure URL and handle it on app. So that I can update the DB on the basis of it.


#11

Hi Sunil
I have been able to make it work . In my case when transaction gets complete payumoney redirects to the https://payu.herokuapp.com/success URL . As I have added eventlistener on the inappbrowser window ,on loadstop even as soon as I encounter this success url I consider it as transaction completed and then store the transaction parameter and status on my server.

I hope you have gone through https://github.com/IonicU/payuhybridappintegration.

Let me know if you have further doubt.


#12

Yes,bro I am refering the same URL which you send me. But here how did you get the values back to your function after success response.

function iabLoadStop(event) {
if (event.url.match(“https://payu.herokuapp.com/success”)) {
console.log(iabRef);
iabRef.executeScript({
code: “document.body.innerHTML”
}, function(values) {
//incase values[0] contains result string
var a = getValue(values[0], ‘mihpayid’);
var b = getValue(values[0], ‘status’);
var c = getValue(values[0], ‘unmappedstatus’);
console.log(b);//Not able to get this values here

    });  

}
}
I am opening it in InAppBrowser, after it redirect to

https://payu.herokuapp.com/success

as Html response it provide to me. But not printed it inside iabLoadStop() function.


#13

Are you using ionic 2 ?
Did you check whether iabLoadStop is getting called or not ?
How have you registered event on inappbrowser ?


#14

Please bro, help me in this I am struggling from so long to make it working. but unfortunately I am not able to make it working, I am not sure what is I am missing in this.


#15

Yes, My Ionic version is: 2.2.2
this is the code I am using.

app.controller(“PaymentController”, [’$scope’, function($scope) {
$scope.payuNow = function() {
onDeviceReadyTest();
}
}]);
function onDeviceReadyTest() {
iabRef = window.open(‘payuBiz.html’, ‘_blank’, ‘location=no’);
iabRef.addEventListener(‘loadstart’, iabLoadStart);
iabRef.addEventListener(‘loadstop’, iabLoadStop);
iabRef.addEventListener(‘loaderror’, iabLoadError);
iabRef.addEventListener(‘exit’, iabClose);
}


#16

Did you check whether iabLoadStop is getting called or not ? Also onDeviceReadyTest ?

Will provide working code tonight ,if it can help you.


#17

Ok, Thanks mate. I am still trying to identify what is the issue. Your help will be appreciated bro.


#18

Ya for me also it took to long to understand and implement.Will surely help.


#19

Yes bro, I am also struggling with this its have been 4-5 days, Thanks lot


#20

Yes .
function onDeviceReadyTest() { alert(“yess calling Device Ready…”);

iabRef = window.open('payuBiz.html', '_blank', 'location=no');    
iabRef.addEventListener('loadstart', iabLoadStart);    
iabRef.addEventListener('loadstop', iabLoadStop);    
iabRef.addEventListener('loaderror', iabLoadError);    
iabRef.addEventListener('exit', iabClose);

}
This function get called, as soon as I press PayNow Button. but after it redirect me to .
https://payu.herokuapp.com/success.
It did not called the iabLoadStop () function.


#21

It seems that events are not registered in your case. Till the time payment transaction gets success there will be many time the iabLoadStop function will get called . Not only when redirect to https://payu.herokuapp.com/success .