#adam-williams_best-practices

1 messages ยท Page 1 of 1 (latest)

novel ironBOT
#

๐Ÿ‘‹ 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/1344341457493950575

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

dusk jasper
#

It appears as if none of the SDKs actually have anything in this area - the docs just give you a cURL example

#

so - sure - I can use my own HTTP client and set my own Authorization request header

#

but .. I want to make use of the Golang Stripe SDK - is there some way I can reach into the internals and grab the (authenticated) HTTP client that Stripe uses itself? Or retrieve the headers the client sets?

soft plover
#

Yeah we don't have a sdk method for this. We just use http basic auth though. You can provide your API key as the basic auth username value. You do not need to provide a password.

dusk jasper
#

Okay - is there an accepted way to retrieve the Key given a stripe.Client - or would you suggest just pulling it from config manually?

#

it doesn't seem very well catered for

soft plover
#

Yeah just pull it from your env variable

dusk jasper
#

alright ๐Ÿ‘

soft plover
#

Agree this flow can be improved