#gavinwahl_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1309318180388343809
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Service is the more modern approach. It is inteded to make it easier to configure your requests and Stripe clients. That being said, the Resources approach works just fine and is still what the majority of Stripe integrations in Python use.
thanks
seems like these docs are wrong, it says to set stripe.api_key but then instead passes the api key to StripeClient: https://github.com/stripe/stripe-python?tab=readme-ov-file#usage
No I think you are misinterpreting the services doc.
That is how you define a separate client for the Service approach
But then in these examples, they are showing how you can customize individual requests
So, you can still use a different API key even if you initialize the client with one
It's a difference between doing all your configuration on the StripeClient() init
vs
per each request
seems like documentation is missing for Service, for example creating a customer only has Resource: https://docs.stripe.com/api/customers/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
where is the documentation for creating a customer with Service?
Not all our docs contain both examples
I don't need code examples, just documentation. I literally can't find anywhere that tells me how to create a Customer with the Service approach
๐ catching up here
the python sdk has no docs whatsoever, and the docs.stripe.com docs don't document Service...how am I supposed to use the "modern" approach?
ok, so there happens to be an example for creating a customer using Service . How about for creating a Session? Only Resource is documented here: https://docs.stripe.com/api/checkout/sessions/create?lang=python
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes Service is the new approach and we haven't/didn't update all our Reference Doc for it. Sorry for the inconvenience. I think you can create a Session like
session = client.checkout.session.create(...)
Could you try it?
no I can't, I'm not going to call undocumented methods.
this "modern" approach doesn't seem fully baked
I'm not going to do trial and error to figure out how to do things that should be documented
Thanks for the information. Maybe document that Service is beta-quality so people don't waste their time trying to use it