Saturday, December 11, 2010

PrestaShop Tips - Cart is not cleared after payment - how PrestaShop Paypal module process your order

Most PrestaShop store owners and customers are confused by following symptom.


When customer finished payment and is redirected back to PrestaShop store, but customer's cart is still there, not cleared. This issue happens when customer finished payment and click "return to your merchant" store very quickly.

Why would this happen

In order to understand how this would happen, you need to understand how the order is process between Paypal payment server and PrestaShop store.
Here is basic process flows:

Process from customer view.

1.Store redirect customer to Paypal server
(A URL return to PreestaShop store is included in the data posted to Paypal)
2.Ccustomer input required information and perform the payment and finished payment.
3 Paypal show the return URL (which is sent at step 1).
4.Customer click the return link comes back to PrestaShop
5.PrestaShop display payment result.

Process from Paypal server and PrestaShop view

After above step2, following process started concurrently.
3' Paypal server will validate your payment and send back payment process to PrestaShop store.
4' PrestaShop received validation information about the payment and create order and set order status.
5' If payment status "Payment Accepted", then shopping cart will be cleared.

Please note, above two process is executed concurrently and independently. But both process finishes in a few seconds.

So if Paypal server send back confirmation very quickly or customer waited for a few seconds( reading payment result and so on) then click "return to merchant". There is not problem at all.

But sometime, customer comes back to PrestaShop a little earlier than Paypal server send back "Confirmation" to PrestaShop, then customer "shopping cart not cleared" will occur.

At this point, you should be able to understand how "shopping cart not cleared" happened.

PrestaShop Paypal Express Checkout module


Honestly, I don't think there is a perfect solution. Here is just a suggestion.

At the returning page of PrestaShop store /modules/paypal/confirmation.php/tpl, check if cart is not cleared, then display some message customer about, let customer refresh page after a few seconds.

It seem that Paypal has made some changes on the payment process, after customer finish payment, when customer click "Return to merchant" link, it will pop up a confirm message. I guess this is trying to make some time for Paypal server to have time send "confirmation" to PrestaShop so that avoid above issue.


Agile Paypal - A PrestaShop Paypal Express Checkout module, is very stable, most issues with standard Paypal module will not appear on that module, plus it has many more new features, such as Express Checkout, create state automatically, get to payment in just 3 clicks. See more detail, please visit here

No comments: