Really nice job. This is how a tutorial should be done. Complete, succinct, well documented in the description, source control example. Timeline. A fine job. I doubt I'll need to watch an hour long plus video to get this working now. Bonus points for typing skills. Finally I'm not rolling my eyes at someone attempting to type something rather pathetically, then debugging their broken code on the video. Subscribed.
Good afternoon, can you tell me if it is possible to run stripe listen --forward-to localhost:4242/webhook in Docker so that it is enabled all the time?
you can make the line_items array dynamic. Create a model that will hold the price, and then you can reference the price_id in the line items: 'line_items': [ { 'price': price.price_id, 'quantity': 1, }, ],
you probably figured already but in the tutorial the product info was hard-coded in the stripe request. Just use variables and assign the values when the stripe check-out function is called to make it dynamic add a for loop to include every product in the shopping cart and that's pretty much it. EDIT: Ups my bad, they use an environment variable for the price... there's probably still a way of creating a form inside the shopping cart view and when you buy all the products information is submitted and you could still use the solution I offered but yeah.. I just use stripe for subscriptions so it's not that big of a deal
Hey, great video! For some reason there is not much content on stripe + drf integration on youtube (and how to connect it to NextJs frontend, preferably for my case). I have some questions though...How could i do so the user can add the credit card once on its 'profile area', so then, say in a second purchase, he can buy a product quickly, without having to type its credit card infos again? Can i make it so the checkout session price and quantity varies based on what product and how many of it the user selected? Also, how can i do so we can receive an email that a new user paid for our product? Many Thanks!
I don't understand where it triggers the "stripe webhook" function? and Is a webhook necessary? When the payment is successful, it can be checked whether the payment has been paid or unpaid. checkout_session = stripe.checkout.Session.retrieve(session_id) print('status :', checkout_session['status']) # open, complete, expired print('payment_status:', checkout_session['payment_status']) # paid, unpaid, no_payment_required if checkout_session['payment_status'] == 'paid':
I'm not an expert, but I'm betting there's an exploit with your suggested approach that is prevented by using the webhook. For what it's worth, setting up a webhook is the only official method of order fulfillment listed in Stripe's documentation for Stripe Checkout.
Also where is the stripe_webhook being called tho? He is saying that its being called by stripe cli but when I tried to print("TEST") nothing was comming in my erminal which suggests that the view is not being called.
Thanks! Bummer this is so bulky. Snipcart is so much easier, it passes the price from the product html in a data attribute . I don't want to have to create a whole separate product page inside stripe for each product and manage their ID's in environment variables, that's crazy.
@@djangoroad I'm a fan of Dennis Ivy he is one of the best on youtube he made a video on Django Paypal payment he said that he would add another video about server-side and he didn't after I watched your videos I found that you are also one of the best so I hope you make a full tutorial about Paypal payment both server and client-side this will be the only video on youtube who cover Paypal payment because there are a lot of countries strip doesn't supported this is the video if you hope to take a look ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8rMfW4wO-vU.html&ab_channel=DennisIvy
I see, thanks for the info! I have used Paypal before so can make a video about that at some point I just thought Stripe was more popular as I've received many requests for a Stripe tutorial. But yes Paypal is indeed popular outside the US.