Heartland Secure Submit - ApiConnectionException

If during checkout you are getting the error "Unable to process the payment transaction", and if you find "ApiConnectionException: Unable to process the payment transaction." in var/log assuming you have Debug = Yes, try adding:

curl_setopt($soap_do, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);

to lib/SecureSubmit/services/HpsService.php around line 70 such that:

$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, $this->_gatewayUrlForKey($this->config->secretApiKey));
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true);
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml->saveXML());
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);

if($this->config->useProxy){
curl_setopt($soap_do, CURLOPT_PROXY, $this->config->proxyOptions['proxy_host']);
curl_setopt($soap_do, CURLOPT_PROXYPORT, $this->config->proxyOptions['proxy_port']);
}

becomes:

$soap_do = curl_init();
curl_setopt($soap_do, CURLOPT_URL, $this->_gatewayUrlForKey($this->config->secretApiKey));
curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_TIMEOUT, 10);
curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($soap_do, CURLOPT_POST, true);
curl_setopt($soap_do, CURLOPT_POSTFIELDS, $xml->saveXML());
curl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);
curl_setopt($soap_do, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS); // CUSTOM

if($this->config->useProxy){
curl_setopt($soap_do, CURLOPT_PROXY, $this->config->proxyOptions['proxy_host']);
curl_setopt($soap_do, CURLOPT_PROXYPORT, $this->config->proxyOptions['proxy_port']);
}

Hope this helps!

Leave a Reply

About NVNCBL

Quick Support