Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Paypal redirect URL issue

Hiya, not being funny, but its been 9 hours. Please can you tell me how to make it work on the app.

I would also like to point out, on the slide at the start of the webinar, it does clearly state its for a 'mobile app'. I again would urge you change it, and also add the cheat sheet as talked about in the video.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Paypal redirect URL issue

Hi Addy,

Sorry, no news yet. We'll update when have more information.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Paypal redirect URL issue

I assumed you had already figured it out, based on what Evgene said, about re doing the webinar and he would then tell me what i need to change to make it work on the Mobile!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Paypal redirect URL issue

Hello Addy,

1) On screen createGroup3
paypal_payment-Success-Run JavaScript
instead of your code

codewindow.location.href=getVar('paypal_approvalURL');/code

use this code

setVar('paypal_payer_id', "");
if (typeof(cordova) !== "undefined") {
var ref = window.open(getVar('paypal_approvalURL'), '_blank', 'location=yes');
ref.addEventListener('loadstart', function(event) {
if (event.url.indexOf("createGroup4.html") = 0) {
ref.close();
var vars = [];
var params = event.url.slice(event.url.indexOf('?'));
params = params.slice(1).split('&');
for (var i in params) {
var item = params.split('=');
vars.push(item[0]);
vars[item[0]] = item[1];
}
setVar('paypal_payer_id', vars.PayerID);
Appery.navigateTo('createGroup4', {
reverse: false
}); /* Navigate to page 'result' */
}
});
} else {
window.location.href=getVar('paypal_approvalURL');
}
2) On screen createGroup4
on createGroup4-Page show-Run JavaScript
instead of your code use this one:

codeif (!getVar('paypal_payer_id')) {
var vars = [];
var params = window.top.location.href.slice(window.top.location.href.indexOf('?'));
params = params.slice(1).split('&');
for (var i in params) {
var item = params.split('=');
vars.push(item[0]);
vars[item[0]] = item[1];
}
setVar('paypal_payer_id', vars.PayerID);
}/code

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Paypal redirect URL issue

Thank you Evgene,

Should this work in browser as well as for mobile ?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Paypal redirect URL issue

Addy,

Yes it should.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Paypal redirect URL issue

Excellent, I will be able to try it as soon as this issue is fixed as its part of the process.

https://getsatisfaction.com/apperyio/...

:)

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Paypal redirect URL issue

Addy,

We are working on it and will get back to you with update there

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Paypal redirect URL issue

I have applied the above code, but it's behaving as it was before. It does not work the first time, and I still lose localStorage items, and the second time it seems to get the redirect, but again, I still lose localStorage items?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Paypal redirect URL issue

2 days have past, and still no reply ???

Return to “Issues”