Vaingel Dev
Vaingel Dev

Reputation: 11

Why Can't I See My Connected Accounts in my Stripe Connect Section

So I have created a link for my partners to connect their accounts to my Stripe. This will allow me to do payouts, as I am doing an automation service, and my mission is to:

  1. Take payments on behalf of my partners
  2. keep a processing fee
  3. Send the remainder to the partners acccount

I cant seem to see any of the people I am using as a test to sign up as connected accounts. They have went to the url, filled out the info, but they wont pop up in my account?

I believe my issue is the last step of authentication, where Stripe says in Stripe Express Docs section "The last step is to use the provided authorization code to make a POST request to Stripe’s token endpoint to complete the connection and fetch the user’s account ID:"

How do I implement this so i can proceed with my system? and if i need to code this into something how is this supposed to get accomplished? I just need the accounts to be connected into my account.

Upvotes: 1

Views: 1377

Answers (2)

LaZza
LaZza

Reputation: 438

Just came across this answer after having a similar issue due to missing out the second step of the authorisation process. Incase anyone else is still having issues I thought I would share another tip:

You can also manually create a link for testing or incase of a low volume of new connections. This does not require making a request to the Stripe oauth end point so less coding - this option is in de stripe dashboard under Connected Accounts > Create

screenshot of 'create' option

Upvotes: 0

Paul Asjes
Paul Asjes

Reputation: 5857

When the user has finished signing up, they get redirected to a URL you provide in redirect_url. In that URL's parameters is the authorization code:

https://yoursite.com/path/to/connect/flow?code={CODE_GOES_HERE}

To complete the flow, you then need to make a request to the Stripe oauth end point to confirm the user. Make sure that this request is made server side as the response you get contains sensitive information for your new connected account. The docs show a curl request but you could do this with any request API you have at your disposal:

curl https://connect.stripe.com/oauth/token \
  -d client_secret=sk_123 \
  -d code="{AUTHORIZATION_CODE}" \
  -d grant_type=authorization_code

Where the AUTHORIZATION_CODE is the code found in the URL your users got redirected to.

Once the request completes, you should get a response with the new connected account details, provided everything went well:

{
  "access_token": "{ACCESS_TOKEN}",
  "livemode": false,
  "refresh_token": "{REFRESH_TOKEN}",
  "token_type": "bearer",
  "stripe_publishable_key": "{PUBLISHABLE_KEY}",
  "stripe_user_id": "{ACCOUNT_ID}",
  "scope": "express"
}

You should save the account unique values (e.g. access_token) in your own database so you can easily retrieve it later rather than fetch it from the Stripe API every time.

Upvotes: 1

Related Questions