Anvil: Web apps with nothing but Python Transcripts
Chapter: Ecommerce and accepting payments
Lecture: Enabling the Stripe service

Login or purchase this course to watch this video and the rest of the course contents.
0:00 I've built a couple e-commerce websites over the years
0:03 and there are really hard ways to do it
0:04 and quite easy ways to do it.
0:07 A hard way is to work with some ancient e-commerce API
0:11 from some bank's merchant account
0:13 and they're just really crummy, hard to work with.
0:16 And then you've got to handle all the flow, all the forms
0:19 and validation and all of that stuff
0:20 and all the edged cases in your Web app.
0:23 Another way to do it, is to use something modern
0:26 and clean and simple like Stripe.
0:28 And so, what we're going to do
0:29 and what Anvil has done and supported
0:31 is allow us to use something called Stripe Checkout.
0:35 If you've taken any of our paid courses
0:38 you will know what this looks like.
0:39 So come over here, here's are site
0:41 and see that blue button
0:43 buy now, get lifetime access for $49?
0:46 If you click this, what happens is
0:48 something pops up that looks just like that.
0:51 Our Python, here's our icon
0:53 lifetime access to the course $49.
0:56 You enter your email, your credit card number
0:58 expiration and CVV date or CVV code
1:01 and then you hit pay.
1:02 In the bottom left, see how it says powered by Stripe.
1:07 This is what we're going to add to our application.
1:10 We're going to add the ability to have this dialogue come.
1:13 And when we actually hit the pay $49 here
1:16 what's going to happen is, there's going to be some code run
1:19 over on Anvil as a response.
1:20 Now, on this one it actually does a post back
1:23 and loads up a different page.
1:25 The way Anvil's done it
1:26 they've kind of taken care of that.
1:27 So it's even simpler than pure Stripe Checkout
1:31 which is great.