Playing
01. Introduction and demo

Transcript

00:00
So let's go ahead and build a pay once for access app. What do we mean by this?
00:05
Well, let's head over to the members area of this app. You can see we're redirected straight back to dashboard. Basically, what we're going to do is implement a protected or multiple protected areas of an app where you have to pay once to get access to them areas.
00:22
So if you're looking to integrate this functionality into your app, this is going to guide you through everything that you need to do to get this working. Or if you just need a primer on how to use the Stripe Payment Intents API, then this is also going to guide you through that.
00:39
So we're, of course, using Stripe for the payments here, and we're going to be focusing on using the Payment Intents API for this. OK, so let's look at a full demo. We've already seen over here this members area, which has middleware to protect us.
00:54
If we head over to the database here, you can see that we have a column that just says member. At the moment, that's false. That middleware is protecting this particular route here. Now, we have this slash payments page here.
01:05
So if we just head over to this, you can, of course, name this anything. But this is going to be where we set up the Stripe Payment Intent API. We request a card. We go ahead and enter it.
01:16
And of course, as long as the payment is successful, we grant access to this app. And we do that via a webhook to then look up the payment intent and check that the payment was successful. And of course, we'll cover all of that through the course.
01:31
So let's go ahead and just enter in a fake card number in here and an expiry as well. So 24, 1, 2, 3, and just do 1, 2, 3, 4, 5. Let's go ahead and hit Make Payment. If this fails for any reason, we'll just see an error here.
01:45
But now we're redirected back over to the dashboard. And of course, you could flash a message here if you wanted to. But we can now go over to the Members area. And you can see we do have access.
01:53
So if we head back over to the database, you can see Member has been set to True. Now, all of this seems relatively straightforward. On the surface, it looks that way. But behind the scenes, the Payment Intent API within Stripe
02:06
can take a little bit of time to wrap your head around. And that's exactly why we're covering this in this course. So now that we've seen how this works, let's go ahead in the next episode, get a fresh Laravel app set up and ready to start building this in.
15 episodes1 hr 11 mins

Overview

Let's do payments right with the Stripe Payment Intent API, and build an app where customers can pay to access a members area.

We'll cover setting up a Payment Intent, process payments correctly with authorization, handle declines, and securely respond to a Stripe webhook to upgrade a member.

This course is for you if:

  • You want to process payments to upgrade customers for access
  • You need to learn how to properly process one-off payments with Stripe
  • You need a refresher on the Payment Intents API
Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Episode discussion

No comments, yet. Be the first!