Jump to content

’You have not placed any orders’ Message


Recommended Posts

After creating the first order on my website, using Paypal I completed the checkout without any problems.
I checked the Paypal account used and the money had transferred as expected (so no Paypal problems).
When I return to my store, and the account I used to make the transaction I had a problem.
When going to 'Order History' it shows no orders listed and shows the message:-
'You have not placed any orders'.
Now for me thats not a problem, but I can see users of the shop panicing somewhat at getting that message!

Any help?

Link to comment
Share on other sites

I've been working on this today, and it looks to me like there's a bug in the paypal payment module.

In the forum sent to paypal, the return_url field is being sent the url to validation.php.

The url for validation.php should be sent in a notify_url field in the form I think. This would also mean that you won't have to specify it in your paypal account; which is what you do according to threads I've read on here, but that's only because of the error in the paypal module, and is a work-around. e.g. here: http://www.prestashop.com/forums/viewthread/3257/

I could be miles out.... but you could try editing paypal.tpl for now and change "return_url" to "notify_url" and see if that helps. I'll have a closer look at the paypal documentation mean time and confirm my suspicions.

This should also mean that you can run multiple stores from one paypal account.

Paul

Update 16:19 12/08/2008: From the Paypal documentation:

PayPal posts HTML FORM variables to a program at a URL you specify. You can specify
this URL either in your account profile or with the notify_url variable on each
transaction. This post is the heart of IPN. Included in the notification is the payment
information, such as the payer’s name and the amount paid. All possible variables in IPN
posts are detailed in the Order Management Integration Guide.When your server receives a
notification, it must process the incoming data.
Link to comment
Share on other sites

You should also add an additional value to the form names "rm" and a value of "1" This will set the return method, which should get paypal to send your customer back to the correct page.

i.e. the end of paypal.tpl should read:

   <input type="hidden" name="notify_url" value="{$returnUrl}" />
       <input type="hidden" name="rm" value="1" />
</form>

Link to comment
Share on other sites

Hi

There is certainly something wrong, but I am not sure where.

I now have the cart moving to orders and the payment is received OK but the IPN fails with

Warning: fsockopen() [function.fsockopen]: unable to connect to www.paypal.com:80 (Connection refused) in /home/www/mysite.co.uk/modules/paypal/validation.php on line 21



And this causes an email to be sent to the customer saying that there is a payment error


Here are some checks to make

1) check your permissions.
Put this into your browser
www/mysite.co.uk/modules/paypal/validation.php

if you get a Error 500: Script Execution Failure. Then your permissions are set too high

lower the permissions to 775 or 755 until the error goes away.


2) Check your host supports fsockopen

Create a php file and put this in

<?php
if(function_exists('fsockopen')) {
echo "fsockopen function is enabled";
}
else {
echo "fsockopen is not enabled";
}
?>



Upload it to the server and run it.

3) Check the port is open

Go here to check port 80 is open

http://webtools.live2support.com/nt_cport.php


I just had a reply from Paypal who say this

Below should be the one you want:
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
You want to compare your IPN script with below:
https://paypaltech.com/SG2/
Please reply if you have further questions.



However this still does not resolve the problem. It just gives a similar error

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.paypal.com:443 (Connection refused) in /home/www/mysite.co.uk/modules/paypal/validation.php on line 26





@Paul
Paul your fix did not work

Could the problem be caused by the “/”
ie.
home/www/mysite.co.uk

And should the www be added as amwdesign suggest in the link above

We need to get this sorted

Regards

Ken.

Link to comment
Share on other sites

Does the following url work? (assuming that presta is installed in the root directory of www.mysite.co.uk)

e.g. http://www.mysite.co.uk/modules/paypal/validation.php

If the above url doesn't work, then that's the problem. The fix I posted wasn't related to this, it takes care of the configuration of the IPN return url without the need to specify it in your paypal account. return_url doesn't exist as far as paypal are concerned, whilst the notify_url one should be sent with the url paypal should send notifications to.

Its now been tested and works. We have two PrestaShops working off one paypal account now.

Paul

Link to comment
Share on other sites

I set up the paypal IPN as instructed by prestashop and then made the modification to the paypal.tpl

<input type="hidden" name="notify_url" value="{$returnUrl}" />
<input type="hidden" name="rm" value="1" />
</form>

it was tested live and all worked well. - order in shop, email to customer, email to admin.

You will need to add an IPN email so paypal can tell you a payment has been made.

Not sure about the auto return as the tester clicke the button and went back to the site manually.

Hope it helps

Bob

Link to comment
Share on other sites

Sorry ignore the previous post I misread you. It's the validation that isn't working. It looks like your server should fail when using the script you posted regarding the test for fsockopen function?

If this is the case, then you'll need to fix THAT. Nothing to do with prestashop itself.

If the test works, then it isn't allowing connections outwith your machine, so that needs fixed.

You're not with siteground by any chance? http://kb.siteground.com/article/Php_fsockopen_problems.html

