Closed. This question is
opinion-based. It is not currently accepting answers.
Answer
Solution:
It is ultimately up to you what you prefer, however I highly recommend using the stripe-php library. It is at its core just an abstraction of cURL calls wrapped up with some quality of life functionality for you in an easy to use manner.
It also provides many features that you wouldn't get from cURL. For instance automatic retries, idempotency keys and robust error handling. All these things you get for free with stripe-php that you'd have to implement yourself if you roll your own cURL implementation.
Even if you're struggling with the stripe-php library, I would recommend sticking with it as you'll likely run into many more problems with a homegrown cURL solution as your integration gets more complicated.
Answer
Solution:
This is their library and how to install it https://stripe.com/docs/libraries
Terminal:
#Install the PHP library via Composer
composer require stripe/stripe-php
Then there are some usage examples here
https://cartalyst.com/manual/stripe/2.0
You shouldn't even be able to go around the API.
Don't invent your own curl functions and use the library.
Source