#ecu_api

1 messages ยท Page 1 of 1 (latest)

jagged mistBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1242531649866961056

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

low shadow
#

Hello! That means, at some point, you enabled Connect in the Stripe Dashboard. You need to create a separate Stripe account and use that one instead. You can create a new account by clicking on your account's name in the Dashboard to pull up the account switcher, then select the option at the bottom to create a new account.

full pivot
#

I see, so this might have happened a long time ago

low shadow
#

Yep, could have happened at any time.

full pivot
#

is it OK if I ask a few more questions about what I'm building?

low shadow
#

Sure!

full pivot
#

So I'm building Potio.cc which allows users to run pricing experiments on Stripe. We've built our own pricing table system (similar to Stripe but more complex/feature rich).

Now I need to be able to run some basic requests on the behalf of the user. For now I need access to all the prices and products of a user. I take that these permissions are the correct ones: plan_read & product_read.

I should just be able to create a stripe app that asks for these permissions, and then I should have access to that data on my users' behalf?

low shadow
#

Yep.

full pivot
#

thank you!

#

I contacted Stripe support multiple times about this (or similar) issue and they didn't understand at all what I was talking about. It's so great to be connected to actual development help now.

low shadow
#

That's why we're here. ๐Ÿ™‚

full pivot
#

For testing, I'd like to redirect myself to localhost. But it doesn't allow me to add a host that's on http:// which localhost is. Do you know if I need to add localhost even, or I can just redirect to it always?

  "allowed_redirect_uris": [
    "https://app.potio.cc/"
  ],
low shadow
#

I'm not sure, let me check...

#

To clarify, you tried to add http://localhost to allowed_redirect_uris and it wouldn't let you?

full pivot
full pivot
low shadow
#

Yeah, that makes sense. I don't think there's a way to do this part locally.

full pivot
low shadow
#

Right, but that's not for the OAuth process.

full pivot
#

true

#

might need to create a redirect from a public https page to localhost

#

I would expect redirect to localhost to work tbh, that's how I usually see it in other APIs

low shadow
#

Yeah, I'm not sure why we don't allow it there. Asking internally, but may not get an answer anytime soon.

#

Regardless I'll flag it as feedback internally.

shut muskBOT
full pivot
#

I ended up simply copying the URL parameters part from production URL to localhost for now. Works well enough for testing.

#

I do have a question about actually exchanging the authorization code parameter for an API access token and the refresh token.

I am trying to use this library for it: https://github.com/badgateway/oauth2-client

I see from the cURL example in your docs that you set a user like this sklive xxx. I'm unsure what the sk_live code is and what it matches in the actual oauth2 nodejs client, because that has clientId and clientSecret

honest thorn
#

Hello
sk_live is a prefix for your Stripe account's live mode Secret API key

full pivot
#

I can set sk_live as clientSecret and just omit clientId?

honest thorn
#

I'm not sure, is there a guide you're following for this?

full pivot
#
  1. Exchange the authorization code for an access token

This part

honest thorn
#

I see. I'm not familiar with the oauth2 client you're using but you can give it a try

full pivot
#

oh no, I will give it a try myself ๐Ÿ™‚

#

but I will have to do that another day

#

take care for now!