Serious issue with paypal
Hello, I originally wrote a long account of 2 issues I was having with PayPal, however after talking to Ray it seems that my issues are resolved.
But will still describe the issues I was having in case anyone else was having problems..
ISSUE 1: Sometimes on checkout the website would redirect to 2 different PayPal pages...one was the the old style and the other was a nice looking fresh versions (screenshots attached). This was completely random.
ISSUE 2: On the PayPal page after logging in and confirming the order and pressing the Paypal Continue button....it would then redirect to my website's cart.php page and it would show the cart to be empty..this was puzzling as this was random and mostly the order were successful...just once in a while it would redirect to an empty cart page so the order failed.
Well...After many tests, I realised the once thing I wasnt paying attention to is my website's URL I have 2 URLS and old one that my client had originally used and a newer one that I recommended for SEO purposes...however because Internet browsers have auto-complete I beleive somemtimes I was placing order via the old URL and when I get redirected to PayPal to confirm the order, it was then redirecting back to the new URL..so that would mean of course it would redirect to an empty cart page as the URL needs to match during the PayPal payment process.
Originally I had an .htaccess snippet of code to create the redirect to the new URL if a customer enters the old URL in the browser...So something there must have gone wrong as I just checked it and my .HTACCESS file was blank..possible when I was testing out some other functions of the .HTACCESS file and forgot to go back to the original.
So correcting the HTACCESS file solved ISSUE 2:
in case anyone requires it the code I use for redirect is:
# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.yourwebsite\.co.uk
RewriteRule (.*) http://www.yourwebsite.co.uk/$1 [R=301,L]
OK, now the other issue of 2 different PayPal payment layout pages, Ray had informed me that PayPal was had been doing A/B testing for performance. Once way to fix the issue, so that it would go to the NEW PayPal payment layout page is to change line 206 of the ecart file: PP_ECO_PHP.php ...
originally in my ecart file I had the code:
$retVal->ECOServer = "https://www." . ($usesandbox?"sandbox.":"") . "paypal.com/webscr?cmd=_express-checkout&token=" . $_SESSION['PayPal_ECO_Token'];
and change to this code:
$retVal->ECOServer = "https://www." . ($usesandbox?"sandbox.":"") . "paypal.com/checkoutnow?token=" . $_SESSION['PayPal_ECO_Token'];
This should solve the issue :)
Chris