#weebster-python-cors
1 messages · Page 1 of 1 (latest)
weebster-python-cors
Hey @lament adder ! Do you have a bit more details? What CORS error? Which exact part of the entire code triggers it? What did you change from the code?
The call from checkout.js on line 19 for creating a payment intent is getting cors error. I have only changed the payment button's text in checkout.html and added
`from flask_cors import CORS, cross_origin
CORS(app)
@app.route("/")
@cross_origin(origin='*')`
to the server.py file
What is the exact CORS error though? Sorry, I need more details to try and help you
the error message in my browser's console is: Access to fetch at 'file:///C:/create-payment-intent' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted
okay so that's your problem. This should be a real URL. If you developer locally you are supposed to render that view/file from a local server
have you looked at https://stripe.com/docs/payments/quickstart#run-application-html-python specifically?
I'm looking through that section... should the page itself also be served by the flask server?
yes