laravel-paystack icon indicating copy to clipboard operation
laravel-paystack copied to clipboard

cURL error 35: SSL connect error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Open abiodunsulaiman694 opened this issue 8 years ago • 16 comments

I've searched everywhere for this before opening this issue, and the Paystack team recommended I put this here, as they have not encountered this before. I've used this quite a few times with Paystack and it works. However, now I have this error that I think you can help with: GuzzleHttp \ Exception \ ConnectException cURL error 35: SSL connect error (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) I've tried everything, confirmed my public and private keys. My internet connection is quite good as my development environment is in the cloud(CodeAnywhere). I'm not working on XAMPP/WAMP. Also, I build the app on CodeAnywhere, using Apache/PHP/CentOS. Please, guide in the solution image

Thank you.

abiodunsulaiman694 avatar Oct 29 '17 16:10 abiodunsulaiman694

This error is mostly caused as a result of communication glitch between your web browser and the api. Make sure your computer is connected to the internet, or try a different browser. You can also try clearing cache and cookies.

codenaz avatar Oct 29 '17 17:10 codenaz

Also check your php.ini (php config file) and make sure the curl option is enabled

codenaz avatar Oct 29 '17 17:10 codenaz

Thanks, @princenazi My internet connection is quite good, as I can't even edit a line of code without it. The environment is cloud-based. Also, I've switched browser(Google Chrome to Microsoft Edge), like you suggested, and still the same error. For the php.ini, I ran this command from my terminal(unix): php -i | grep curl And I got this in return: etc/php.d/curl.ini, curl So, I think curl is enabled. Yet, the same problem still, on refresh. Thanks for your assistance.

abiodunsulaiman694 avatar Oct 29 '17 17:10 abiodunsulaiman694

I have the same error too. Please kindly review

dfemo avatar Mar 15 '18 07:03 dfemo

Hello guys, this error usually means that the cURL version on your server is outdated. Reaching out to your hosts and asking them to update to the latest version solves this problem. The latest version is 7.59.0

steveamaza avatar Mar 15 '18 12:03 steveamaza

If you can access your php.ini file. Read up this link https://stackoverflow.com/questions/42094842/curl-error-60-ssl-certificate-in-laravel-5-4 I think it's the solution to your problem.

essangjesse avatar Jul 28 '18 06:07 essangjesse

Make sure you have config/paystack.php

Make sure you publish your configuration

ekpono avatar Apr 03 '19 14:04 ekpono

Hello guys..is there a solution to this yet? I am experiencing the same issue.

banklan avatar Oct 17 '19 17:10 banklan

You'll need to download a custom cacert.pem and point to it in your php.ini file. Don't forget to restart your server after words for the changes to take effect.

Here's a link:

https://stackoverflow.com/questions/42094842/curl-error-60-ssl-certificate-in-laravel-5-4

On Thu, 17 Oct 2019, 18:08 banklan, [email protected] wrote:

Hello guys..is there a solution to this yet? I am experiencing the same issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/unicodeveloper/laravel-paystack/issues/27?email_source=notifications&email_token=AJEB4YLUEJXUJUARCDGLVSLQPCL2RA5CNFSM4EBJRQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBQ2ZFQ#issuecomment-543272086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEB4YK4IIU3L7WQKN2RMNTQPCL2RANCNFSM4EBJRQ4Q .

essangjesse avatar Oct 17 '19 17:10 essangjesse

Thanks @essangjesse . I saw that solution and tried before asking here, it didn't work for me. However, while trying to integrate paystack into my application, i ran into some problems as the paystack.php file wasn't automatically created in my config folder. I had to create it manually. Could this be the cause of this issue?

banklan avatar Oct 17 '19 17:10 banklan

Thanks, @princenazi My internet connection is quite good, as I can't even edit a line of code without it. The environment is cloud-based. Also, I've switched browser(Google Chrome to Microsoft Edge), like you suggested, and still the same error. For the php.ini, I ran this command from my terminal(unix): php -i | grep curl And I got this in return: etc/php.d/curl.ini, curl So, I think curl is enabled. Yet, the same problem still, on refresh. Thanks for your assistance.

Did u get this resolved eventually?

banklan avatar Oct 17 '19 21:10 banklan

You could try Paystack Inline as opposed to using the Laravel-Paystack package. I think it gives better user experience even.

On Thu, 17 Oct 2019, 18:35 banklan, [email protected] wrote:

