2021年1月4日星期一

Need help integrating Flask and Stripe

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:

  1. The checkout button isn't doing anything at all.
  2. 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?
https://stackoverflow.com/questions/65572169/need-help-integrating-flask-and-stripe January 05, 2021 at 09:47AM

没有评论:

发表评论