helmutschneider / swish-php

PHP-wrapper for the Swish merchant api
MIT License
40 stars 19 forks source link

Getting cURL error 7 #2

Closed ajaykrshukla closed 5 years ago

ajaykrshukla commented 7 years ago

Hello,

I am getting this errow when trying to use the payment request:

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ConnectException' with message 'cURL error 7: (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in /home/www/youroffice.in/swish-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186 Stack trace: #0 /home/www/youroffice.in/swish-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(150): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 /home/www/youroffice.in/swish-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(103): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 /home/www/youroffice.in/swish-php/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 /home/www/youroffice.in/swish-php/vendor/guzzlehttp/guzzle/src/Prep in /home/www/youroffice.in/swish-php/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 186

So please suggest what is going wrong with my code/server.

Thanks

helmutschneider commented 7 years ago

Looks like a very generic connection error. Make sure you use a correct URL for $baseUrl when instantiating the class, eg. Client::SWISH_PRODUCTION_URL or Client::SWISH_TEST_URL.

You seem to have curl installed so your php installation should be fine.