#IsmailSarikaya-oauth

1 messages ยท Page 1 of 1 (latest)

sick oasis
tawdry hare
#

By the way, I am sending the code from the url that stripe sends to me, which is set from app settings.

sick oasis
#

hi! are you sure you're using the right secret key sk_test_xxx (of your platform account) when making the call? Could you share a bit of the code you have written to take the authorization code from the incoming URL and then pass it to that API so I can see if anything jumps out as unusual?

tawdry hare
#

yes I am sure I am using the right secret key because I can make other requests with the same key as well. I will share

#

var options = new OAuthTokenCreateOptions
{
GrantType = "authorization_code",
Code = "ac_lv5zqmafcaofhyfhapkeitsdvjrmau70"
};

        var service = new OAuthTokenService();
        var response = service.Create(options);
#

it gets the exception here

sick oasis
#

makes sense โ€” so how do you get the Code variable? it's hard coded there, where do you actually get it from programtically?

#

or if you're doing it manually for now, maybe you are missing characters when you copy and paste it , for example

tawdry hare
#

As I said I get the code directly from the url

sick oasis
#

yep, can you show me how you do that exactly? what code do you use to parse the URL query parameters and get the value? (maybe there's a bug in that code and it mangles the value somehow)

tawdry hare
#

I understand you ๐Ÿ™‚ but for now I am doing it manually

#

I mean
....auth?scope=read_write&code=ac_lv5zqmafcaofhyfhapkeitsdvjrmau70
here is the returned url so I copy the code after code= and then paste it to my c# code manually.

sick oasis
#

maybe you are missing characters when you copy and paste it , for example?

tawdry hare
#

Is it possible?

sick oasis
#

could be! you'd have to double/triple check that

tawdry hare
#

Ok I checked but it doesn't work

#

So can you check if it really exist or not?

#

For example:
ac_lv5rs6ddlqjpcnefxs5fthxjexkgbynr

#

I just got this code and 5 mins did not last

sick oasis
#

yeah I'm checking though I don't think I can see all the logs for this, give me a bit

tawdry hare
#

Sure

sick oasis
#

yeah we don't really log the actual codes, though I can see your failed requests. Can you give more context, what guide are you following and how do you create the OAuth link exactly?
(also I should mention there are very few reasons to use OAuth with Stripe, it's mostly deprecated)

tawdry hare
#

I am developing a system about golf players and coaches. So we want coaches to connect us with stripe connect.
I actually used the OAuth to connect existing stripe account to us.
And I have also some other questions. When I create an account, Stripe does not prevent me to create it with the same email address? Does it make sense?

sick oasis
#

I assume in the actual URL the client_id is an actual ca_xxxx value? can you share what it is?

tawdry hare
#

Yes it is:
ca_LT8alg7owCIvJ9FG4eFyZl75HZyNWicA

sick oasis
#

thanks

#

yeah that's the 'right' value. Hmm. I'm a little lost on why this isn't working , to be honest, feels like it should be

tawdry hare
#

I feel like you ๐Ÿ™‚ it should work

#

So is there any other way to connect existing stripe users without using OAuth?

sick oasis
#

generally you're not supposed to connect to existing accounts, what happens instead is that when you connect, if the user has an existing Stripe account, a new Stripe account is created under their same email address and your platform gets access to that one instead

tawdry hare
#

If I don't have to use OAuth, I will not use it

#

I read that doc but I didn't get how to handle.

#

Is there any example project that shows how to handle all these steps? I mean one project that contains every step.

#

And how about creating accounts with same email? I can do that and it doesn't look to me correct, am I right or missing something?

sick oasis
#

but it really depends on the exact set up and type of account and so on, it's complicated

tawdry hare
#

For example, I am not getting any error when I execute following code:
AccountCreateOptions options = new AccountCreateOptions
{
Country = "SE",
Type = "standard",
Email = "ismail17_71@hotmail.com"
};

        AccountService accountService = new AccountService();
        Account account = accountService.Create(options);
#

It creates accounts with the same email and I can see them when I get all accounts. This make me confused.

#

What is the right way to create an account? I copied these code directly from stripe's doc on internet.

sick oasis
#

in test mode I think it's not enforced

tawdry hare
#

Ok thanks for now. I will try to do without using OAuth and check the project you gave me.