What I’m trying to do:
Make sure my form is using the stripe.checkout.charge
call correctly, meaning that I’m handling exceptions right. There was something in the documentation saying:
" here are many ways a charge could abort - if the user closes the dialog box, for example. You should make sure to wrap all calls to stripe.checkout.charge
in a try...except
block"
Documentation
Now I’m paranoid, because I don’t understand how wrapping this call in a try… except block will help with failures here.
Here’s what I’m doing:
Followed the tutorial on how to charge stripe when opening a form.
I added this to the init method as instructed:
c = stripe.checkout.charge(currency="GBP", amount=100)
print(c)
I guess… can someone explain the consequences of not wrapping this call with a try … except?
And also, how to properly handle this? I’m pretty freaked out by using this anvil feature, though I know its very powerful.