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

Custom Url configuration #1128

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Conversation

jamesmckenzie
Copy link

@jamesmckenzie jamesmckenzie commented Mar 8, 2018

#1102

  • adds configuration options for apiBase, uploadsBase, connectBase

allows consumers of the library to easily override the base urls for the stripe api to allow for easier testing (for example, with the stripe-mock service)

@jamesmckenzie jamesmckenzie changed the title Custom Url configuration (closes #1102) Custom Url configuration Mar 8, 2018
{
if (string.IsNullOrEmpty(_apiBase))
{
_apiBase = "https://api.stripe.com/v1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than hardcoding the default value here, could you instead use a constant? E.g. Urls.DefaultBaseUrl.

{
if (string.IsNullOrEmpty(_uploadsBase))
{
_uploadsBase = "https://uploads.stripe.com/v1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

{
if (string.IsNullOrEmpty(_connectBase))
{
_connectBase = "https://connect.stripe.com";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

@@ -14,7 +14,7 @@ internal static class Urls

public static string Coupons => BaseUrl + "/coupons";

public static string Plans => BaseUrl + "/plans";
public static string Plans => BaseUrl + "/plans";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have some unnecessary whitespace here.

@ob-stripe
Copy link
Contributor

Hi @jamesmckenzie, thanks a lot for the PR! Overall this looks fairly solid to me. I left a few comments, could you take a look?

@jamesmckenzie
Copy link
Author

Thanks for taking a look. I've made the requested changes - let me know if there's anything else

@jamesmckenzie
Copy link
Author

and mistake fixed!

@ob-stripe
Copy link
Contributor

Thanks @jamesmckenzie! This looks good to me. Can I bother you to squash the 3 commits into a single one before I pull this in?

@jamesmckenzie
Copy link
Author

not a problem, done!

@ob-stripe
Copy link
Contributor

Perfect! Pulling this in.

@ob-stripe ob-stripe merged commit 7cb8daa into stripe:master Mar 13, 2018
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

Successfully merging this pull request may close these issues.

2 participants