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

#1104: Added real parameterless constructors to all services #1105

Merged
merged 1 commit into from
Feb 22, 2018

Conversation

slimCODE
Copy link
Contributor

@slimCODE slimCODE commented Feb 16, 2018

This allows these services to serve as a generic type in methods with a where TService : new() clause.

Fixes #1104.

@brandur-stripe
Copy link
Contributor

Thanks @slimCODE. This seems like it'll be useful and doesn't appear to be harmful in any way.

The one thing I noticed is that it seems like you've been relatively selective about which services get this treatment. Is there any reason for that? Your patch shows 20 files changed, but there are more like 36 services that are not one of the base classes:

$ ls -1 -R  src/Stripe.net/Services/ | grep 'Service.cs'
StripeBasicService.cs
StripeService.cs
Stripe3DSecureService.cs
StripeAccountService.cs
StripeApplePayDomainService.cs
StripeApplicationFeeRefundService.cs
StripeApplicationFeeService.cs
StripeBalanceService.cs
BankAccountService.cs
StripeCardService.cs
StripeChargeService.cs
CountrySpecService.cs
StripeCouponService.cs
StripeCustomerService.cs
StripeDiscountService.cs
StripeDisputeService.cs
StripeEphemeralKeyService.cs
StripeEventService.cs
StripeExchangeRateService.cs
StripeExternalAccountService.cs
StripeFileUploadService.cs
StripeInvoiceItemService.cs
StripeInvoiceService.cs
StripeLoginLinkService.cs
StripeOAuthTokenService.cs
StripeOrderService.cs
StripePayoutService.cs
StripePlanService.cs
StripeProductService.cs
StripeRefundService.cs
StripeSkuService.cs
StripeSourceTransactionService.cs
StripeSourceService.cs
StripeSubscriptionItemService.cs
StripeSubscriptionService.cs
StripeTokenService.cs
StripeTransferReversalService.cs
StripeTransferService.cs

(Also, you might want to add a "Fixes #1104" in your description above just so the issue gets linked somewhere.)

@slimCODE
Copy link
Contributor Author

@brandur-stripe That was a louzy patch, I missed the ones deriving from StripeBasicService<>!

@brandur-stripe
Copy link
Contributor

@slimCODE Ah I see what happened. Thanks for the quick fix!

Would you mind rebasing to get your two commits squashed down into one? That'll also give us a chance to try the CI build again, which seems to have hit an intermittent network problem and failed.

Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

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

Nit, but it looks like you've added extra newlines in a few places. Could you remove these?

@slimCODE
Copy link
Contributor Author

@ob-stripe I added those lines to normalize, as there were three lines everywhere else between the ctor (and props) and the "Sync" methods. If you prefer, I'll remove them.

@ob-stripe
Copy link
Contributor

@slimCODE Ah no, that's fine then. Thanks for going the extra mile :)

@ob-stripe ob-stripe merged commit d666da5 into stripe:master Feb 22, 2018
@ob-stripe
Copy link
Contributor

Released in 13.1.0. Thanks again for the contribution!

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.

3 participants