Thanks @essangjesse https://github.com/essangjesse . I saw that solution and tried before asking here, it didn't work for me. However, while trying to integrate paystack into my application, i ran into some problems as the paystack.php file wasn't automatically created in my config folder. I had to create it manually. Could this be the cause of this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/unicodeveloper/laravel-paystack/issues/27?email_source=notifications&email_token=AJEB4YKTIIGXRQSNEZX5IXTQPCO6HA5CNFSM4EBJRQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBQ5JMI#issuecomment-543282353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEB4YNQMVU7ILHVOGFPP5DQPCO6HANCNFSM4EBJRQ4Q .

essangjesse avatar Oct 17 '19 21:10 essangjesse

Thanks @essanglesse.Can u pls recommend a resource or guide me on how to integrate the paystack inline?

banklan avatar Oct 17 '19 21:10 banklan

Here you go:

https://developers.paystack.co/docs/paystack-inline

It will also be helpful to go through the API reference:

https://developers.paystack.co/v2.0/reference#initialize-a-transaction

STUFF YOU SHOULD KNOW:

  1. I don't know what you're using on the frontend but I strongly suggest VueJS as it goes very well with Laravel. If you're using JQuery (you're giving yourself unnecessary headache) then there's some steps you need to take to ensure that malicious users don't tamper with your payment scripts (let me know if I need to elaborate on this).

  2. Here's how you should use Paystack to process payments:

Step 1: Hit the INITIALIZE TRANSACTION endpoint with all the required params and headers. It will return a "transaction reference" as part of a JSON response object.

Protip: There's an optional parameter you can set in the request object that is sent to the INITIALIZE TRANSACTION endpoint called "reusable". You should wrap that inside "metadata" (You'll get this more clearly when you study the API reference). Set reusable to true if you would like Paystack to remember the card details that were used to make this transaction.

Step 2: Grab the transaction reference and pass it to the VERIFY TRANSACTION endpoint. Once the transaction has been verified a lot of useful info is sent back in a JSON response. If you had set reusable to true, then you should also get the card details which you can store in your db along with the "authorization code". The card details in themselves cannot be used to conduct a transaction but you can use them to enhance user experience by displaying different user cards. What does the magic is the authorization code. So assuming you've stored all that...

Pro tip: Probably a good idea to ask the user if they would like to have your app "remember" their card details before you go ahead and use this. (You can adapt this process to create a kind of ADD CARDS functionality on your app but that is another story).

Step 3: Next time you want to receive payments from your users don't just launch the Paystack modal again and hit the INITIALIZE TRANSACTION endpoint. Ask the user if he would like to use one of the cards he has stored. Every card is tied to an authorization code. So you can use that with the CHARGE AUTHORIZATION endpoint to get Paystack to use the details from the first transaction. This way the user doesn't have to re-enter his card details on EVERY transaction.

In conclusion, I don't know if you already know all of this, it's just that Paystack has really awesome APIs like User verification APIs, Subaccount management APIs and so much more. That's why I asked you to go through the API reference. The problem is we don't have a strong culture of knowledge sharing in Nigeria so there's very little information out there asides what you find in the Paystack official documentation. If you would like me to write say a Medium article on how to work with the various Paystack APIs please let me know.

Hope this helps, cheers!

On Thu, 17 Oct 2019, 22:58 banklan, [email protected] wrote:

Thanks @essanglesse.Can u pls recommend a resource or guide me on how to integrate the paystack inline?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/unicodeveloper/laravel-paystack/issues/27?email_source=notifications&email_token=AJEB4YPAAPXTTIBFM5FEDI3QPDNXVA5CNFSM4EBJRQ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRU4CQ#issuecomment-543378954, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJEB4YNJ25CGRVV43J44GDDQPDNXVANCNFSM4EBJRQ4Q .

essangjesse avatar Oct 18 '19 03:10 essangjesse

Thanks so much for the detailed explanation.i will try to adopt this.

banklan avatar Oct 19 '19 07:10 banklan

The error is, the command to publish the config php artisan vendor:publish --provider="Unicodeveloper\Paystack\PaystackServiceProvider" files didn't public anything.

and setBaseUrl has been set to send a httpRequest to https://api.paystack.co/

public function setBaseUrl()
    {
        $this->baseUrl = Config::get('services.paystack.url');
    }

So, if you want to solve this error, go straight to verify that config/paystack.php file exist.

If it does, make sure you set the paystackUrl to https://api.paystack.co/

Peace out.!

mrbarnk avatar Nov 23 '19 14:11 mrbarnk