#johnp-python

1 messages · Page 1 of 1 (latest)

torpid steeple
royal gale
#

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

torpid steeple
#

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)

royal gale
#

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

torpid steeple
#

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