Closed tjratch closed 8 years ago
Hi @tjratch, You can accomplish this by instantiating your own Configuration and then instantiating your own BraintreeGateway in order to make your API calls.
I am going to close this issue for now. Please reopen it if you have further issues.
Thanks for the response @pblesi! In the end, that's what I ended up doing in the end. I'm super crazy about this solution because it will be a bit confusing to the other developers on the team because it doesn't line up with any of the documentation.
Either way, thanks for the help!
Hi There,
We're a third party metrics provider for Braintree need to make API calls with a different set of credentials depending on the company we are working with. However, from using the API it's only possible to specify credentials globally when you first configure the Braintree module (e.g. braintree.Configuration.configure) and cannot specify them on a per API call basis. This is problematic because API calls are no longer thread safe because the global configuration could changed before making an API request.
From looking at configuration.py I could create my own wrapper class and call gateway() directly, but this will require me to wrap a lot of methods this way. Would it be possible to specify a way to specify API credentials on a per call basis OR make an encapsulated object instead of specifying the credentials globally?