Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Stripe Connect support #117

Open
aviaviavi opened this issue Jul 19, 2019 · 3 comments
Open

Add Stripe Connect support #117

aviaviavi opened this issue Jul 19, 2019 · 3 comments

Comments

@aviaviavi
Copy link

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!

@aviaviavi
Copy link
Author

aviaviavi commented Jul 19, 2019

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.

@aviaviavi
Copy link
Author

maybe configured hosts just flatly overwrite request hosts in all cases is ok

@dmjio
Copy link
Owner

dmjio commented Jul 22, 2019

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:https://hackage.haskell.org/package/stripe-0.8.3/docs/src/Web-Stripe-Connect.html#authURL

Would love to upstream these changes into stripe-haskell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants