#johnp-python
1 messages · Page 1 of 1 (latest)
@royal gale well the first part would be covered under https://stripe.com/docs/connect/authentication I think.
The second is really not anything specific to our Python library, it's business logic in your overall application
Hi thank @torpid steeple for helping. Actually that's something like you mentioned
But just wonder if anyone or stripe-python library support kind of class override or customisation base on our current requirements?. Currently we are directly import stripe and use function the library provided. Anytime we have to switch api keys for auth. we need update that inline. so i belive there are a solution to make it more robust
why do you need to switch API keys directly? You generally should never need to (if you use Connect you always use the platform's API keys and you just set the stripe_account option on each individual request, per my link above)
in any case you probably want https://github.com/stripe/stripe-python#per-request-configuration if you need to change the API key on a per-request basis, that's the best option
ah, we have multiple countries supports. so for each country we have difference representative company and difference stripe account as well 😄
So base on where our user from, they will be process payment via difference api keys
I see! I don't think there's anything really specifically built into the library or that you can extend, it's more just business logic in your application to pick the appropriate credentials and use them; you can pass the API key on each individual request instead of globally so you probably want to do that and pass some 'config' object around in your code