-
Notifications
You must be signed in to change notification settings - Fork 23
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
Pass in custom headers for stripe requests #10
Comments
That's a great idea. Currently our API doesn't have a way to pass metadata for individual requests (which is a design flaw we need to fix eventually), so I'm not sure how we can add custom per-request headers in a nice way with the current design. Would it make sense to also make these new headers global env vars (temporarily until we can refactor for better isolation) or do they need to be custom per-request? Depending on your application concurrency, you can set env vars before each request, but that's very hacky. The current headers in question seem to be: Longer-term, it would be nice to re-create our entire erlang API using maps for args (or at least an optional map argument as "Config" on each function) and we should also probably return the entire Stripe response as a map instead of static records. But, using map return values will remove all the nice type information we have for records. |
here is info on 'Stripe-Version' https://stripe.com/docs/api#versioning I can't find any docs on Stripe-Account though :| I'll have to ask my coworker where it's documented, though i guess it's possible it's something undocumented cause we have some odd requirements for our payment processor. I think they can be global env vars as a short-term fix. As far as using maps, i kind of agree with you that using maps can lose you type information, but there has been some discussion about dialyzer support for maps => http://erlang.org/pipermail/erlang-questions/2015-January/082419.html I'd definitely want to help improve stripe-erlang where i can though, it'd make it easier to convince people at work to use erlang :) Do you have any suggestions on where to start? |
it does certainly exist though, here's PR for stripe-ruby where they merged it => stripe/stripe-ruby#188 |
Oh, I wasn't questioning if they exist, was just wondering what they were. :)
Thanks! The biggest help would be continue finishing the entire API: every object type and field value and operation at https://stripe.com/docs/api — it's a lot of repetitive "setup+typetypetype+record+annotate" work. The main priority of this project is processing payments since other operations aren't as time-sensitive and can be manually run through the Stripe dashboard (for small projects, at least). Everything else is secondary, but still important. It would be nice to have support for everything else including refunds, discounts, coupons, better marketplace support, allowing multi-card support now that they've added it, etc. Basically, all the functions that would let you re-create the entire Stripe dashboard using only Erlang API calls. Adding new API endpoints is mostly:
If there's any implementation confusion, it's simple to evaluate how the other Stripe clients implement calls to find appropriate usage too. |
@mattsta thanks for the details!, i'm a bit booked at work atm, but that looks like it'll be clearing up in the next few weeks, so i'll start scannig the code and making PRs! |
we use this library at my work (indeed 2 of my coworkers are maintainers), it'd be nice if stripe-erlang had feature parity with other stripe api implementations.
https://github.com/Crowdtilt/WebService-Stripe#headers
The text was updated successfully, but these errors were encountered: