Video Version of the Lesson
[Only for premium members]
[Only for premium members]
[Only for premium members]
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.
By the end of this lesson, you will understand how to:
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...