Page 4 of 6

Paypal redirect URL issue

Posted: Thu Jul 03, 2014 6:56 pm
by Bad Addy

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.


Paypal redirect URL issue

Posted: Thu Jul 03, 2014 8:19 pm
by Kateryna Grynko

Hi Addy,

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


Paypal redirect URL issue

Posted: Fri Jul 04, 2014 8:48 am
by Bad Addy

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!


Paypal redirect URL issue

Posted: Fri Jul 04, 2014 8:53 am
by Evgene Karachevtsev

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


Paypal redirect URL issue

Posted: Fri Jul 04, 2014 8:58 am
by Bad Addy

Thank you Evgene,

Should this work in browser as well as for mobile ?


Paypal redirect URL issue

Posted: Fri Jul 04, 2014 9:11 am
by Evgene Karachevtsev

Addy,

Yes it should.


Paypal redirect URL issue

Posted: Fri Jul 04, 2014 9:14 am
by Bad Addy

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/...

:)


Paypal redirect URL issue

Posted: Fri Jul 04, 2014 9:22 am
by Evgene Karachevtsev

Addy,

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


Paypal redirect URL issue

Posted: Sun Jul 06, 2014 7:43 am
by Bad Addy

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?


Paypal redirect URL issue

Posted: Tue Jul 08, 2014 6:35 pm
by Bad Addy

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