go.stripe
go.stripe copied to clipboard
Google App Engine
ready to use on GAE platform.
Can we get this merged in please?
I've been thinking about this; there is a minor problem. What if someone sets http.DefaultClient to the client supplied by GAE before every request? This would work before, but my patch caches the http.DefaultClient from stdlib and breaks that. I think it's better to set _httpClient to nil initially, then create an internal getter function. Something like:
func getHttpClient() *http.Client {
if _httpClient == nil {
return http.DefaultClient
}
return _httpClient
}
that should work transparently for people who don't read the docs and who don't expect this package to do anything GAE specific.
(untested)
PS Im not using this project or its code atm anymore so I can't vouch for this modification; someone who is more into it feel free to make the change, run the tests and make a pull request to my branch