Paul

Link to comment
Share on other sites

Thank You Paul.

That would be great.

I have read about a lot of people having this problem and from what I have read curl should solve it

All this is beyond my programming skills so I would be most grateful if you find a solution

Regards.

Ken.

Link to comment
Share on other sites

Hi Paul.

Thank you very much for re-coding the validation.php

I thought it was going to work because

http://www.mysite.co.uk/modules/paypal/validation.php

No longer gives an error

However with a test purchase the customer still receives this message

Hi name,

Your order #7 history

There is a problem with your payment for order #7. Please contact us at your earliest convenience.

Your order will not be shipped until we have resolved this problem.

You can review this order and download your invoice from the "Order history" section of your account by clicking "My account" on our website.




And in back office

Warning: £ 0.00 paid instead of £ 9.95


The payment error message has changed from

(2008-08-10 22:37:30) [Private]: Impossible to connect to PayPal server


with Prestashop validation.php

to

(2008-08-13 02:54:43) [Private]: PayPal payment not set to VERIFIED but:


With your validation.php

So I think you are very close to fixing this

I hope you can find the problem?

Regards.

Ken.
Link to comment
Share on other sites

Just to let anyone following this thread we are still working on it (communications via private messages don't help folks viewing this thread stay in the loop)! I have a version of the module that will now use cURL to connect to paypal should fsockopen fail (resulting in the "Impossible to connect to PayPal server" error message). This has been tested (via the sandbox) using both methods and they operate correctly in my test environment.

If only we could get it to work on Ken's site now....

@Ken: I've placed a new version (today) on your site, with some improved error checking that may hopefully shed some more light on what exactly is going wrong, if it indeed fails again (as I suspect it will).

If anyone would like a copy of my current version please PM me an email address and I'll send it on, although it's still work in progress. Maybe another pair of eyes could spot any errors in there.

After spending so long looking at the PayPal module I think I'll write an alternative one though, as there are several areas where the current one produces misleading error messages etc. and it could be greatly improved upon.

Paul

Link to comment
Share on other sites

Hi

Thanks Paul for all your help. The code is working perfectly.

The new code is much improved on the original verification code.

It can connect with fopen or cURL and will be invaluable to all the people who do not have fsockopen() enabled (GoDaddy ??)

Thanks Again.

Ken

Link to comment
Share on other sites

Tried the new file and still getting the message about no orders after i purchase something and also after purchasing some products i still have those products on my cart...
Still have that IPN error 500 when testing paypal.

Link to comment
Share on other sites

That's more likely to be a permissions error on the files or a .htaccess setting that would cause an HTTP 500 error. Fixing it will depend on the server configuration. I would suggest that the permissions on the files in the /modules/paypal directory should be 644 (i.e. paypal.php, validation.php etc.). The directories from the root downwards should be 755 (i.e. /modules and /modules/paypal if your shop is in the root directory). If those don't work then slowly relax the permissions (e.g. 664 for files and 775 for directories). Temporarily rename any .htaccess files during your testing too (turn off friendly urls in the back office while you test to prevent errors caused by having it switched on with no corresponding .htaccess entries.). You may not even see .htaccess files listed your ftp client depending on how the server and client are set up. If in doubt (and you don't have SSH access to the server) you could always get your hosting company to check.

While changing permissions use http://www.example.com/modules/paypal/validation.php as the test url. You should get a blank page when everything is working correctly (as detailed in the thread I referenced earlier).

PHP files shouldn't need the execute bit set (e.g. 755 or 775) but if all else fails I guess your server could be configured that way also. I'd leave that as a final option though if all else fails.

Paul

Link to comment
Share on other sites

When I originally posted this topic I was originally after a resolve to a problem witht items not showing in the order history when returning to my shop after making a purchase via Paypal.
I've followed the first steps, with the modification and addition to the paypal.tpl file.
I haven't noticed any changes, and the same issue is occuring.

Apologies for not posting earlier, been a bit busy here.
Any ideas?

Link to comment
Share on other sites

Howdy there,

I suspect what you'll find is that the purchases DO eventually appear, just not immediately when the customer returns to your store from paypal?

I've been working on a much enhanced paypal module that should address this issue too, although it's slightly more complex, and I'm still testing the combinations. This problem is particularly severe when payments are made via eCheck or when the paypal payment is pending for another reason (e.g. if you haven't set it to automatically convert currencies in paypal and the customer pays in a currency other than your default).

The way paypal works is asynchronously (it goes off and authorises the payment out-with the PrestaShop payment execution path). PrestaShop is synchronous in nature, so expects paypal to get there at the same time your customer does.

The way the default paypal module works is that it creates the order when it receives the "Payment Complete" IPN, but it ignores all the other IPN messages..... It also doesn't even create the order until it receives this one single valid IPN. Even for instant payments straight from a paypal account this can be 30seconds or a few hours, depending on how busy the paypal service is!

I'm attempting to get around this by creating a "Paypal Processing" status message and creating the order at the same time your customer leaves to pay with paypal. That way, you'll at least see that the order has been placed, and is awaiting authorised payment. I've also implemented the other IPN messages to update the order as it progresses through paypal.

I hope to get at least a BETA version of this out this week. If you fancy testing it out to check that it's addressing the problem you have, then drop me a PM.

Paul

Link to comment
Share on other sites

Unfortunetly after about 8 hours, I've logged back on to the account that I used to make the purchase and the order history still shows the 'you have not placed any orders' message.
I have checked and the money was instantly transferred from one paypal account to my shop paypal account. No pending or echeck messages.
Anything else I can try in the meantime?

Link to comment
Share on other sites

Can you access the following page in your browser?

http://www.example.com/modules/paypal/validation.php 



If so then the last thing to check is whether your hosting company firewall is blocking outgoing connections.

To test, create a file called "paypal_test.php" containing the following:

<?php
/*
 Paypal connection test script for paypal payment module
 Author: P. Campbell
 Version: 1.0 ; August 2008

*/
$fsocket = false;
$curl = false;
$result = false;
$cURL_connect = false;


// Test for curl support on the server
if (function_exists('curl_exec')) {
   $curl = true;
}

// Try a secure fsockopen connection and if not, then the worst case insecure fsockopen
// only use the insecure method if nothing else (secure fsockopen or cURL) works!
// The insecure sock should be removed for production servers.
if ( (PHP_VERSION >= 4.3) && ($fp = fsockopen('ssl://www.paypal.com', 443, $errno, $errstr, 30)) ) {
   $fsocket = true;
} elseif ( ($fp = fsockopen('http://www.paypal.com', 80, $errno, $errstr, 30)) && (!$curl) ) {
   $fsocket = true;
} elseif (!$curl) {
   echo 'Can\'t make external connections to paypal using any method.';
}

// ***************To test curl when fsockopen works, uncomment the two lines below
//$fsocket=false;
//if ($fp) fclose($fp);

if (($curl) AND (!$fsocket)) {
 $ch = curl_init('https://www.paypal.com/cgi-bin/webscr');

 // If the above fails, then try the url with a trailing slash (fixes problems on some servers)
 if (!$ch) $ch = curl_init('https://www.paypal.com/cgi-bin/webscr/');

 // Error checking
 if ($ch) {
   $cURL_connect=true;
   curl_close($ch);
 } else {
   $cURL_connect=false;
   echo 'Failed to connect to paypal';
 }
}

if (($fsocket) || ($cURL_connect)) {
 echo 'Connection to PayPal OK';
} else {
 echo 'Connection to PayPal Failed';
}
?>



Place the resulting file in the root of your server, then go to the following:

http://www.example.com/paypal_test.php



If your server communications with Paypal is working the above should print the message: 'Connection to PayPal OK' otherwise it will display 'Connection to PayPal Failed', or 'Can't make external connections to paypal using any method'.

Let us know how you get on :)

