Add Stripe Connect support
Hi @dmjio,
I'm interested in adding in functionality for a few connect endpoints. Currently, I'd like to be able to get connect's oauth tokens (https://connect.stripe.com/oauth/token) and managing checkout sessions (https://api.stripe.com/v1/checkout/sessions) and charging them. Might need some others as I go. I'm new to stripe so not sure how complex this is. Any help getting started would be appreciated!
So it looks like I can partially use #113 because now the subdomain will depend on the request. It's not exactly clear how subdomains for a request should interact with a configured subdomain.
maybe configured hosts just flatly overwrite request hosts in all cases is ok
Hey @aviaviavi ,
Apologies for the delayed response. This sounds awesome. As you've noticed stripe is currently configured to send requests to a single endpoint. The PR you mentioned (#113) concerning @linzjax is a good first step. I don't believe it was merged because the protocol should also be configurable as well (shouldn't use https). I believe @linzjax's use case was for testing. I'd be happy to support both cases, and will merge #113 to push us in the right direction.
Otherwise, the architecture is pretty straight forward. There are some fancy types (associated type families) to create an association between the stripe url-form-encoded parameters to the response JSON. Should be simple enough to define types and instances FromJSON in the response case, to-url-encoded (or whatever its called), in the request case. There is also an open type family to support optional parameters on request arguments per @stepcut (which doesn't get enough press imo).
@aviaviavi, you can find inspiration from the previous stripe library (using an older version of connect), where the was some talk of deprecation, yet it does support connect. http://hackage.haskell.org/package/stripe-0.8.3/docs/src/Web-Stripe-Connect.html#authURL
Would love to upstream these changes into stripe-haskell.