Paypal Sandbox connection failed

  • Posts: 2
  • Thank you received: 0
9 years 11 months ago #183573

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : Paypal Sandbox connection failed

Hello,

I know that there are a lot of topics on the forum about this problem but i am really struggling to overcome it.

I used virtuemart on a lot of webstores that i made, but now i wanted to try hikashop for the first time on a new webstore i am doing, to see if it is worth buying the business edition. Everything was going ok until i got to the paypal module.

I am using the Paypal sandbox to test the hikashop paypal module. Everything is working great but after paying on the paypal gateway the order don't update to confirmed status and i receive the following emails from hikashop:

A Paypal notification was refused because the connection to the confirmation server failed.


From the documentation and the orther posts on the forum with similar issues i contacted the hosting company to see if Openssl was compiled and that they allowed the use of the fsockopen funcion on PHP. They said that openssl was installed and the use of fsock function to make remote connection was allowed.

To test if they said was true, i created the following PHP script to test the fsockopen funcion:
<?php
$host = "www.paypal.com";
$fp = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
if ($fp) {
	print "GOOD";
} else {
	print "BAD";
} ?>

After running this code from the server i ger the GOOD output meaning that the fsockopen function is working great.

Inspecting the hikashop paypal module source code i don't understand why the following piece of code is returning always a null value:
$fp = fsockopen($url['host_socket'], $url['port'], $errno, $errstr, 30);
		if(!$fp) ....

I activated the hikashop paypal module debug but the log is empty, so i checked the apache access log and i saw the following entries:

173.0.82.126 - - [15/Dec/2014:21:21:11 +0000] "POST /shop/index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=paypal&tmpl=component&lang=en&Itemid=990 HTTP/1.0" 404 - "-" "PayPal IPN ( www.paypal.com/ipn )"

But i am in doubt that the 404 access code is related to the above problem, because i removed the order from the hikashop after it failed with paypal.

Also on the paypal sandbox i can see that the payment was transferred from the buyer to the shop account successfully.

Any help would be appreciated.

Thanks,
Bruno

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
9 years 11 months ago #183593

Hi,

That's strange because your message indicates two different reasons for your problem:
1. if the fsockopen of hikashop returns null and if yours work, the only different is with the $url
which comes from the "URL" parameter that you set in the options of your paypal payment method options screen. So make sure that the URL there is correct, without spaces before or after, etc.

2. The 404 error indicates that something on your website blocked the notification before it reached HikaShop (so I don't know how you were able to get the email and look at the result of the fsockopen since it first requires that the notification reaches hikashop). That's often the case if you set the menu item with the id 990 access to something different than public, or if that menu item is not a hikashop type menu item. In that case, a simple solution is to create a menu item of the type hikashop checkout (if not already there) via the joomla menu manager and set the "force menu on checkout" option of the HikaShop configuration to that menu item so that the Joomla SEF system doesn't mess with the notification.

The following user(s) said Thank You: boliveira

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

  • Posts: 2
  • Thank you received: 0
9 years 11 months ago #183675

Hi Nicolas,

Thank you so much for your support, finally it is working great!

What you referred on point 2 solved the problem. I created an hikashop menu for the checkout and on the hikashop configuration i set the "force menu on checkout" with the menu that i created.

Thanks for the help again,
Bruno

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

Time to create page: 0.060 seconds
Powered by Kunena Forum