Paul

Link to comment
Share on other sites

Sorry, tried changing the file attributes to validation.php and still got the 500 error message.

- One question:- what is the fault level (644, 755, 775 etc) that the modules/paypal folder should have?
I ask this as I suspect I may have flowed rights down to the file level rather than just the folder itself.

Link to comment
Share on other sites

As per the previous post, the module directories should be 755 (rwxr-xr-x) and all module files should be 644 (rw-r--r--).

If that doesn't work, then there's another (server configuration) reason for it not liking that page, which is strange. Are you using the "friendly urls" option?

Paul

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi folks I have here a big problem.

When I shop in a customer makes an order then everything runs smoothly.

The customer selects PayPal, and everywhere else is done everything right.

Now, the data from customers and also the price and all true.

The Pay with PayPal goes so far.

Only in the last step where the button is "back to the dealership" comes the mistake.

I as a customer come directly into the history.php and the appointment comes a "payment error"

I've tried different now and no result found the scripts of "http://www.ecartservice.net" resolve the problem can not!

Now the test script brings the message that it was able to successfully connect.

Please team of PS if you already have a new module, then send it by mail through because the store is to go online and otherwise I would like to test you need to report errors.

Gruss

Chris

Link to comment
Share on other sites

  • 2 months later...

Good thing I bookmark these troubleshooting pages... I got this problem again and was about to start pulling my hair out . Paul's advice is correct, but the Wiki Page still insist While you have your FTP connected to your Web hosting server, make sure the following PrestaShop folders have ‘write’ permissions (also known as “CHMOD 777” – explanation of file permissions here) but do not apply these permissions recursively (to their subfolders): /config, /upload, /download, /tools/smarty/compile. Then make sure the following folders have ‘write’ permissions and apply these permissions recursively (to their subfolders): /img, /mails, /modules, /themes/prestashop/lang, /translations.

This was written on 30 June 2008, and with 1.1 Final out, maybe it's time to correct this, Prestateam, or more people will run into these kind of problems.

Link to comment
Share on other sites

×
×
  • Create New...