Question

I have an app is written by sencha touch 2 and phonegap that allows users pay with Paypal. I am using InAppBrowser to do this. When users tap on Pay Now now, my system will post some data and redirect to Paypal as below code:

var url = "https://www.sandbox.paypal.com/?";
url = url + 'amount=10&amount_1=10&';
url = url + 'business=myaccount@mail.com&';
url = url + 'charset=utf-8&';
url = url + 'cmd=_cart&';
url = url + 'currency_code=USD&';
url = url + 'email=customeremail@mail.com&';
url = url + 'flag_make_payment=MakePayment&';
url = url + 'item_name_1=Recharge&';
url = url + 'item_number_1=1&';
url = url + 'method=payment&';
url = url + 'no_note=0&';
url = url + 'no_shipping=0&';
url = url + 'notify_url=&';
url = url + 'quantity_1=1&';
url = url + 'return=&';
url = url + 'rm=2&';
url = url + 'upload=1';
var ref = window.open(encodeURI(url), '_blank', 'location=yes');
ref.addEventListener('exit', function() {
    //go to Account Screen
});

In browsers, after users pay with Paypal successful, it will redirect users to return URL. How can I do this in my app? How can I configure when users pay with Paypal successful, it will send users to my app with transaction data?

Was it helpful?

Solution

I have not done this personally but have researched it and I think the best solution for implementing PayPal in a phonegap application is via plugins.

See these for iOS and Android.

Good luck, Brad

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top