Jump to content

[workaround] SSL stops redirect to Paypal using API


Rhapsody

Recommended Posts

I have a live shop that is currently running 1.4.7.0 and using the stock Prestashop Paypal module V2.8.6. This is configured using the PayPal API and has worked well on all versions since the shop was opened using 1.3.4, and with all the incremental version upgrades.

 

I've had an SSL certificate with a dedicated IP since the shop opened. I noticed after updating to 1.4.7.0 that if I enabled SSL in the BO, that the transaction is unable to get redirected to PayPal when "I confirm my order" is clicked. It works just fine if SSL is disabled in the BO. With SSL enabled, when "I confrim my order" is clicked, the browser activity indicator goes for about 10 seconds and it stays on the confirmation page. I rolled the shop back to 1.4.6.2 and the same thing happens.

 

Some supporting information and things I've tried:

  • "Use Cache" is turned off on the performance page
  • Tried using Smarty "Force Compile" and set the cache to "No" - no change seen
  • Turned of all the CCC options - no change seen
  • I'm using friendly URL and regenrated httaccess file - no change seen
  • Turned off automatic redirect to canonical URL - no change seen
  • All the shop SSL pages appear to work fine when logged in to the front end looking at the links in the "My Account" block. The https indicator can be seen in both Firefox and IE. There are no error messages.
  • Enabled debug in config.inc.php and development mode in defines.inc.php but since no errors are generated, can't get any additional information from that.
  • Paypal API works fine when SSL is turned off - the user is directed to Paypal site when the order conformation button is clicked, then returned to the shop at the completion of the Paypal transaction. All the normal email messages are generated and money flows into the Paypal account... life is good!

Configuration information is pasted below:

Server information

Prestashop Version: 1.4.7.0

Server information: Linux #1 SMP Tue Apr 12 18:52:55 EDT 2011 i686

Server software Version: Apache

PHP Version: 5.2.17

MySQL Version: 5.0.92-community

 

I'm stumped - Any ideas out there?

 

Edit: A work around solution is posted further down this thread here

Link to comment
Share on other sites

I found it!

 

The 1.4.7.0 release added code to the \classes\FrontController.php file starting on line 87. Below are temporary changes to make until an updated file is issued by the Prestashop team. I grabbed a few lines prior to and after the comments to make it easier to find.

 

  if ($this->ssl AND !Tools::usingSecureMode() AND Configuration::get('PS_SSL_ENABLED'))
 {
  header('HTTP/1.1 301 Moved Permanently');
  header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
  exit();
 }
/*
* Rhapsody Commented out offending code that breaks SSL redirect with Paypal
 else if (Configuration::get('PS_SSL_ENABLED') AND Tools::usingSecureMode() AND !($this->ssl))
 {
  header('HTTP/1.1 301 Moved Permanently');
  header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
  exit();
 }
* * * end of Rhapsody Commented out offending code that breaks SSL redirect with Paypal **
*/
 ob_start();
 /* Loading default country */
 $defaultCountry = new Country((int)Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT'));
 $cookieLifetime = (time() + (((int)Configuration::get('PS_COOKIE_LIFETIME_FO') > 0 ? (int)Configuration::get('PS_COOKIE_LIFETIME_FO') : 1)* 3600));

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 4 weeks later...

Note that this was previously reported on the bug tracker and I tested a fix to #PSCFI-4912

 

It appears that the fixed FrontController.php did not get into the 1.4.7.2 production release. The attached file from SVN can be used to replace the classes\FrontController.php and fix the PayPal redirect when SSL is active.

 

What a shame, more people will have this issue, hopefully they will find this post before they lose too many sales.

 

Thanks for letting us know and posting the fixed file.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Hi,

 

I have version 1.4.8.2 with site turbopc.com.au and it seems the CSS and java files are http rather than https. Here is what it looks like https://www.turbopc.com.au

 

I have changed the FrontController.php as detailed in this forum but did not work. I am using 1.4.8.2 not version 1.4.7.

 

Will appreciate any help.

Link to comment
Share on other sites

Note that this was previously reported on the bug tracker and I tested a fix to #PSCFI-4912

 

It appears that the fixed FrontController.php did not get into the 1.4.7.2 production release. The attached file from SVN can be used to replace the classes\FrontController.php and fix the PayPal redirect when SSL is active.

 

I just replace file you attached.

 

and also Performance - Caching - Use Cache - Disabled.

 

 

// edited not working sorry; didnt solve problem

Edited by kkim (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 7 months later...

I am working with prestashop 1.5.3.1 and paypal api 3.4.5. I was having the same issues but then I went back into my back office and under preference - seo & urls, I realized i had my website ssl address under the ssl domain. I left blank and since I do have SSL already installed It started working just fine, without editing any code. I left shop domain the same, cleared ssl domain name and left base url / ...and that was it. Thought i would share, maybe it will help anyone.

Edited by xoaquina (see edit history)
Link to comment
Share on other sites

  • 1 year later...

I have a live shop that is currently running 1.4.7.0 and using the stock Prestashop Paypal module V2.8.6. This is configured using the PayPal API and has worked well on all versions since the shop was opened using 1.3.4, and with all the incremental version upgrades.

 

I've had an SSL certificate with a dedicated IP since the shop opened. I noticed after updating to 1.4.7.0 that if I enabled SSL in the BO, that the transaction is unable to get redirected to PayPal when "I confirm my order" is clicked. It works just fine if SSL is disabled in the BO. With SSL enabled, when "I confrim my order" is clicked, the browser activity indicator goes for about 10 seconds and it stays on the confirmation page. I rolled the shop back to 1.4.6.2 and the same thing happens.

 

Some supporting information and things I've tried:

  • "Use Cache" is turned off on the performance page
  • Tried using Smarty "Force Compile" and set the cache to "No" - no change seen
  • Turned of all the CCC options - no change seen
  • I'm using friendly URL and regenrated httaccess file - no change seen
  • Turned off automatic redirect to canonical URL - no change seen
  • All the shop SSL pages appear to work fine when logged in to the front end looking at the links in the "My Account" block. The https indicator can be seen in both Firefox and IE. There are no error messages.
  • Enabled debug in config.inc.php and development mode in defines.inc.php but since no errors are generated, can't get any additional information from that.
  • Paypal API works fine when SSL is turned off - the user is directed to Paypal site when the order conformation button is clicked, then returned to the shop at the completion of the Paypal transaction. All the normal email messages are generated and money flows into the Paypal account... life is good!

Configuration information is pasted below:

Server information

Prestashop Version: 1.4.7.0

Server information: Linux #1 SMP Tue Apr 12 18:52:55 EDT 2011 i686

Server software Version: Apache

PHP Version: 5.2.17

MySQL Version: 5.0.92-community

 

I'm stumped - Any ideas out there?

 

Edit: A work around solution is posted further down this thread here

 

I have exactly the same symptom, however I am using:

prestashop 1.5.6.0

Paypal 3.6.1

 

When I run the site in non ssl all works fine.

When I run the site in forced SSL all works fine.

When I run in normal SSL paypal stops working

 

I get a 301 moved permanently when clicking the confirm order button in paypal and get redirected back to my shop. If I change that url to HTTP it works fine.

I have this also for omnikassa ideal. (dutch) But this happens when I should get redirected to the omnikassa page.

I tried .htacces in the module folders of these modules but no luck.

Any suggestions are welcome

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...