We're getting a communication error response when submitting card details using the SagePay Direct payment method:

Error: Sorry, there was an unexpected error communicating with the payment gateway.

Nothing has changed in respects to the server / EE code and transactions have been working fine since upgrading to 2.10 recently. Logging into SagePay shows that since today transactions aren't even being logged as failed at sagepay; ie they're failing before they even reach sagepay.

I took the measure of upgrading to Store: 2.20 and the error persists.

Any pointers?

After uncommenting the exception, the error displayed is:

Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message '[curl] 6: Couldn't resolve host 'live.sagepay.com' [url] https://live.sagepay.com/gateway/service/vspdirect-register.vsp' in /var/www/vhosts/domain.com/httpdocs/system/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php:338 Stack trace: #0 /var/www/vhosts/domain.com/httpdocs/system/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(279): Guzzle\Http\Curl\CurlMulti->isCurlException(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #1 /var/www/vhosts/domain.com/httpdocs/system/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php(244): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Curl\CurlHandle), Array) #2 /var/www/vhosts/domain.com/httpdocs/system/exp in /var/www/vhosts/domain.com/httpdocs/system/expressionengine/third_party/store/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php on line 338

So looks like the server can't communicated with sagepay... so, I've done a quick test and it seems cURL is up the swanny on the server. Thanks for your help as always!

1 Answer 1


Sorry, there was an unexpected error communicating with the payment gateway.

This generally means that there was a communication problem talking to the gateway (i.e. your server is blocking the request, or the authentication details are incorrect). We're working on better logging for these errors, but in the meantime the full error isn't displayed because it could pose a security risk to your site (or reveal your gateway authentication details).

To diagnose it, open third_party/store/src/Store/Service/PaymentsService.php and around line 328, you will see this code

} catch (\Exception $e) {
    $transaction->status = Transaction::FAILED;
    $transaction->message = lang('store.payment.communication_error');

If you comment out those 4 lines, you should see the underlying exception displayed, which may make it clear what is going wrong. Can you either update your original question with the exception details, or send us an email so we can add a check for this in future?

  • Was this ever resolved as we have similar errors with Expresso store and paypal express.
    – paulcripps
    Commented Jun 27, 2016 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.