This episode is for members only

Sign up to access "Build a File Marketplace with Laravel" right now.

Get started
Already a member? Sign in to continue
Playing
07. Verifying if payouts are enabled

Episodes

0%
Your progress
  • Total: 3h 32m
  • Played: 0m
  • Remaining: 3h 32m
Join or sign in to track your progress

Transcript

00:00
To verify that payouts are enabled on this page, we need to hit the Stripe API, grab that user, and then check if payouts are enabled. That means that Stripe is happy with all of the details that
00:12
have been given. This could be false. And if it is false, then the users will have to go back through the process,
00:18
fill in any missing information, or whatever else they need to do before being redirected back over here again. So let's go ahead and grab the user, or the account more like, from the API using our Stripe wrapper.
00:32
So accounts, and this time we're going to go ahead and say retrieve. We spell that properly. And we're going to go ahead and pass in the user's Stripe ID
00:41
in here, which we can grab directly from the authenticated user. So that is Stripe account ID. You can pass other options through to here as well.
00:50
So we'll just leave an empty array here, but we're not going to need them for now. Okay, so now what we can do, let's just die dump on this response
00:57
and just see what we get here. So let's just give this page a refresh again. And you can see all of the information with all of the details that I've entered
01:05
through that onboarding process. Now, the one thing we want to make sure is enabled our payouts. You can see we've got this payouts enabled property
01:13
just here, and that is set to true, because I've filled in all of the information required for payouts to be sent to me when I sell products. So now what we need to do is just update the current user
01:24
with that value within that payouts enabled, or Stripe account enabled property that we have on our model. So Stripe account enabled, remember that's what we added just in here,
01:37
and we can go ahead and set that to the value we get back from the API under payouts enabled. You can, of course, call this something different if there's any confusion between the two,
01:48
but that should be enough for this to work nicely. Now, once that happens, we're going to go ahead and redirect the user back to the dashboard.
01:57
And of course, if they haven't been enabled, this is then going to forward them back up to the onboarding flow, where they're going to have to go back through the process.
02:05
So effectively, we're just keeping the user in that onboarding flow until this value is true. So if we head back over and give this page a refresh, that should verify my account.
02:15
Of course, that will have been updated in the database just here to true. And now we can access our dashboard, start creating products, and start selling.
34 episodes3 hrs 32 mins

Overview

Build a marketplace where sellers can list and sell files, while we take a cut of each sale using Stripe Connect.

We'll cover onboarding users with Stripe Connect, creating products and uploading files, payments, and delivering purchased files to your customers.

Here's everything we'll cover:

  • The Stripe Connect onboarding flow
  • Effortlessly creating products (and uploading files) with Livewire forms
  • Subdomains for your user's marketplace
  • Stripe Checkout for a beautiful, secure payment flow
  • Securely delivering files with Signed URLs in Laravel
  • Showing sales stats on a dashboard
Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Episode discussion

No comments, yet. Be the first!