Ionic and Paypal


Is there anybody here who could make this kind of integration: Ionic and Paypal?


i implemented that with a magento backend and ionic frontend.
But it was a little bit hacky -> you need paypal start-url, success-url, fail-url.

You open a new window with the start-url suing inapp browser plugin
After that, the user sees the mobile paypal version… now you have to listen to the url-change of your created window -> if the success-url is opened you know payment success -> close the window -> success handling in your app.
If the fail-url gets opened -> payment failed -> close the window -> fail handling in your app
something like

var externalPaymentWindow = $, '_blank', 'location=yes,enableViewportScale=yes');

// listen to page load events
externalPaymentWindow.addEventListener('loadstart', function(event) {
    var url = event.url;
    if (url.indexOf(CANCEL_URL) !== -1) {
        // failed
    } else if (url.indexOf(SUCCESS_URL) !== -1) {


Hi, I’m trying your solution but I cannot get it working when cancelling or finishing the payment, how doy you set up the CANCEL_URL and SUCCESS_URL in the paypal’s sandbox?

thanks in advanced


Uff its a looooong time ago^^.

In the meantime they changed many things.
But you can follow this guide:
To set auto return

I followes this guide:

But i tested this stuff for a customer and not in my paypal account. So i do not have the chance to look it up.

But maybe it helps.


Thanks, I’ll take a look