Closed creichert closed 6 years ago
It looks like the stripe-http-streams
lib fails for the same reasons:
Failures:
tests/Web/Stripe/Test/Event.hs:15:
1) Event tests Succesfully retrieves events
predicate failed on: Left (StripeError {errorType = ParseFailure, errorMsg = "key \"evidence_due_by\" not present", errorCode = Nothing, errorParam = Nothing, errorHTTP = Nothing})
Randomized with seed 567401952
Finished in 211.6145 seconds
89 examples, 1 failure
stripe-http-streams-2.3.0: Test suite tests failed
Completed 9 action(s).
Test suite failure for package stripe-http-streams-2.3.0
tests: exited with: ExitFailure 1
Logs printed to console
@dmjio @nmattia Can y'all review the code here? I can remove the Manager or Connection functions if you want. Other than that, it's ready to merge. From there, I'll create a new PR to stripe-haskell that creates a flag for HTTP client.
- location:
git: https://github.com/creichert/stripe
commit: 56f4067fbebe8298b94519327367213a05cddd5a
extra-dep: true
...
import Web.Stripe.Client.HttpClient
Bravo @creichert. Huge thanks 🍺
thanks @creichert !
fixes #90
This is some initial work I've done to implement an
http-client
backend for stripe requests. I wanted to get some feedback before I commit too much time to "finalizing" it for merge.Notes:
http-client
instead ofhttp-conduit
. I don't usehttp-conduit
much myself and don't really know yet what astripe-http-conduit
library may look like.stripeConn
andwithConnection
for API compatibility so that existing clients using stripe-http-streams could plug this in without any necessary changes. However, http-client's terminology regarding "connections" is different than http-streams. I'm considering adding DEPRECATED pragmas to these specific functions to get people to use thestripeManager
andwithManager
function to avoid confusion. I don't have strong feelings on this as I primary usestripeManager
.stripe
uses an http-client "global" manager (IORef Manager) defined from http-client-tls. I feel like this is good for perf so managers aren't created often.newManager
(as opposed to http-client's deprecatedwithManager
is safe with resources).Follow-Up:
stripe-haskell
package for this backend. Not sure what the best way to go about the import is (CPP or creating a newWeb.Stripe.Client
module in stripe-http-streams & stripe-http-client`Initial test results