Saturday, September 25, 2010

PrestaShop Tips - Payment recieved via Paypal, but order not showing up

The Problem:
I have a PrestaShop 1.3 website, it was working fine, but suddenly the following problem appeared.

1. User can place an order without any error.
2. The payment was also processed without any problem. I was using Paypal Module v1.6
3. But there is no order record was created in my database

There are multiple scenarios could cause the same problem, here I introduce a way yo help you identify your problem.

Important
PayPal has changed their “notify_url” behavior sometime recently. You must enable IPN at your Paypal account to get your Paypal module at PrestaShop work. If you disable IPN in your PayPal account no IPNs will be sent regardless of whether you pass a notify_url value.


How to identify your problem
Before I fixed the problem, first I tried to understand in what timing the order record is created. The order record is not created until the payment process is finished at Paypal and Paypal server send back payment information to following page:

http://YouPrestaShopSite/modules/paypal/validation.php

Based on the payment status from Paypal, the order record will be created and linked to the cart record. In order to identity the problem, you can add following line on the top of above file (at position of line 4) and then create an test order.


mail("YouEmailAddress","Response From Paypal","Data from Paypal".print_r($_POST,true));


Result
1. If you can receive email and response data from Paypal, the problem is reside your website.
2. If you do not receive email, it means Paypal server is not able to reach your server.

In my case, the problem is scenario 2. I do not receive the email.
I did following two things fixed my problem.
1. At Paypal side, I changed my IPN setting
Profile | Selling Preferences | Instant Payment Notification Preferences
2. At PrestaShop back office, I uninstall the Paypal module v1.6 and re-install, re-config the module
Modules | Paypal Module v1.6

More information
See my another post on how to add "Create Order" from cart to recover your missed orders. http://alvinjiang.blogspot.com/2010/09/prestashop-tips-how-to-create-order.html

The post below has more information which help me a lot fix my problem.
http://www.presto-changeo.com/content/10-fixing-paypal-problems

1 comment:

Piotr said...

Thanks for this explanation.