error getting while hitting any api
I have tested code but i am not able to find out what the exact error is.please provide solution.
Type: Exception Message: Error getting valid response from api. Check log file for error details Filename: /var/www/html/application/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php Line Number: 126
@monukanyal, I have the same issue.
I was able to debug and looks like we have "CURL ERROR: SSL connect error" and in my case its because of TLS 1.0 that authorize.net disabled starting 5/1/2017 (see #127). Trying to figure out how to fix it
Update try to run
yum update nss curl openssl
And then don't forget to restart apache/php process
Error getting valid response from api. Check log file for error details
The same error, I checked TLS is 1.2. Tried on different servers (local and production). API worked during few monthes (in sanbox mode). Yesterday, 22.03.2018 it stopped work. No changes were done in API. Please, help.
I am having the same issue. It was working fine a week ago. and I have not done any changes in the code and it is not working now. What can be the issue? Here is what my page displays in response: Fatal error: Uncaught exception 'Exception' with message 'Error getting valid response from api. Check log file for error details' in C:\xampp\htdocs\authorize\lib\net\authorize\api\controller\base\ApiOperationBase.php:126 Stack trace: #0 C:\xampp\htdocs\authorize\lib\net\authorize\api\controller\base\ApiOperationBase.php(104): net\authorize\api\controller\base\ApiOperationBase->execute('https://apitest...') #1 C:\xampp\htdocs\authorize\index.php(82): net\authorize\api\controller\base\ApiOperationBase->executeWithApiResponse('https://apitest...') #2 C:\xampp\htdocs\authorize\index.php(123): chargeCreditCard(150) #3 {main} thrown in C:\xampp\htdocs\authorize\lib\net\authorize\api\controller\base\ApiOperationBase.php on line 126
I'm having the same issue this morning. The sandbox code was working fine a couple days ago.
If I refresh the page, one out of ten or fifteen times it will work, the rest result in the same error above.
This is probably related to https://github.com/AuthorizeNet/sdk-php/issues/298 but leaving my comment here.
I am also facing the same problem. Fatal error: Uncaught exception 'Exception' with message 'Error getting valid response from api. Check log file for error details' in ....
please help :-(
The original issue probably isn't the issue in #298, but everything recent going to the sandbox almost certainly is. You can see the sandbox' SSL was reissued on the 20th:

Here's my post on the OF: https://community.developer.authorize.net/t5/Integration-and-Testing/SSL-Certificate-Problem-Another-Authorize-net-Outage/m-p/62289/highlight/true#M36644
You can get around it by commenting a line or downloading another pem to use.
I put in a PR (https://github.com/AuthorizeNet/sdk-php/pull/299) to mitigate this, but my tests fail because the tests still can't connect to the API using the bad pem 🤣
As someone else suggested, you can also comment out line 80 of HttpClient.php. This line is telling curl to use that specific pem's CA to validate the host in the SSL request. This is not as insecure as someone stated because when you remove this setting CURL can default to it's own CA bundle, the system store, or other trusted stores depending on how it's built. It is still less secure, but it's not completely disregarding SSL validation. Eitherway on my windows test machine commenting it out doesn't work anyway. It Works for me. Of course it's absolutely not the best way, but as temporary solution it works.
@cwilsontv, @zhovtyj, @donnorman, @vikaschauhan1, @aleemkhan The certificate issue has been fixed in v1.9.6 release of the SDK.
The original issue was related to TLS 1.2 . Now that both issues are resolved, closing this issue.
@zhovtyj it worked