This is most puzzling. The end-user should be able to reject a charge, at the last minute, by clicking the (x) in the upper right corner of Stripe’s pop-up. However, when they do that, Anvil then reports the following error, and I have no clue as to what I need to code in order to gracefully handle it.
Anvil’s error message:
AttributeError: ‘module’ object has no attribute ‘error’
Occurs during the following code:
try:
token, user_info = stripe.checkout.get_token(
amount=self.descriptor['price'],
currency="USD",
title='DARMA(tm) by InjAnnuity, Inc.',
description=self.descriptor['name_short']
)
but only if they click the (x). If they click the Pay button, then everything’s fine.
Obviously, we really should handle the (x) without crashing, but at the moment, I have little idea how.
If the Form module needs to have a global variable named error
, I’ll be happy to provide one. If it should have some initial value, I’ll need to know what that is. If it is supposed to be a function, then I need to know how it is supposed to behave.