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

Use custom BaseUrl #1102

Closed
jamesmckenzie opened this issue Feb 12, 2018 · 7 comments
Closed

Use custom BaseUrl #1102

jamesmckenzie opened this issue Feb 12, 2018 · 7 comments
Labels

Comments

@jamesmckenzie
Copy link

Feature Request

The library should allow the user to provide a custom url for testing purposes.

Use case - testing an application that uses this client library in conjunction with a mock server (e.g. stripe-mock)

@remi-stripe
Copy link
Contributor

@jamesmckenzie It's definitely something we'd like to support in the library in the future, especially to support stripe-mock as it would make iterating on the library a lot faster. I've tagged it as "future" for now as it's not something we'd be able to tackle immediately but we will look into it!

@jamesmckenzie
Copy link
Author

@remi-stripe thanks for getting back to me - if I can get some time, I'm happy to submit a PR. My initial thought is to just have the baseUrl as a constructor arg defaulted to the current Urls.BaseUrl string if that works for you?

@remi-stripe
Copy link
Contributor

cc @ob-stripe what do you think?

@ob-stripe
Copy link
Contributor

Great feature request! It's definitely something that the library needs :)

I think the best place for this would likely be the StripeConfiguration class. In order to be consistent with our other libraries, we'd want 3 methods:

  • SetApiBase to override the API base URL (defaults to https://api.stripe.com)
  • SetUploadsBase to override the file upload base URL (defaults to https://uploads.stripe.com)
  • SetConnectBase to override the Connect/OAuth base URL (defaults to https://connect.stripe.com)

Happy to review a PR if you're up for it @jamesmckenzie :)

@jamesmckenzie
Copy link
Author

thanks for the info, will put something together.

@jamesmckenzie
Copy link
Author

PR in for the above (sorry for the delay, had some computer issues!)

@ob-stripe
Copy link
Contributor

Released in 13.4.0, which should appear in NuGet shortly. Thanks again for your contribution @jamesmckenzie, much appreciated!

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

No branches or pull requests

3 participants