Issue
I am using the following stripe guide: https://stripe.com/docs/checkout/integration-builder. I copy pasted most of the code. Notably, I did not include the lines:
static_url_path='',
static_folder='.'
I instead put checkout.html, success.html, and cancel.html into my static folder.
For YOUR_DOMAIN, I used:
YOUR_DOMAIN = 'http://127.0.0.1:5000/'
I'm running the program through "flask run" in the terminal. However, I discovered that to purchase stuff I need to open the html page, rather than using flask.
My two problems right now:
- The checkout button isn't doing anything at all. I think this relates to the fact that I'm running the program through flask rather than through the python code like they are, and maybe because I put my files in the static folder rather than the flaskr folder (the guide configures flaskr to house the static files too).
- How do I integrate this with flask? If I go to http://127.0.0.1:5000/checkout or http://127.0.0.1:5000/static/checkout, it doesn't respond. Should I move it to templates and use renderTemplate? Or is there some better way to connect them?
Solution
You likely went directly to http://localhost:3000/checkout/create-checkout-session in your browser, which will return the Checkout Session ID as you see there.
Once everything is set up you need to navigate to http://localhost:3000/checkout instead.
Answered By - Paul Asjes
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.