2👍
I figured it out. Leaving it here for other dummies like me.
Do not add the .js file to the top of the page. Add it to the bottom, after the /body tag. Turns out values will be NULL if the javascript loads before the page.
0👍
The Python code looks correct, at least it looks like mine does in my working integration using Django. So here’s a couple of things to try:
- You don’t need the
clientSecret
until you usestripe.confirmCardPayment()
so don’t fetch it yet. - Try putting the
data-secret="{{client_secret}}"
on the<form>
element. You’ll need to add an events listener to the<form>
‘s"submit"
event anyway to prevent the default submission and trigger the confirmation so might as well retrieve theclient_secret
then.
I know this doesn’t answer why the button was no selectable but at least it gives you some next steps.
- [Django]-Django AttributeError: 'InterestsForm' object has no attribute '_errors'
- [Django]-Django checkbox not being submitted when unchecked
- [Django]-Deploy Django\Tornado on Heroku
- [Django]-Weird, inconsistent behavior using Apache and multiple Django sites
- [Django]-Debugging django templates in pycharm
Source:stackexchange.com