Hi @Ecaterina,
We’ve had 25 accounts get disconnected since inception of integrating your plugin. Now Stripe has come back with a root cause analysis that points to you:
Essentially the OAuth Token was consumed twice, which disconnected these accounts from the platform. Platforms such as Squarespace, Shopify or Baremetrics use Stripe Connect to make API requests on behalf of their users. To do this, the user has its own Stripe account and connects it to the platform via OAuth.
Now that the platform was authorized on the connected account, it can make API requests on its behalf. Sometimes though, those API requests will stop working. In most cases, this happens because the account was disconnected from the platform.
Sometimes, the user will be adamant that they did not disconnect the platform themselves. It’s important to know that there are three things that can cause a platform’s access to be revoked:
** The user explicitly revokes the platform access in their account settings.*
** The platform explicitly revokes their access to the connected account via the API.*
** The platform mistakenly re-uses the authorization code they get during the OAuth flow.*
In most cases, the issue comes from the last one as this is an integration issue on the platform’s end and no one really wanted that connection to be revoked. To understand what’s causing this, we need to explain a bit more what happens during the OAuth flow:
** The user is on the platform’s website and signing up for their service*
** The platform sends the user to Stripe to sign up for an account or log into the existing one*
** The user signs up or logs in and we ask them to confirm if they want to let the platform get access to their account.*
** The user is redirected to the platform’s redirect URL with a unique authorization code ac_XXXX in the URL*
** The platform retrieves that code and calls our /oauth/token
endpoint with that code and their platform API key to finalize the connection*
** We connect the account on our end and return the account’s id and extra information documented here.*
The authorization code is unique and can only be used once for security reasons. If someone tries to re-use the code, the connection should be revoked immediately (per the OAuth specification) and that’s what Stripe does.
This relatively common scenario is sometimes caused by page refreshes with the oauth code in the URL: python - Stripe API; {'error': 'invalid_grant', 'error_description': 'This authorization code has already been used - Stack Overflow
So please fix the issue on your end and prevent reuse of OAuth codes.
This is critical. Not only is the plugin not working for checkouts on mobile but it also disconnects dozens of our connected accounts systematically.
It doesn’t sound like it, but please let us know if this is something we can affect.
Thanks,