Paypal does not consistently return confirmed

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
10 years 11 months ago #135525

-- url of the page with the problem -- : valorapps.com
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 2.5.16
-- PHP version -- : 5.3.27

Hi. I hope someone can help me. I have already read the following: www.hikashop.com/forum/payment-methods/8...eturn-confirmed.html and www.hikashop.com/support/documentation/i...or.html#notification

However, my problem is similar but not entirely the same. I have been using hikashop starter for almost 2 years. I just recently upgraded to Essential. I have had this problem for over a year. The problem is that half the time when a customer purchases a product with Paypal, they have no problems and the order gets confirmed and they are able to download their product, but the other half of the times, the order does not confirm and I will have to manually confirm the order. It didn't bother me much at first, since it happened infrequently, but over the past few months, orders are increasingly not being confirmed automatically. For example, only 2 out of the last 12 orders made in the last few days were confirmed automatically.

I am really confused since most persons who have mentioned this problem on the forum don't have it happening sometimes and not happening at other times.

I don't think it is an aces issue, since the last order that was made today was not confirmed automatically and when I checked the logs, it said:

68.42.140.132 - - [06/Dec/2013:14:23:08 -0800] "POST /index.php?option=com%5fhikashop&ctrl=checkout&task=after%5fend&order_id=2121 HTTP/1.1" 200 14685 "https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=Tpmc0TCrbO6nieyMdg-yYT4DbxWm_RRgpeMiHu-8ISyfSCXgET4Irvc1hme&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b081986471f9b93cfa01e00b63629be0164db1" "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36" 
173.0.81.1 - - [06/Dec/2013:14:23:14 -0800] "POST /index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=paypal&tmpl=component&lang=en HTTP/1.0" 200 5273 "-" "PayPal IPN ( https://www.paypal.com/ipn )" 

Here is a screenshot of my settings:



Could you please help me? Please guide me on what to do.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 11 months ago #135585

That was a good idea to check your logs.
So as you can see on the second line that you copy/pasted, the notification of the payment is received by your server and the server sends back a 200 HTTP status to PayPal which means "success".
So that's good as it eliminates a lot of possibilities already.
Next step is to turn on the debug option of your PayPal payment method and make sure that the payment log file that you can open in the configuration is writable. Then, next time you have such order, confirm in your server log that you got the payment notification and look in the payment log file where the PayPal payment plugin should write plenty of debug information regarding what happened with the payment notification and that will help us understand what's going on.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
10 years 11 months ago #135660

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:
  1. Paypal setting the payment status to "Pending" instead of "Completed"
  2. The Paypal payment plugin just exiting without any other form of notification.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 11 months ago #135672

Hi,

In the configuration of the PayPal payment method in HikaShop, you can configure what you want to do with a pending payment with the "pending status" option. If you set it to "confirmed" the system will validate the order and send the notification emails for pending payments. But if you set it to another status, no notification will be sent to the user. That's the normal behavior.
Regarding the fact that PayPal set the payment status to "pending", you need to see that with PayPal. There is nothing we can do to help you on that. It's probably that PayPal cannot validate the payment immediately and thus it has to wait before doing so.

The following user(s) said Thank You: michaelgilkes

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
  • Hikashop Essential
10 years 11 months ago #135688

Hi Nicolas,

Thanks for your insight and suggestions.

I have decided to create a new order status called "pending", which should cause the Paypal payment plugin to send an email notifying the change of status from "created" to "pending". Then I created a view override for "after_end" that gives a brief explanation to the customer of what to do when their order is confirmed vs pending.

I hope this works better. It should. So, thanks a lot!

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum