#93gaurav93

1 messages · Page 1 of 1 (latest)

edgy pikeBOT
fallen star
#

hello! yep, you can do that

tepid skiff
#

Which API I can use to fetch transactions and with what filter parameter?

fallen star
tepid skiff
#

Okay. Thanks!

#

Will this API give me the transactions that are there before connecting this account?

fallen star
#

it should. you can try things out

tepid skiff
#

Okay

#

Does Stripe connect support countries other than US and CA?

#

Because I am trying with Indian account and it is showing "country not supported"

potent lodge
#

What are you trying exactly?

#

Can you share an example

tepid skiff
#

I am using below oAuth flow to connect my Stripe account via "Stripe connect"

https://stripe.com/docs/connect/oauth-reference

I have account A which is the main account. There I have enabled "Stripe connect".

And have an account B which I am trying to connect to Account A via "Stripe connect"

As mentioned in the above document, I have created a authorization URL

https://connect.stripe.com/oauth/authorize?response_type=code&client_id={{CLIENT_ID}}&scope=read_write&redirect_uri=https://sub2.example.com

I replaced client id with the client id provided under Stripe connect setting of account A.

When I go through the oAuth flow and connect account B, I get redirected with code param appended to the redirected URI I have set in the settings.

I used that code in below snippet,

\Stripe\Stripe::setApiKey('sk_test_51KlYu7SFqKQWeEsW8HlLhWzE8PH0aGw5dpW4ACKqavTDUemOGT3svudXRNu24a5gZVCtPFLVqMPyZyzP3HJSJDZy00lvv4WYMD');

$response = \Stripe\OAuth::token([
  'grant_type' => 'authorization_code',
  'code' => 'ac_123456789',
]);

It is throwing the below error,

Stripe\Exception\OAuth\InvalidGrantException with message 'Authorization code provided does not belong to you'

#

I simply want to connect Account B to Account A via Stripe connect (Where Stripe connect is enabled on Account A) and fetch the historical transactions of Account B via that "connected account".

potent lodge
#

I'd not recommend use OAuth

#

The sk_test key above, belongs to which account in your example? It should be the platform

tepid skiff
#

sk_test belongs to Account A

potent lodge
#

Also, you need to replace ac_123456789 with the actual code returned in the query parameters

tepid skiff
#

I actually am replacing the code I got in the query. Just didn’t share it here.

#

I'd not recommend use OAuth

Which flow do you recommend?

potent lodge
#

via Account Links

tepid skiff
#

But in this flow can I access historical transactions of 1 year ago of connected account?

tepid skiff
#

yes

potent lodge
#

What's the ac_xxx returned from the redirect?

tepid skiff
#

ac_MVaYqnX7mDjpsETvGmUwRFWiM7ZVsRUH

potent lodge
#

Which acct_xxx are you attempting to connect to

tepid skiff
#

Where I can find the account id of Account A (main account)?

#

Can I share the client id provided under Stripe connect settings?

potent lodge
#

I'm already looking at it

potent lodge
tepid skiff
#

acct_1LmYE8SFpO0n8cOW

potent lodge
#

Checking on this

tepid skiff
#

Ok

potent lodge
#

Can you share the client_id?

tepid skiff
#

ca_MVZYQshJ8baAz1IzwqTKd4UwFG9ZQMjI

potent lodge
#

That doesn't seem to be the correct client ID for acct_1KlYu7SFqKQWeEsW (the platform)

#

When you're logged into 'account B'

tepid skiff
#

Why account B needs to activate Stripe connecy?

#

*Connect

potent lodge
#

I think we need to take a step back here, this is very confusing as both accounts have the same/identical merchant name

#

acct_1KlYu7SFqKQWeEsW is the platform, correct?

#

And you want to connect acct_1LmYE8SFpO0n8cOW via OAuth?

tepid skiff
#

acct_1KlYu7SFqKQWeEsW is id of main account and I'm looking to connect ac_MVaYqnX7mDjpsETvGmUwRFWiM7ZVsRUH

potent lodge
#

That doesn't make any sense

#

Which is the platform they're connecting to?

#

Basically, you have a mismatch between the client ID (ca_xxx) and the API key.
You're using the API key from acct_1KlYu7SFqKQWeEsW, yet the client ID from acct_1LmYE8SFpO0n8cOW. Both values need to be from the same account.

#

So whichever is the platform account (i.e. the account that the other account(s) are connecting to), use the values from there

tepid skiff
#

Ok let's go step by step.

#

I have an account with email gauravd.work@gmail.com

potent lodge
#

Let me stop you there

tepid skiff
#

To which I call "main account"

potent lodge
#

Let's refer to the accounts using their IDs

tepid skiff
#

Okay

potent lodge
#

Because your accounts have very similar names

tepid skiff
#

These names?

potent lodge
#

Every reference point other than the ID is very similar (email, etc)

#

Let me know which ID is the platform and which is the connected account

tepid skiff
#

I am checking

#

Ok this is the platform account acct_1KlYu7SFqKQWeEsW

potent lodge
#

Ok, then the issue is as I described here:

Basically, you have a mismatch between the client ID (ca_xxx) and the API key.
You're using the API key from acct_1KlYu7SFqKQWeEsW, yet the client ID from acct_1LmYE8SFpO0n8cOW. Both values need to be from the same account.

#

So you need to go into the Dashboard for acct_1KlYu7SFqKQWeEsW and get the ca_xxx client ID for that account

#

Update your URL param to include that new value and it should work

tepid skiff
#

ca_MVXhE6Zx9DEMwTfVZt1JNG8TQtUW9WHQ

#

Ok I will try

#

Got this response

potent lodge
tepid skiff
#

Now I can use the account id acct_1EVW7aLZnPH2vt8q to fetch the historical transactions right?

potent lodge
#

Wait, that's a different ID?

tepid skiff
#

It is from the response

#

I can see his payments as well

potent lodge
#

Should work, then sure

tepid skiff
#

Awesome. Thank you for the help! 🙂