How do I know if a user is disconnected from my Stripe Connect app?

I can provide a disconnect option in my application as described here: https://stripe.com/docs/connect/getting-started#revoked-access

But if a user revokes access to my application through the settings of his account, how can I find out about this?

+5
source share
1 answer

You need to configure the webhook URL for your connection application in which you listen to the account.application.deauthorized event in order to detect that the user has disconnected your application.

When you go and try to get an event to make sure it is correct using the Retrieve Event API , you will receive an error message because your application is no longer allowed:

Stripe :: AuthenticationError: (Status 401) An expired API key was provided: sk _ ********. Access to applications may be revoked.

You can rely on the fact that in this case you will receive a status code 401 to make sure that the event is valid, otherwise you will receive another error.

+8
source

Source: https://habr.com/ru/post/1212376/


All Articles