When integrating 3rd-party APIs, you will be lucky if they have a specific PHP/Laravel package. In this lesson, I will show you an example of exactly that.
We will try to integrate Stripe payments with Laravel by building a water park ticket purchasing page.

We'll explore both approaches: using Laravel's HTTP Client directly with Stripe's API and using their official PHP package.
Let me be honest right away: an official package is almost always a better choice than manually using APIs. In this lesson, I will try to demonstrate why.
What You'll Learn
By the end of this lesson, you will understand how to:
- Compare HTTP Client approach vs official PHP packages
- Handle Bearer token authentication in API headers
- Manage dual API keys (public and private) for payment systems
- Implement proper exception handling for payment APIs
Structure of Stripe Payment Intent API
Stripe's Payment Intent API is the modern way to handle payments. Here's what a typical request looks like:

As a result, we should get an object containing the client_secret, which we need to put inside the form for further submission.
Again, we can call this API directly with...
I had the form url encoding issue before as well with other APIs. Fortunately, the Http facade has a built-in solution.
Try adding ->asForm()
i.e.
Thanks, didn't know that one! Will definitely try in the future.