Jacobo Koenig
Jacobo Koenig

Reputation: 12514

Passing User information when generating a Stripe Standard Account OAuth Link

I want to create a Stripe Standard account for some of my users, and I want them to be able to click on the link directly from an email they will get. This presents the issue that I can't keep track of the user in my site's state and therefore when the authorization succeeds and the user is redirected to my site, I don't have a way to relate the authorization and stripe's user id to his user Id in my platform.

I thought of including their ID in the redirection route, but it doesn't seem Stripe allows dynamic links to be approved on the settings required.

enter image description here

Are there any workarounds to be able to do this without keeping the user's info in my site's state?

Upvotes: 0

Views: 448

Answers (1)

karllekko
karllekko

Reputation: 7198

You can pass a state URL parameter [0] when generating the link that you put in the email:

https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_xxxx&scope=read_write&state=my_user_id

That will be returned as a parameter when the user is redirected to your site after authorising. [1]

[0] - https://stripe.com/docs/connect/oauth-reference#get-authorize

[1] - https://stripe.com/docs/connect/standard-accounts#redirected

Upvotes: 1

Related Questions