Jump to content



Photo

PayPal try to access pro_hosted_ipn.php and get Error 500

paypal pro_hosted error 500

  • Please log in to reply
6 replies to this topic

#1   sara75

sara75
  • Members
  • 10 posts
  • Real Name:Sara
  • Gender:Female
  • Location:Italy

Posted 27 January 2017 - 13:38

Hi all, 

Yesterday I changed my server and everything works fine, customers are buying and also payment with paypal works fine, but on my error log I find:

[Fri Jan 27 14:14:12.636776 2017] [fcgid:warn] [pid 9557:tid 140124086036224] [client 173.0.81.1:36292] mod_fcgid: stderr: PHP Fatal error:  Call to a member function getApiResult() on null in /...../ext/modules/payment/paypal/pro_hosted_ipn.php on line 28

and in access_log 

173.0.81.1 - - [27/Jan/2017:14:14:12 +0100] "POST /ext/modules/payment/paypal/pro_hosted_ipn.php HTTP/1.0" 500 423 "-" "PayPal IPN ( https://www.paypal.com/ipn )"

Someone can help me finding what's wrong?



#2   MrPhil

MrPhil
  • Members
  • 7,016 posts
  • Real Name:Phil
  • Gender:Male

Posted 27 January 2017 - 18:30

Did "changing your server" involve moving your code to a higher PHP version? What osC version are you using? Possibly the add-on you're using for this PayPal service needs to be updated for your PHP version.



#3   sara75

sara75
  • Members
  • 10 posts
  • Real Name:Sara
  • Gender:Female
  • Location:Italy

Posted 27 January 2017 - 20:17

Yes, I presume it's a php version problem. 

The error is PHP Fatal error: Call to a member function getApiResult() on null in /...../ext/modules/payment/paypal/pro_hosted_ipn.php on line 28

Line 28 is    

 $result = $paypal_pro_hs->_app->getApiResult('APP', 'GetTransactionDetails', array('TRANSACTIONID' => $HTTP_POST_VARS['txn_id']), (OSCOM_APP_PAYPAL_HS_STATUS == '1') ? 'live' : 'sandbox', true);

Old server Php 5.2.11  - MySQL 5.0.88 

New server is Php 5.6.29 - MariaDB 10.0.28

 

PayPal is trying to update the orders with new information about refound etc. 



#4   MrPhil

MrPhil
  • Members
  • 7,016 posts
  • Real Name:Phil
  • Gender:Male

Posted 28 January 2017 - 01:00

What. Is. Your. osC. Version? If you have an old one, it's not worth going through the effort to make it PHP 5.6 or 7 compatible. Only the newest one (2.3.4BS Edge) is worth the effort (it's already 5.6 compatible). There are instructions on this forum.

 

The actual error is going to be upstream from line 28. Somewhere $paypal_pro_hs->_app should get created, but in your case something broke and nothing was created. Going from PHP 5.2 to 5.6 is a Great Leap Forward, and millions will die. It's possible to fix up your existing code, if you're an experienced programmer, but it will usually be quicker just to install 2.3.4BS and migrate your data over. Plus, you'll have the latest and greatest code (although it will need updating for PHP 7 when that happens) and responsive interface.



#5   sara75

sara75
  • Members
  • 10 posts
  • Real Name:Sara
  • Gender:Female
  • Location:Italy

Posted 28 January 2017 - 14:55

@MrPhil I already have a 2.3.4BS   :thumbsup: but it's hardly modded  :-

I compared and updated all files of PayPal App without result  <_<

It's quite hard to debug as the show is live and working hard (fortunately  B)



#6   MrPhil

MrPhil
  • Members
  • 7,016 posts
  • Real Name:Phil
  • Gender:Male

Posted 28 January 2017 - 15:07

Is this PayPal an add-on, or built in to 2.3.4BS? If it's an add-on, it's possible that its code needs updating to work with PHP 5.6. Inquire on its support thread. If it's built in to osC 2.3.4BS, it sounds like either a bug that Gary should know about, or a misconfiguration somewhere. I've never used this code, so I can't offer any help in debugging it.



#7   sara75

sara75
  • Members
  • 10 posts
  • Real Name:Sara
  • Gender:Female
  • Location:Italy

Posted 28 January 2017 - 15:15

I used this app https://www.oscommer...om/_&PayPalApp¬†

I re-check if something went wrong on update.