If BankAuthorizeView.get is called twice with the same values (ie. reload of page), Stripe automatically disconnects the account. We thus need to clear processor_deposit_key, processor_priv_key, processor_pub_key and processor_refresh_token before attempting to set them otherwise the result is a 500 error due to an inconsistent with Stripe.
AuthenticationError at /billing/cowork/bank/
invalid_grant: This authorization code has already been used. All tokens issued with this code have been revoked.
File "site-packages/saas/views/billing.py" in get
214. self.object, auth_code)
File "site-packages/saas/backends/stripe_processor/base.py" in connect_auth
228. json_body=data)
If
BankAuthorizeView.get
is called twice with the same values (ie. reload of page), Stripe automatically disconnects the account. We thus need to clearprocessor_deposit_key
,processor_priv_key
,processor_pub_key
andprocessor_refresh_token
before attempting to set them otherwise the result is a 500 error due to an inconsistent with Stripe.