CURL ERROR: SSL connect error
I have verified my sandbox credentials and I have also used API live console to successfully execute an Auth only test transaction using https://developer.authorize.net/api/reference/index.html#payment-transactions-authorize-a-credit-card
However, when I use the php sample code (https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/authorize-credit-card.php) with my API Login ID and transaction key hard coded into the sample, I'm only ever getting "No response returned"
The endpoint specified by \net\authorize\api\constants\ANetEnvironment::SANDBOX is https://apitest.authorize.net
Any ideas about what's going wrong?
I switched to using the "hello world" test script ( following these instructions: https://developer.authorize.net/hello_world/ ) and found that the same problem was occurring. In "phplog" file I found this error recorded: [_sendRequest] (****/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 107) - CURL ERROR: SSL connect error
I inserted this code below line 73 in HttpClient.php: curl_setopt($curl_request, CURLOPT_SSLVERSION, 6); That line was necessary to make the test scripts work. See https://www.php.net/manual/en/function.curl-setopt.php about CURLOPT_SSLVERSION for more info.
Additionally, I updated vendor/authorizenet/authorizenet/lib/ssl/cert.pm with the CA root certificate bundle provided here: https://github.com/activemerchant/active_merchant/blob/master/lib/certs/cacert.pem
I believe you just need to update the cert.pem file found in the "ssl" folder. If you google the error, this is a common CURL issue. I believe the one you need is here (yes, I'm aware how the URL looks, I thought the same thing): https://curl.haxx.se/docs/caextract.html