Hi nicolas,
Ok. I turned on debug mode and I purchased one of my own products using Paypal. This revealed the problem for me. In the Paypal payment plugin, paypal.php, on lines 349 and 350, there's a line of code:
if($dbOrder->order_status == $order_status)
return true;
The
$order_status variable depends on finding the word "
Completed" in the
payment_status element in the
$vars array made from the request sent back from Paypal. It seems as though, normally, the value of
$dbOrder->order_status is "
created". If the value of
payment_status from Paypal is
Completed, then
$order_status would be set to 'confirmed', this would make the order automatically confirm as expected. However, if Paypal sent back a value of "Pending" for
payment_status then the value of
$order_status would be set to 'created'. I researched Paypal's site and they said that when
payment_status is set to "
Pending", you can check the value for
pending_reason and in the case of my test order, it was set to "
paymentreview".
So, it seems as though this issue related to:
- Paypal setting the payment status to "Pending" instead of "Completed"
- The Paypal payment plugin just exiting without any other form of notification.