Jump to content

[SOLVED] PAYPAL payment doesnt redirect to PAYPAL site, goes to homepage


Recommended Posts

Good morning,

I am trying to migrate my eshop from joomla+virtuemart to Prestashop 1.3.1.1. I just install it and make the first tests. It seems pretty cool, faster and more user friendly but I couldnt make the module PAYPAL works properly.
I just use the module that comes already with prestashop, I set the email and logo link in the backoffice but when I tried to a payment and I click on PAypal logo, the system redirects to homepage instead of paypal site.
this behavious happens in test and normal mode.

any idea why is this happening? I did all the settings in my premier paypal account too.

thanks a lot in advance
jose

Link to comment
Share on other sites

  • 2 months later...
I am also using v1.3.1, it works fine for me. I think there might some configuration problem or permission issue.
Try to set display_errors to "on" at config/config.inc.php to see if there is any error occurs.

@ini_set('display_errors', 'on');


Hi,

Thank you very much for trying! Unfortunately, the site still redirects back to the homepage with no error messages displayed.

Mike
Link to comment
Share on other sites

Which module are you using? Is it Paypal or PaypalApi?
Please also note you have configured it correctly after installation.

After you confirmed that everything is OK, then check if the URL in redirect form is correct or not.
The correct redirect URL to Paypal should be something like action="https://www.paypal.com/cgi-bin/webscr".
I guess in your case, it might be empty or something different that causes to redirect to Home.

Please see on How to check Paypal URL and data in the form post to Paypal server

Link to comment
Share on other sites

Hi,

Fortunately, I had someone from the forum help me with the redirect problem (programming beyond my understanding :)), but now I am getting another issue that I will post about. Essentially it shows this error:

Unable to process payment. Please contact the merchant as the shipping address provided by the merchant is invalid, and the merchant has requested that your order must be shipped to that address.

I ship to China only and am guessing that the information passed on to PayPal from Prestashop for Chinese addresses is incorrect. Any thoughts?

Thanks,

Mike

Link to comment
Share on other sites

I had the same problem before and fixed by
1. Configure the country with "State" at back office. (back office - shipping -country - country detail)
2. Add two two lines to modules/paypal/redirect.php

after line 10
$address = new Address(intval($cart->id_address_invoice));
Inser line below
$state = new State(intval($address->id_state));

after line 45
<input type="hidden" name="zip" value="'.$address->postcode.'" />
insert below
<input type="hidden" name="state" value="'.$state->iso_code.'" />

Hope this help

Link to comment
Share on other sites

Hi,

Thank you so much for giving this a try. Unfortunately, it now gives an error 01 -- this country requires a state selection.

One thing that might have caused issues is that I don't have what you say above in line 45, so I left out the iso_code section. I am using Paypal module version 1.6 if this makes any difference?

Around line 45 I see the following code:

$smarty->assign(array(
'redirect_text' => $paypal->getL('Please wait, redirecting to Paypal... Thanks.'),
'cancel_text' => $paypal->getL('Cancel'),
'cart_text' => $paypal->getL('My cart'),
'return_text' => $paypal->getL('Return to shop'),
'paypal_url' => $paypal->getPaypalUrl(),
'address' => $address,
'country' => $country,
'state' => $state,
'amount' => floatval($cart->getOrderTotal(true, 4)),
'customer' => $customer,
'total' => floatval($cart->getOrderTotal(true, 3)),
'shipping' => Tools::ps_round(floatval($cart->getOrderShippingCost()) + floatval($cart->getOrderTotal(true, 6)), 2),
'discount' => $cart->getOrderTotal(true, 2),
'business' => $business,
'currency_module' => $currency_module,
'cart_id' => intval($cart->id),
'products' => $cart->getProducts(),
'paypal_id' => intval($paypal->id),
'header' => $header,
'url' => Tools::getHttpHost(false, true).__PS_BASE_URI__
));

Should any of this be changed?

Thanks again for your willingness to help. I can't wait until this headache is over!

Best regards,

Mike

Link to comment
Share on other sites


Thank you so much for giving this a try. Unfortunately, it now gives an error 01 -- this country requires a state selection.
Mike

For address from country like USA/Canada/China, this error will occur if you are using address that does not have state data. I suggest you to use a new address with "State" data to do test if you have changed country setting.


One thing that might have caused issues is that I don’t have what you say above in line 45, so I left out the iso_code section. I am using Paypal module version 1.6 if this makes any difference?
Mike

I am using Paypal 1.6 too. Maybe you are looking into different file or your are using different version of or your copy of redirect.php has been customized by someone. I can not see the lines you posted here at redirect.php.

The file you need to change is ./modules/paypal/redirect.php.
Link to comment
Share on other sites

Hi,

Thank you for your response. You are correct, the file was adjusted by someone else to allow my module to redirect to Paypal. Unfortunately, this presents the next problem.

Having states would just confuse customers. Unfortunately, I need to find a way around this.

I'd be happy to pay someone to help me get this fixed. It has been a thorn in my side for way too long to the point where I'm thinking that getting Paypal to work on Prestashop just isn't an option.

Best regards,

Mike

Link to comment
Share on other sites


Hi Mike,
I'd be happy to pay someone to help me get this fixed. It has been a thorn in my side for way too long to the point where I'm thinking that getting Paypal to work on Prestashop just isn't an option.
Mike

I can take a look for you for free, if you could give me the permission to access your site. but I can not guarantee to fix it. Of course if you could find someone else to do it for you, it will be great. I only work for this at Toronto night time,so if you would like to give me a try, please send the access information to my email address [email protected]. We can communicate after that.

I also had a lot of issue at beginning, now it stable.

Good Luck.

Alvin
Link to comment
Share on other sites

Hi Mike,
I tried access via FTP with the information you gave me, but it is always with authentication failure error. So I am not able to do anything.

I also tried to access back office to check your configuration, but you didn't tell me the URL of admin site. The default admin URL is not working(I think you have changed it for security reason).

I also tried to place a test order at your site, and see there is no "State" information available. I guess it is configuration problem. You need to add all Provinces of China to State list manually, you can do this at back office Shipping - States. Please note you must use the iso code of provinces.

If you still can not work it out, please give me the URL and admin information and I will take a look for you.

Hope this help

Link to comment
Share on other sites

  • 1 month later...

Hi all,
I am having the same problem and the 'states' solution seems to dont work in my case. no redirection and no error displayed even if I change to on the option
ini_set('display_errors', 'on');

I realized that the same behavior is happening when I select 'cash on delivery' payment mode....

any idea what is going wrong??

thanks a lot in advance.
Jose

Link to comment
Share on other sites

I tried to sign up an account, but it keep getting connection reset error.
Even though I got "Welcome" email. But when tried to log in, got the same error. Not able to go ahead.
I tried both IE and FireFox, same error.

It seem that you are not using the standard theme,and have applied some changes. I have no idea what is the problem.

Link to comment
Share on other sites

yes , I have applied several changes but none to the checkout process... very weird. in my developing enviroment (localhost), the paypal module works perfectly... maybe I just need to delete everything and start over again... re-installing the prestashop in the hosting and do small changes one by one...
first I will try to change the theme to the default one to see if this is the prob.

thanks anyway!

Link to comment
Share on other sites

Have you tried to set display_errors to “on” in file /config/config.inc.php to see if there is any error occurs.
@ini_set(‘display_errors’, ‘on’);

If you have set display errors and there is no error displayed, then it is difficult figure out without look into the code.
Will you post your URL here or PM me so that I can take look.

By the way, as I know there are some issues with Paypal 1.7 when use multiple currency.
Here you can find more

Link to comment
Share on other sites

I have got message via PM. I think it must be configuration issue.

1. Please check permission of folder and file is correct or not
folder: 755
file: 644
2. Check if following setting is set or not. This should be in /config/defines.inc.php file
define('_CAN_LOAD_FILES_', 1);

Let me know your result.

Link to comment
Share on other sites

I am really curious what is the cause. Is it possible to give me temporary FTP permission to access your site, so that I could take look to see if I could find anything. I can not guarantee fix your problem, but I will take a look. You can send access info by PM.

Link to comment
Share on other sites

I’m still not sure which folder(s) need to be 755 and which file(s) need to be 644, but it’s working.


All folders (755) that contain php or tpl or images (just some of them)
All files listed above, but not limited to must have 644 permission

What I changed for you
modules folder
modules/paypal folder and all its files
cheque folder and all its files

You can go there to compare with other folders and files
Link to comment
Share on other sites

  • 4 years later...

Hello. I have this same issue redirecting to my Home page.
I have paypal module configurated on a multistore. 1 ULR from pront end redirect correctly to paypal. The other URL from China shop, it redirects to Home page.

Somebody know how to solve?

Any error appear...

Link to comment
Share on other sites

×
×
  • Create New...