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

Allow customizable HTTP.host? #112

Open
linzjax opened this issue Mar 6, 2019 · 3 comments
Open

Allow customizable HTTP.host? #112

linzjax opened this issue Mar 6, 2019 · 3 comments

Comments

@linzjax
Copy link
Contributor

linzjax commented Mar 6, 2019

I was hoping to use stripe-mock to test our billing process. Unfortunately, stripe-mock only accepts the latest version of the API (Related to Issue #110). The other issue is that stripe-mock let's you run a fake stripe API on your local machine, but the HTTP.host for this client is currently hardcoded to "api.stripe.com", which makes sense but does make it impossible to use stripe-mock.

I know updating to the latest API might be enough work to make this a non-starter, but I'd like to throw in a request for a customizable HTTP.host if possible.

@dmjio
Copy link
Owner

dmjio commented Mar 6, 2019

Hey @linzjax ,

I've added a branch here for this #113. Maybe it would be possible to use stripe-mock as a forcing function to upgrade this library (which is by the way looong overdue).

@linzjax
Copy link
Contributor Author

linzjax commented Mar 8, 2019

That was fast, thanks! So I spent yesterday trying out that branch to get it working and the customizable host works great. Unfortunately, turns out it also needs HTTP.secure to be False otherwise the TLS certificate freaks out.

The weird thing about the versioning is that you can run curl -d "email=[email protected]" http:https://localhost:12112/v1/customers -H "Authorization: Bearer sk_test_123" --header "Stripe-Version: 2014-10-07" And it will give you a response that's different from the 2019-02-19 version, it just must not be quite the correct one since it then throws a parsing errors, so not sure what version it's actually returning.
(I was comparing two different routes, ignore this)

I would certainly be stoked to see an updated version of this library (although we haven't updated the stripe version we're using since 2012 so you're still ahead of us...).

@dmjio
Copy link
Owner

dmjio commented Jul 22, 2019

@linzjax 2012 !? I thought I was in the dark ages with only supporting 2014 :)

Didn't mean to abandon this issue. I will update the #113 to make this possible. I attempted and found it was a little more effort than previously thought. Will update the nix scripts as well.

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