From 9c67519734fe7f86235ed1c770fb9a42ffdef1c8 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 30 May 2019 21:29:20 -0700 Subject: [PATCH] Make client in services readonly --- .../Services/Account/AccountService.cs | 4 +-- .../AccountLinks/AccountLinkService.cs | 4 +-- .../ApplePayDomains/ApplePayDomainService.cs | 4 +-- .../ApplicationFeeRefundService.cs | 4 +-- .../ApplicationFees/ApplicationFeeService.cs | 4 +-- .../Services/Balance/BalanceService.cs | 4 +-- .../BalanceTransactionService.cs | 4 +-- .../BankAccounts/BankAccountService.cs | 4 +-- .../Capabilities/CapabilityService.cs | 4 +-- src/Stripe.net/Services/Cards/CardService.cs | 4 +-- .../Services/Charges/ChargeService.cs | 4 +-- .../Services/Checkout/SessionService.cs | 4 +-- .../CountrySpecs/CountrySpecService.cs | 4 +-- .../Services/Coupons/CouponService.cs | 4 +-- .../Services/CreditNotes/CreditNoteService.cs | 4 +-- .../Services/Customers/CustomerService.cs | 4 +-- .../Services/Discounts/DiscountService.cs | 4 +-- .../Services/Disputes/DisputeService.cs | 4 +-- .../EphemeralKeys/EphemeralKeyService.cs | 4 +-- .../Services/Events/EventService.cs | 4 +-- .../ExchangeRates/ExchangeRateService.cs | 4 +-- .../ExternalAccountService.cs | 4 +-- .../Services/FileLinks/FileLinkService.cs | 4 +-- src/Stripe.net/Services/Files/FileService.cs | 4 +-- .../InvoiceItems/InvoiceItemService.cs | 4 +-- .../Services/Invoices/InvoiceService.cs | 4 +-- .../Authorizations/AuthorizationService.cs | 4 +-- .../Issuing/Cardholders/CardholderService.cs | 4 +-- .../Services/Issuing/Cards/CardService.cs | 4 +-- .../Issuing/Disputes/DisputeService.cs | 4 +-- .../Transactions/TransactionService.cs | 4 +-- .../Services/LoginLink/LoginLinkService.cs | 4 +-- .../Services/OAuth/OAuthTokenService.cs | 4 +-- .../Services/Orders/OrderService.cs | 4 +-- .../PaymentIntents/PaymentIntentService.cs | 4 +-- .../PaymentMethods/PaymentMethodService.cs | 4 +-- .../Services/Payouts/PayoutService.cs | 4 +-- .../Services/Persons/PersonService.cs | 4 +-- src/Stripe.net/Services/Plans/PlanService.cs | 4 +-- .../Services/Products/ProductService.cs | 4 +-- .../EarlyFraudWarningService.cs | 4 +-- .../ValueListItems/ValueListItemService.cs | 4 +-- .../Radar/ValueLists/ValueListService.cs | 4 +-- .../Services/Refunds/RefundService.cs | 4 +-- .../Reporting/ReportRuns/ReportRunService.cs | 4 +-- .../ReportTypes/ReportTypeService.cs | 4 +-- .../Services/Reviews/ReviewService.cs | 4 +-- .../ScheduledQueryRunService.cs | 4 +-- src/Stripe.net/Services/Skus/SkuService.cs | 4 +-- .../SourceTransactionService.cs | 4 +-- .../Services/Sources/SourceService.cs | 4 +-- .../SubscriptionItemService.cs | 4 +-- .../SubscriptionScheduleRevisionService.cs | 4 +-- .../SubscriptionScheduleService.cs | 4 +-- .../Subscriptions/SubscriptionService.cs | 4 +-- .../Services/TaxIds/TaxIdService.cs | 4 +-- .../Services/TaxRates/TaxRateService.cs | 4 +-- .../ConnectionTokenService.cs | 4 +-- .../Terminal/Locations/LocationService.cs | 4 +-- .../Terminal/Readers/ReaderService.cs | 4 +-- .../ThreeDSecure/ThreeDSecureService.cs | 4 +-- .../Services/Tokens/TokenService.cs | 4 +-- .../Services/Topups/TopupService.cs | 4 +-- .../TransferReversalService.cs | 4 +-- .../Services/Transfers/TransferService.cs | 4 +-- .../UsageRecordSummaryService.cs | 4 +-- .../UsageRecords/UsageRecordService.cs | 4 +-- .../WebhookEndpointService.cs | 4 +-- src/Stripe.net/Services/_base/Service.cs | 29 +++++++++++-------- .../Services/_base/ServiceNested.cs | 4 +-- .../Functional/NetworkRetriesTest.cs | 18 ++++++------ src/StripeTests/Functional/TelemetryTest.cs | 4 +-- .../Public/StripeResponseTest.cs | 8 ++--- .../Infrastructure/StripeExceptionTest.cs | 2 +- .../AccountLinks/AccountLinkServiceTest.cs | 2 +- .../Services/Accounts/AccountServiceTest.cs | 2 +- .../ApplePayDomainServiceTest.cs | 2 +- .../ApplicationFeeRefundServiceTest.cs | 2 +- .../ApplicationFeeServiceTest.cs | 2 +- src/StripeTests/Services/AutoPagingTest.cs | 7 ++++- .../Services/Balance/BalanceServiceTest.cs | 2 +- .../BalanceTransactionServiceTest.cs | 2 +- .../BankAccounts/BankAccountServiceTest.cs | 2 +- .../Capabilities/CapabilityServiceTest.cs | 2 +- .../Services/Cards/CardServiceTest.cs | 2 +- .../Services/Charges/ChargeServiceTest.cs | 2 +- .../Services/Checkout/SessionServiceTest.cs | 2 +- .../CountrySpecs/CountrySpecServiceTest.cs | 2 +- .../Services/Coupons/CouponServiceTest.cs | 2 +- .../CreditNotes/CreditNoteServiceTest.cs | 2 +- .../Services/Customers/CustomerServiceTest.cs | 2 +- .../Services/Discounts/DiscountServiceTest.cs | 2 +- .../Services/Disputes/DisputeServiceTest.cs | 2 +- .../EphemeralKeys/EphemeralKeyServiceTest.cs | 2 +- .../Services/Events/EventServiceTest.cs | 2 +- .../ExchangeRates/ExchangeRateServiceTest.cs | 2 +- .../ExternalAccountServiceTest.cs | 2 +- .../Services/FileLinks/FileLinkServiceTest.cs | 2 +- .../Services/Files/FileServiceTest.cs | 2 +- .../InvoiceItems/InvoiceItemServiceTest.cs | 2 +- .../Services/Invoices/InvoiceServiceTest.cs | 2 +- .../AuthorizationServiceTest.cs | 2 +- .../Cardholders/CardholderServiceTest.cs | 2 +- .../Issuing/Cards/IssuingCardServiceTest.cs | 2 +- .../Disputes/IssuingDisputeServiceTest.cs | 2 +- .../Transactions/TransactionServiceTest.cs | 2 +- .../LoginLinks/LoginLinkServiceTest.cs | 2 +- .../Services/OAuth/OAuthTokenServiceTest.cs | 2 +- .../Services/Orders/OrderServiceTest.cs | 2 +- .../PaymentIntentServiceTest.cs | 2 +- .../PaymentMethodServiceTest.cs | 2 +- .../Services/Payouts/PayoutServiceTest.cs | 2 +- .../Services/Persons/PersonServiceTest.cs | 2 +- .../Services/Plans/PlanServiceTest.cs | 2 +- .../Services/Products/ProductServiceTest.cs | 2 +- .../EarlyFraudWarningServiceTest.cs | 2 +- .../ValueListItemServiceTest.cs | 2 +- .../Radar/ValueLists/ValueListServiceTest.cs | 2 +- .../Services/Refunds/RefundServiceTest.cs | 2 +- .../ReportRuns/ReportRunServiceTest.cs | 2 +- .../ReportTypes/ReportTypeServiceTest.cs | 2 +- .../Services/Reviews/ReviewServiceTest.cs | 2 +- .../ScheduledQueryRunServiceTest.cs | 2 +- .../Services/Skus/SkuServiceTest.cs | 2 +- .../SourceTransactionServiceTest.cs | 2 +- .../Services/Sources/SourceServiceTest.cs | 2 +- .../SubscriptionItemServiceTest.cs | 2 +- ...SubscriptionScheduleRevisionServiceTest.cs | 2 +- .../SubscriptionScheduleServiceTest.cs | 2 +- .../Subscriptions/SubscriptionServiceTest.cs | 2 +- .../Services/TaxIds/TaxIdServiceTest.cs | 2 +- .../Services/TaxRates/TaxRateServiceTest.cs | 2 +- .../ConnectionTokenServiceTest.cs | 2 +- .../Terminal/Locations/LocationServiceTest.cs | 2 +- .../Terminal/Readers/ReaderServiceTest.cs | 2 +- .../ThreeDSecure/ThreeDSecureServiceTest.cs | 2 +- .../Services/Tokens/TokenServiceTest.cs | 2 +- .../Services/Topups/TopupServiceTest.cs | 2 +- .../TransferReversalServiceTest.cs | 2 +- .../Services/Transfers/TransferServiceTest.cs | 2 +- .../UsageRecordSummaryServiceTest.cs | 2 +- .../UsageRecords/UsageRecordServiceTest.cs | 2 +- .../WebhookEndpointServiceTest.cs | 2 +- src/StripeTests/Services/_base/ServiceTest.cs | 15 ++++++---- 144 files changed, 255 insertions(+), 240 deletions(-) diff --git a/src/Stripe.net/Services/Account/AccountService.cs b/src/Stripe.net/Services/Account/AccountService.cs index a29ffb2332..156a64fe56 100644 --- a/src/Stripe.net/Services/Account/AccountService.cs +++ b/src/Stripe.net/Services/Account/AccountService.cs @@ -17,8 +17,8 @@ public AccountService() { } - public AccountService(string apiKey) - : base(apiKey) + public AccountService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/AccountLinks/AccountLinkService.cs b/src/Stripe.net/Services/AccountLinks/AccountLinkService.cs index 84296a168a..2d0ecf3129 100644 --- a/src/Stripe.net/Services/AccountLinks/AccountLinkService.cs +++ b/src/Stripe.net/Services/AccountLinks/AccountLinkService.cs @@ -14,8 +14,8 @@ public AccountLinkService() { } - public AccountLinkService(string apiKey) - : base(apiKey) + public AccountLinkService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs b/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs index 4430c4916f..6929af44ad 100644 --- a/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs +++ b/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs @@ -15,8 +15,8 @@ public ApplePayDomainService() { } - public ApplePayDomainService(string apiKey) - : base(apiKey) + public ApplePayDomainService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundService.cs b/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundService.cs index b475b81d95..55ca4ef14f 100644 --- a/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundService.cs +++ b/src/Stripe.net/Services/ApplicationFeeRefunds/ApplicationFeeRefundService.cs @@ -15,8 +15,8 @@ public ApplicationFeeRefundService() { } - public ApplicationFeeRefundService(string apiKey) - : base(apiKey) + public ApplicationFeeRefundService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/ApplicationFees/ApplicationFeeService.cs b/src/Stripe.net/Services/ApplicationFees/ApplicationFeeService.cs index d0750d095a..83014e492f 100644 --- a/src/Stripe.net/Services/ApplicationFees/ApplicationFeeService.cs +++ b/src/Stripe.net/Services/ApplicationFees/ApplicationFeeService.cs @@ -13,8 +13,8 @@ public ApplicationFeeService() { } - public ApplicationFeeService(string apiKey) - : base(apiKey) + public ApplicationFeeService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Balance/BalanceService.cs b/src/Stripe.net/Services/Balance/BalanceService.cs index c1f15ff61a..3f528aae93 100644 --- a/src/Stripe.net/Services/Balance/BalanceService.cs +++ b/src/Stripe.net/Services/Balance/BalanceService.cs @@ -15,8 +15,8 @@ public BalanceService() { } - public BalanceService(string apiKey) - : base(apiKey) + public BalanceService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/BalanceTransactions/BalanceTransactionService.cs b/src/Stripe.net/Services/BalanceTransactions/BalanceTransactionService.cs index bcc7ecb575..c9fcfbf662 100644 --- a/src/Stripe.net/Services/BalanceTransactions/BalanceTransactionService.cs +++ b/src/Stripe.net/Services/BalanceTransactions/BalanceTransactionService.cs @@ -13,8 +13,8 @@ public BalanceTransactionService() { } - public BalanceTransactionService(string apiKey) - : base(apiKey) + public BalanceTransactionService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/BankAccounts/BankAccountService.cs b/src/Stripe.net/Services/BankAccounts/BankAccountService.cs index 74f1342b73..55c124a8f5 100644 --- a/src/Stripe.net/Services/BankAccounts/BankAccountService.cs +++ b/src/Stripe.net/Services/BankAccounts/BankAccountService.cs @@ -17,8 +17,8 @@ public BankAccountService() { } - public BankAccountService(string apiKey) - : base(apiKey) + public BankAccountService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Capabilities/CapabilityService.cs b/src/Stripe.net/Services/Capabilities/CapabilityService.cs index 2523de9dff..9ec7174be1 100644 --- a/src/Stripe.net/Services/Capabilities/CapabilityService.cs +++ b/src/Stripe.net/Services/Capabilities/CapabilityService.cs @@ -14,8 +14,8 @@ public CapabilityService() { } - public CapabilityService(string apiKey) - : base(apiKey) + public CapabilityService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Cards/CardService.cs b/src/Stripe.net/Services/Cards/CardService.cs index b217befc3e..3a96ba388e 100644 --- a/src/Stripe.net/Services/Cards/CardService.cs +++ b/src/Stripe.net/Services/Cards/CardService.cs @@ -16,8 +16,8 @@ public CardService() { } - public CardService(string apiKey) - : base(apiKey) + public CardService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Charges/ChargeService.cs b/src/Stripe.net/Services/Charges/ChargeService.cs index 69d80f2c47..9305f63010 100644 --- a/src/Stripe.net/Services/Charges/ChargeService.cs +++ b/src/Stripe.net/Services/Charges/ChargeService.cs @@ -16,8 +16,8 @@ public ChargeService() { } - public ChargeService(string apiKey) - : base(apiKey) + public ChargeService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Checkout/SessionService.cs b/src/Stripe.net/Services/Checkout/SessionService.cs index 709a174fcf..e61d7b4148 100644 --- a/src/Stripe.net/Services/Checkout/SessionService.cs +++ b/src/Stripe.net/Services/Checkout/SessionService.cs @@ -14,8 +14,8 @@ public SessionService() { } - public SessionService(string apiKey) - : base(apiKey) + public SessionService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/CountrySpecs/CountrySpecService.cs b/src/Stripe.net/Services/CountrySpecs/CountrySpecService.cs index 21f0a58022..2bc0ed5f80 100644 --- a/src/Stripe.net/Services/CountrySpecs/CountrySpecService.cs +++ b/src/Stripe.net/Services/CountrySpecs/CountrySpecService.cs @@ -13,8 +13,8 @@ public CountrySpecService() { } - public CountrySpecService(string apiKey) - : base(apiKey) + public CountrySpecService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Coupons/CouponService.cs b/src/Stripe.net/Services/Coupons/CouponService.cs index b2e7ce1dfd..f0af757265 100644 --- a/src/Stripe.net/Services/Coupons/CouponService.cs +++ b/src/Stripe.net/Services/Coupons/CouponService.cs @@ -16,8 +16,8 @@ public CouponService() { } - public CouponService(string apiKey) - : base(apiKey) + public CouponService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/CreditNotes/CreditNoteService.cs b/src/Stripe.net/Services/CreditNotes/CreditNoteService.cs index 1f6a70b220..73370f9c1f 100644 --- a/src/Stripe.net/Services/CreditNotes/CreditNoteService.cs +++ b/src/Stripe.net/Services/CreditNotes/CreditNoteService.cs @@ -16,8 +16,8 @@ public CreditNoteService() { } - public CreditNoteService(string apiKey) - : base(apiKey) + public CreditNoteService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Customers/CustomerService.cs b/src/Stripe.net/Services/Customers/CustomerService.cs index b60432071e..d30b1ea1dc 100644 --- a/src/Stripe.net/Services/Customers/CustomerService.cs +++ b/src/Stripe.net/Services/Customers/CustomerService.cs @@ -16,8 +16,8 @@ public CustomerService() { } - public CustomerService(string apiKey) - : base(apiKey) + public CustomerService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Discounts/DiscountService.cs b/src/Stripe.net/Services/Discounts/DiscountService.cs index 85125ab4a0..4a4ccd887a 100644 --- a/src/Stripe.net/Services/Discounts/DiscountService.cs +++ b/src/Stripe.net/Services/Discounts/DiscountService.cs @@ -11,8 +11,8 @@ public DiscountService() { } - public DiscountService(string apiKey) - : base(apiKey) + public DiscountService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Disputes/DisputeService.cs b/src/Stripe.net/Services/Disputes/DisputeService.cs index ea53111340..295088044c 100644 --- a/src/Stripe.net/Services/Disputes/DisputeService.cs +++ b/src/Stripe.net/Services/Disputes/DisputeService.cs @@ -15,8 +15,8 @@ public DisputeService() { } - public DisputeService(string apiKey) - : base(apiKey) + public DisputeService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs b/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs index ec4ea0398b..f473079b4b 100644 --- a/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs +++ b/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs @@ -14,8 +14,8 @@ public EphemeralKeyService() { } - public EphemeralKeyService(string apiKey) - : base(apiKey) + public EphemeralKeyService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Events/EventService.cs b/src/Stripe.net/Services/Events/EventService.cs index 6b23899149..7d1e6b0082 100644 --- a/src/Stripe.net/Services/Events/EventService.cs +++ b/src/Stripe.net/Services/Events/EventService.cs @@ -13,8 +13,8 @@ public EventService() { } - public EventService(string apiKey) - : base(apiKey) + public EventService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/ExchangeRates/ExchangeRateService.cs b/src/Stripe.net/Services/ExchangeRates/ExchangeRateService.cs index 8b088fa933..ef319b11cd 100644 --- a/src/Stripe.net/Services/ExchangeRates/ExchangeRateService.cs +++ b/src/Stripe.net/Services/ExchangeRates/ExchangeRateService.cs @@ -13,8 +13,8 @@ public ExchangeRateService() { } - public ExchangeRateService(string apiKey) - : base(apiKey) + public ExchangeRateService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs index 6d740cc4b1..d257fefde3 100644 --- a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs @@ -16,8 +16,8 @@ public ExternalAccountService() { } - public ExternalAccountService(string apiKey) - : base(apiKey) + public ExternalAccountService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/FileLinks/FileLinkService.cs b/src/Stripe.net/Services/FileLinks/FileLinkService.cs index b04f84bd25..4df620acb8 100644 --- a/src/Stripe.net/Services/FileLinks/FileLinkService.cs +++ b/src/Stripe.net/Services/FileLinks/FileLinkService.cs @@ -15,8 +15,8 @@ public FileLinkService() { } - public FileLinkService(string apiKey) - : base(apiKey) + public FileLinkService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Files/FileService.cs b/src/Stripe.net/Services/Files/FileService.cs index 68aea43284..1e7429c877 100644 --- a/src/Stripe.net/Services/Files/FileService.cs +++ b/src/Stripe.net/Services/Files/FileService.cs @@ -14,8 +14,8 @@ public FileService() { } - public FileService(string apiKey) - : base(apiKey) + public FileService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs index f82bcb4144..d57fdef3c0 100644 --- a/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs @@ -16,8 +16,8 @@ public InvoiceItemService() { } - public InvoiceItemService(string apiKey) - : base(apiKey) + public InvoiceItemService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Invoices/InvoiceService.cs b/src/Stripe.net/Services/Invoices/InvoiceService.cs index ee2a58c8de..9c117346c4 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceService.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceService.cs @@ -16,8 +16,8 @@ public InvoiceService() { } - public InvoiceService(string apiKey) - : base(apiKey) + public InvoiceService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationService.cs b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationService.cs index 0451adac26..fde602119d 100644 --- a/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationService.cs +++ b/src/Stripe.net/Services/Issuing/Authorizations/AuthorizationService.cs @@ -15,8 +15,8 @@ public AuthorizationService() { } - public AuthorizationService(string apiKey) - : base(apiKey) + public AuthorizationService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Issuing/Cardholders/CardholderService.cs b/src/Stripe.net/Services/Issuing/Cardholders/CardholderService.cs index c48605648e..5eb9b1f20d 100644 --- a/src/Stripe.net/Services/Issuing/Cardholders/CardholderService.cs +++ b/src/Stripe.net/Services/Issuing/Cardholders/CardholderService.cs @@ -15,8 +15,8 @@ public CardholderService() { } - public CardholderService(string apiKey) - : base(apiKey) + public CardholderService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Issuing/Cards/CardService.cs b/src/Stripe.net/Services/Issuing/Cards/CardService.cs index e4a928ab70..79e357e1c7 100644 --- a/src/Stripe.net/Services/Issuing/Cards/CardService.cs +++ b/src/Stripe.net/Services/Issuing/Cards/CardService.cs @@ -16,8 +16,8 @@ public CardService() { } - public CardService(string apiKey) - : base(apiKey) + public CardService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Issuing/Disputes/DisputeService.cs b/src/Stripe.net/Services/Issuing/Disputes/DisputeService.cs index c76e26ade9..009612b449 100644 --- a/src/Stripe.net/Services/Issuing/Disputes/DisputeService.cs +++ b/src/Stripe.net/Services/Issuing/Disputes/DisputeService.cs @@ -15,8 +15,8 @@ public DisputeService() { } - public DisputeService(string apiKey) - : base(apiKey) + public DisputeService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Issuing/Transactions/TransactionService.cs b/src/Stripe.net/Services/Issuing/Transactions/TransactionService.cs index 6532bef707..fb9b33ba49 100644 --- a/src/Stripe.net/Services/Issuing/Transactions/TransactionService.cs +++ b/src/Stripe.net/Services/Issuing/Transactions/TransactionService.cs @@ -14,8 +14,8 @@ public TransactionService() { } - public TransactionService(string apiKey) - : base(apiKey) + public TransactionService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/LoginLink/LoginLinkService.cs b/src/Stripe.net/Services/LoginLink/LoginLinkService.cs index 99b3d58f82..120fcd4e35 100644 --- a/src/Stripe.net/Services/LoginLink/LoginLinkService.cs +++ b/src/Stripe.net/Services/LoginLink/LoginLinkService.cs @@ -13,8 +13,8 @@ public LoginLinkService() { } - public LoginLinkService(string apiKey) - : base(apiKey) + public LoginLinkService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/OAuth/OAuthTokenService.cs b/src/Stripe.net/Services/OAuth/OAuthTokenService.cs index 7e8806acb3..5c99e3a277 100644 --- a/src/Stripe.net/Services/OAuth/OAuthTokenService.cs +++ b/src/Stripe.net/Services/OAuth/OAuthTokenService.cs @@ -14,8 +14,8 @@ public OAuthTokenService() { } - public OAuthTokenService(string apiKey) - : base(apiKey) + public OAuthTokenService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Orders/OrderService.cs b/src/Stripe.net/Services/Orders/OrderService.cs index 765d78ee52..c3fb82ece1 100644 --- a/src/Stripe.net/Services/Orders/OrderService.cs +++ b/src/Stripe.net/Services/Orders/OrderService.cs @@ -16,8 +16,8 @@ public OrderService() { } - public OrderService(string apiKey) - : base(apiKey) + public OrderService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs b/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs index 6e1d3a33c1..bc9e44a8fe 100644 --- a/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs +++ b/src/Stripe.net/Services/PaymentIntents/PaymentIntentService.cs @@ -16,8 +16,8 @@ public PaymentIntentService() { } - public PaymentIntentService(string apiKey) - : base(apiKey) + public PaymentIntentService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/PaymentMethods/PaymentMethodService.cs b/src/Stripe.net/Services/PaymentMethods/PaymentMethodService.cs index 307a1356ec..0bfa146846 100644 --- a/src/Stripe.net/Services/PaymentMethods/PaymentMethodService.cs +++ b/src/Stripe.net/Services/PaymentMethods/PaymentMethodService.cs @@ -16,8 +16,8 @@ public PaymentMethodService() { } - public PaymentMethodService(string apiKey) - : base(apiKey) + public PaymentMethodService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Payouts/PayoutService.cs b/src/Stripe.net/Services/Payouts/PayoutService.cs index d4973699d1..ec33403a33 100644 --- a/src/Stripe.net/Services/Payouts/PayoutService.cs +++ b/src/Stripe.net/Services/Payouts/PayoutService.cs @@ -16,8 +16,8 @@ public PayoutService() { } - public PayoutService(string apiKey) - : base(apiKey) + public PayoutService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Persons/PersonService.cs b/src/Stripe.net/Services/Persons/PersonService.cs index 3339c90e93..5e4a15fb84 100644 --- a/src/Stripe.net/Services/Persons/PersonService.cs +++ b/src/Stripe.net/Services/Persons/PersonService.cs @@ -15,8 +15,8 @@ public PersonService() { } - public PersonService(string apiKey) - : base(apiKey) + public PersonService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Plans/PlanService.cs b/src/Stripe.net/Services/Plans/PlanService.cs index 8c3bf01ec6..5c9e64d149 100644 --- a/src/Stripe.net/Services/Plans/PlanService.cs +++ b/src/Stripe.net/Services/Plans/PlanService.cs @@ -16,8 +16,8 @@ public PlanService() { } - public PlanService(string apiKey) - : base(apiKey) + public PlanService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Products/ProductService.cs b/src/Stripe.net/Services/Products/ProductService.cs index b6a00819dd..fc1b0ce8e5 100644 --- a/src/Stripe.net/Services/Products/ProductService.cs +++ b/src/Stripe.net/Services/Products/ProductService.cs @@ -16,8 +16,8 @@ public ProductService() { } - public ProductService(string apiKey) - : base(apiKey) + public ProductService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningService.cs b/src/Stripe.net/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningService.cs index 9326c1b80b..6b369662e3 100644 --- a/src/Stripe.net/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningService.cs +++ b/src/Stripe.net/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningService.cs @@ -13,8 +13,8 @@ public EarlyFraudWarningService() { } - public EarlyFraudWarningService(string apiKey) - : base(apiKey) + public EarlyFraudWarningService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs b/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs index 796e17820c..fdb07075fc 100644 --- a/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs +++ b/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs @@ -14,8 +14,8 @@ public ValueListItemService() { } - public ValueListItemService(string apiKey) - : base(apiKey) + public ValueListItemService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs b/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs index c4b7a991dd..7f75e24470 100644 --- a/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs +++ b/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs @@ -14,8 +14,8 @@ public ValueListService() { } - public ValueListService(string apiKey) - : base(apiKey) + public ValueListService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Refunds/RefundService.cs b/src/Stripe.net/Services/Refunds/RefundService.cs index 8cbaa6fb91..1ecb8dc8bd 100644 --- a/src/Stripe.net/Services/Refunds/RefundService.cs +++ b/src/Stripe.net/Services/Refunds/RefundService.cs @@ -15,8 +15,8 @@ public RefundService() { } - public RefundService(string apiKey) - : base(apiKey) + public RefundService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Reporting/ReportRuns/ReportRunService.cs b/src/Stripe.net/Services/Reporting/ReportRuns/ReportRunService.cs index 3f7cf4a5fb..58ab4c0b84 100644 --- a/src/Stripe.net/Services/Reporting/ReportRuns/ReportRunService.cs +++ b/src/Stripe.net/Services/Reporting/ReportRuns/ReportRunService.cs @@ -14,8 +14,8 @@ public ReportRunService() { } - public ReportRunService(string apiKey) - : base(apiKey) + public ReportRunService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Reporting/ReportTypes/ReportTypeService.cs b/src/Stripe.net/Services/Reporting/ReportTypes/ReportTypeService.cs index 285683a803..56e1c3d515 100644 --- a/src/Stripe.net/Services/Reporting/ReportTypes/ReportTypeService.cs +++ b/src/Stripe.net/Services/Reporting/ReportTypes/ReportTypeService.cs @@ -13,8 +13,8 @@ public ReportTypeService() { } - public ReportTypeService(string apiKey) - : base(apiKey) + public ReportTypeService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Reviews/ReviewService.cs b/src/Stripe.net/Services/Reviews/ReviewService.cs index d2698085ea..ddec42fcfb 100644 --- a/src/Stripe.net/Services/Reviews/ReviewService.cs +++ b/src/Stripe.net/Services/Reviews/ReviewService.cs @@ -14,8 +14,8 @@ public ReviewService() { } - public ReviewService(string apiKey) - : base(apiKey) + public ReviewService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunService.cs b/src/Stripe.net/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunService.cs index 3a96732067..e0c62f4dca 100644 --- a/src/Stripe.net/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunService.cs +++ b/src/Stripe.net/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunService.cs @@ -13,8 +13,8 @@ public ScheduledQueryRunService() { } - public ScheduledQueryRunService(string apiKey) - : base(apiKey) + public ScheduledQueryRunService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Skus/SkuService.cs b/src/Stripe.net/Services/Skus/SkuService.cs index bd3219cd9a..0889ec7899 100644 --- a/src/Stripe.net/Services/Skus/SkuService.cs +++ b/src/Stripe.net/Services/Skus/SkuService.cs @@ -16,8 +16,8 @@ public SkuService() { } - public SkuService(string apiKey) - : base(apiKey) + public SkuService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/SourceTransactions/SourceTransactionService.cs b/src/Stripe.net/Services/SourceTransactions/SourceTransactionService.cs index 9ed9ece4b7..e71bfdfaf3 100644 --- a/src/Stripe.net/Services/SourceTransactions/SourceTransactionService.cs +++ b/src/Stripe.net/Services/SourceTransactions/SourceTransactionService.cs @@ -12,8 +12,8 @@ public SourceTransactionService() { } - public SourceTransactionService(string apiKey) - : base(apiKey) + public SourceTransactionService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Sources/SourceService.cs b/src/Stripe.net/Services/Sources/SourceService.cs index 8b5a9d765a..4f2952be72 100644 --- a/src/Stripe.net/Services/Sources/SourceService.cs +++ b/src/Stripe.net/Services/Sources/SourceService.cs @@ -17,8 +17,8 @@ public SourceService() { } - public SourceService(string apiKey) - : base(apiKey) + public SourceService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs index 04d6424795..33cd5660fd 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs @@ -16,8 +16,8 @@ public SubscriptionItemService() { } - public SubscriptionItemService(string apiKey) - : base(apiKey) + public SubscriptionItemService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/SubscriptionScheduleRevisions/SubscriptionScheduleRevisionService.cs b/src/Stripe.net/Services/SubscriptionScheduleRevisions/SubscriptionScheduleRevisionService.cs index a56bee3535..ea132def23 100644 --- a/src/Stripe.net/Services/SubscriptionScheduleRevisions/SubscriptionScheduleRevisionService.cs +++ b/src/Stripe.net/Services/SubscriptionScheduleRevisions/SubscriptionScheduleRevisionService.cs @@ -13,8 +13,8 @@ public SubscriptionScheduleRevisionService() { } - public SubscriptionScheduleRevisionService(string apiKey) - : base(apiKey) + public SubscriptionScheduleRevisionService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleService.cs b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleService.cs index 1747e8bfca..fe518ee68e 100644 --- a/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleService.cs +++ b/src/Stripe.net/Services/SubscriptionSchedules/SubscriptionScheduleService.cs @@ -16,8 +16,8 @@ public SubscriptionScheduleService() { } - public SubscriptionScheduleService(string apiKey) - : base(apiKey) + public SubscriptionScheduleService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs b/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs index 63c7d546dc..61e8df3414 100644 --- a/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs +++ b/src/Stripe.net/Services/Subscriptions/SubscriptionService.cs @@ -15,8 +15,8 @@ public SubscriptionService() { } - public SubscriptionService(string apiKey) - : base(apiKey) + public SubscriptionService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/TaxIds/TaxIdService.cs b/src/Stripe.net/Services/TaxIds/TaxIdService.cs index 0954e2b9a8..949775078a 100644 --- a/src/Stripe.net/Services/TaxIds/TaxIdService.cs +++ b/src/Stripe.net/Services/TaxIds/TaxIdService.cs @@ -14,8 +14,8 @@ public TaxIdService() { } - public TaxIdService(string apiKey) - : base(apiKey) + public TaxIdService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/TaxRates/TaxRateService.cs b/src/Stripe.net/Services/TaxRates/TaxRateService.cs index f3f6b91c83..bb0129b0c4 100644 --- a/src/Stripe.net/Services/TaxRates/TaxRateService.cs +++ b/src/Stripe.net/Services/TaxRates/TaxRateService.cs @@ -15,8 +15,8 @@ public TaxRateService() { } - public TaxRateService(string apiKey) - : base(apiKey) + public TaxRateService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Terminal/ConnectionTokens/ConnectionTokenService.cs b/src/Stripe.net/Services/Terminal/ConnectionTokens/ConnectionTokenService.cs index 854cefc631..e67c7f5f7f 100644 --- a/src/Stripe.net/Services/Terminal/ConnectionTokens/ConnectionTokenService.cs +++ b/src/Stripe.net/Services/Terminal/ConnectionTokens/ConnectionTokenService.cs @@ -13,8 +13,8 @@ public ConnectionTokenService() { } - public ConnectionTokenService(string apiKey) - : base(apiKey) + public ConnectionTokenService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationService.cs b/src/Stripe.net/Services/Terminal/Locations/LocationService.cs index 97a664b8dd..e1c86a570c 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationService.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationService.cs @@ -13,8 +13,8 @@ public LocationService() { } - public LocationService(string apiKey) - : base(apiKey) + public LocationService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs index 0da112d071..a1704241cb 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs @@ -13,8 +13,8 @@ public ReaderService() { } - public ReaderService(string apiKey) - : base(apiKey) + public ReaderService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/ThreeDSecure/ThreeDSecureService.cs b/src/Stripe.net/Services/ThreeDSecure/ThreeDSecureService.cs index 635ef33207..a5f7f27e35 100644 --- a/src/Stripe.net/Services/ThreeDSecure/ThreeDSecureService.cs +++ b/src/Stripe.net/Services/ThreeDSecure/ThreeDSecureService.cs @@ -14,8 +14,8 @@ public ThreeDSecureService() { } - public ThreeDSecureService(string apiKey) - : base(apiKey) + public ThreeDSecureService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Tokens/TokenService.cs b/src/Stripe.net/Services/Tokens/TokenService.cs index 5833be2b45..fb5434c343 100644 --- a/src/Stripe.net/Services/Tokens/TokenService.cs +++ b/src/Stripe.net/Services/Tokens/TokenService.cs @@ -13,8 +13,8 @@ public TokenService() { } - public TokenService(string apiKey) - : base(apiKey) + public TokenService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Topups/TopupService.cs b/src/Stripe.net/Services/Topups/TopupService.cs index 131765c633..c057338349 100644 --- a/src/Stripe.net/Services/Topups/TopupService.cs +++ b/src/Stripe.net/Services/Topups/TopupService.cs @@ -16,8 +16,8 @@ public TopupService() { } - public TopupService(string apiKey) - : base(apiKey) + public TopupService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/TransferReversals/TransferReversalService.cs b/src/Stripe.net/Services/TransferReversals/TransferReversalService.cs index 70f2e1167b..f2b13ae95f 100644 --- a/src/Stripe.net/Services/TransferReversals/TransferReversalService.cs +++ b/src/Stripe.net/Services/TransferReversals/TransferReversalService.cs @@ -15,8 +15,8 @@ public TransferReversalService() { } - public TransferReversalService(string apiKey) - : base(apiKey) + public TransferReversalService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/Transfers/TransferService.cs b/src/Stripe.net/Services/Transfers/TransferService.cs index 78e811bae2..ee22b8bb44 100644 --- a/src/Stripe.net/Services/Transfers/TransferService.cs +++ b/src/Stripe.net/Services/Transfers/TransferService.cs @@ -15,8 +15,8 @@ public TransferService() { } - public TransferService(string apiKey) - : base(apiKey) + public TransferService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/UsageRecordSummaries/UsageRecordSummaryService.cs b/src/Stripe.net/Services/UsageRecordSummaries/UsageRecordSummaryService.cs index 72f34c54d3..e12fb0b819 100644 --- a/src/Stripe.net/Services/UsageRecordSummaries/UsageRecordSummaryService.cs +++ b/src/Stripe.net/Services/UsageRecordSummaries/UsageRecordSummaryService.cs @@ -12,8 +12,8 @@ public UsageRecordSummaryService() { } - public UsageRecordSummaryService(string apiKey) - : base(apiKey) + public UsageRecordSummaryService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/UsageRecords/UsageRecordService.cs b/src/Stripe.net/Services/UsageRecords/UsageRecordService.cs index d2bfc70a23..efdaa15d1b 100644 --- a/src/Stripe.net/Services/UsageRecords/UsageRecordService.cs +++ b/src/Stripe.net/Services/UsageRecords/UsageRecordService.cs @@ -13,8 +13,8 @@ public UsageRecordService() { } - public UsageRecordService(string apiKey) - : base(apiKey) + public UsageRecordService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs index eb9dd9beb9..3dd47a9751 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs @@ -16,8 +16,8 @@ public WebhookEndpointService() { } - public WebhookEndpointService(string apiKey) - : base(apiKey) + public WebhookEndpointService(IStripeClient client) + : base(client) { } diff --git a/src/Stripe.net/Services/_base/Service.cs b/src/Stripe.net/Services/_base/Service.cs index eb46b001f6..37d4de8a10 100644 --- a/src/Stripe.net/Services/_base/Service.cs +++ b/src/Stripe.net/Services/_base/Service.cs @@ -10,34 +10,44 @@ namespace Stripe using System.Threading.Tasks; using Stripe.Infrastructure; + /// Abstract base class for all services. + /// + /// The type of that this service returns. + /// public abstract class Service where EntityReturned : IStripeEntity { private IStripeClient client; + /// + /// Initializes a new instance of the class. + /// protected Service() { } - protected Service(string apiKey) + /// + /// Initializes a new instance of the class with a + /// custom . + /// + /// The client used by the service to send requests. + protected Service(IStripeClient client) { - this.ApiKey = apiKey; + this.client = client; } - public string ApiKey { get; set; } - public abstract string BasePath { get; } public virtual string BaseUrl => this.Client.ApiBase; /// - /// Gets or sets the client used by this service to send requests. If null, then the - /// default client in is used instead. + /// Gets the client used by this service to send requests. If no client was set when the + /// service instance was created, then the default client in + /// is used instead. /// public IStripeClient Client { get => this.client ?? StripeConfiguration.StripeClient; - set => this.client = value; } protected EntityReturned CreateEntity(BaseOptions options, RequestOptions requestOptions) @@ -290,11 +300,6 @@ protected RequestOptions SetupRequestOptions(RequestOptions requestOptions) requestOptions = new RequestOptions(); } - if (string.IsNullOrEmpty(requestOptions.ApiKey) && !string.IsNullOrEmpty(this.ApiKey)) - { - requestOptions.ApiKey = this.ApiKey; - } - requestOptions.BaseUrl = requestOptions.BaseUrl ?? this.BaseUrl; return requestOptions; diff --git a/src/Stripe.net/Services/_base/ServiceNested.cs b/src/Stripe.net/Services/_base/ServiceNested.cs index b1621cd192..48a8ef823a 100644 --- a/src/Stripe.net/Services/_base/ServiceNested.cs +++ b/src/Stripe.net/Services/_base/ServiceNested.cs @@ -15,8 +15,8 @@ protected ServiceNested() { } - protected ServiceNested(string apiKey) - : base(apiKey) + protected ServiceNested(IStripeClient client) + : base(client) { } diff --git a/src/StripeTests/Functional/NetworkRetriesTest.cs b/src/StripeTests/Functional/NetworkRetriesTest.cs index 5411c6c1ed..941113f966 100644 --- a/src/StripeTests/Functional/NetworkRetriesTest.cs +++ b/src/StripeTests/Functional/NetworkRetriesTest.cs @@ -47,7 +47,7 @@ public void RetryOnConflict() })) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var balance = service.Get(); Assert.NotNull(balance); @@ -74,7 +74,7 @@ public void RetryOnServiceUnavailable() })) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var balance = service.Get(); Assert.NotNull(balance); @@ -101,7 +101,7 @@ public void RetryOnInternalServerErrorIfNotPost() })) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var balance = service.Get(); Assert.NotNull(balance); @@ -128,7 +128,7 @@ public void DoNotRetryOnInternalServerErrorIfPost() }) .Throws(new StripeTestException("Unexpected invocation")); - var service = new CustomerService { Client = this.StripeClient }; + var service = new CustomerService(this.StripeClient); Assert.Throws(() => service.Create(null)); Assert.Equal(1, requestCount); @@ -150,7 +150,7 @@ public void RetryOnHttpRequestException() })) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var balance = service.Get(); Assert.NotNull(balance); @@ -170,7 +170,7 @@ public void RethrowHttpRequestExceptionAfterAllAttempts() .Throws(new HttpRequestException("Connection error 3")) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var exception = Assert.Throws(() => service.Get()); Assert.NotNull(exception); @@ -193,7 +193,7 @@ public void RetryOnTimeout() })) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var balance = service.Get(); Assert.NotNull(balance); @@ -213,7 +213,7 @@ public void RethrowTimeoutExceptionAfterAllAttempts() .Throws(new TaskCanceledException("Timeout 3")) .Throws(new StripeTestException("Unexpected invocation")); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var exception = Assert.Throws(() => service.Get()); Assert.NotNull(exception); @@ -239,7 +239,7 @@ public async Task DoNotRetryOnCancel() }; }); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); var source = new CancellationTokenSource(); source.CancelAfter(TimeSpan.FromMilliseconds(10)); await Assert.ThrowsAsync(async () => diff --git a/src/StripeTests/Functional/TelemetryTest.cs b/src/StripeTests/Functional/TelemetryTest.cs index dcbaf3ff57..1920430490 100644 --- a/src/StripeTests/Functional/TelemetryTest.cs +++ b/src/StripeTests/Functional/TelemetryTest.cs @@ -28,7 +28,7 @@ public void TelemetryWorks() var fakeServer = FakeServer.ForMockHandler(this.MockHttpClientFixture.MockHandler); fakeServer.Delay = TimeSpan.FromMilliseconds(20); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); service.Get(); fakeServer.Delay = TimeSpan.FromMilliseconds(40); service.Get(); @@ -72,7 +72,7 @@ public async Task TelemetryWorksWithConcurrentRequests() var fakeServer = FakeServer.ForMockHandler(this.MockHttpClientFixture.MockHandler); fakeServer.Delay = TimeSpan.FromMilliseconds(20); - var service = new BalanceService { Client = this.StripeClient }; + var service = new BalanceService(this.StripeClient); // the first 2 requests will not contain telemetry await Task.WhenAll(service.GetAsync(), service.GetAsync()); diff --git a/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs b/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs index 7b30b4b9f4..88e439863c 100644 --- a/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs +++ b/src/StripeTests/Infrastructure/Public/StripeResponseTest.cs @@ -22,7 +22,7 @@ public StripeResponseTest(StripeMockFixture stripeMockFixture) [Fact] public void Date() { - var response = new AccountService { Client = this.StripeClient }.GetSelf().StripeResponse; + var response = new AccountService(this.StripeClient).GetSelf().StripeResponse; Assert.NotNull(response.Date); } @@ -31,7 +31,7 @@ public void Date() public void IdempotencyKey_Present() { var requestOptions = new RequestOptions { IdempotencyKey = "idempotency_key" }; - var response = new AccountService { Client = this.StripeClient }.GetSelf(requestOptions).StripeResponse; + var response = new AccountService(this.StripeClient).GetSelf(requestOptions).StripeResponse; Assert.Equal("idempotency_key", response.IdempotencyKey); } @@ -39,7 +39,7 @@ public void IdempotencyKey_Present() [Fact] public void IdempotencyKey_Absent() { - var response = new AccountService { Client = this.StripeClient }.GetSelf().StripeResponse; + var response = new AccountService(this.StripeClient).GetSelf().StripeResponse; Assert.Null(response.IdempotencyKey); } @@ -47,7 +47,7 @@ public void IdempotencyKey_Absent() [Fact] public void RequestId() { - var response = new AccountService { Client = this.StripeClient }.GetSelf().StripeResponse; + var response = new AccountService(this.StripeClient).GetSelf().StripeResponse; Assert.NotNull(response.RequestId); } diff --git a/src/StripeTests/Infrastructure/StripeExceptionTest.cs b/src/StripeTests/Infrastructure/StripeExceptionTest.cs index 5b7e47f7e9..ad9276db0c 100644 --- a/src/StripeTests/Infrastructure/StripeExceptionTest.cs +++ b/src/StripeTests/Infrastructure/StripeExceptionTest.cs @@ -16,7 +16,7 @@ public async Task SetsStripeResponse() { var exception = await Assert.ThrowsAsync(async () => { - await new CouponService { Client = this.StripeClient } + await new CouponService(this.StripeClient) .CreateAsync(new CouponCreateOptions()); }); diff --git a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs index 8a5a2b3ca9..a9c1a42f7a 100644 --- a/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs +++ b/src/StripeTests/Services/AccountLinks/AccountLinkServiceTest.cs @@ -17,7 +17,7 @@ public AccountLinkServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new AccountLinkService { Client = this.StripeClient }; + this.service = new AccountLinkService(this.StripeClient); this.createOptions = new AccountLinkCreateOptions { diff --git a/src/StripeTests/Services/Accounts/AccountServiceTest.cs b/src/StripeTests/Services/Accounts/AccountServiceTest.cs index bcb3a403ae..e72b21fe99 100644 --- a/src/StripeTests/Services/Accounts/AccountServiceTest.cs +++ b/src/StripeTests/Services/Accounts/AccountServiceTest.cs @@ -24,7 +24,7 @@ public AccountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new AccountService { Client = this.StripeClient }; + this.service = new AccountService(this.StripeClient); this.createOptions = new AccountCreateOptions { diff --git a/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs b/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs index 4c62d2b767..20572ea9d1 100644 --- a/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs +++ b/src/StripeTests/Services/ApplePayDomains/ApplePayDomainServiceTest.cs @@ -20,7 +20,7 @@ public ApplePayDomainServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ApplePayDomainService { Client = this.StripeClient }; + this.service = new ApplePayDomainService(this.StripeClient); this.createOptions = new ApplePayDomainCreateOptions { diff --git a/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs b/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs index cf266704fa..6393ff1da2 100644 --- a/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs +++ b/src/StripeTests/Services/ApplicationFeeRefunds/ApplicationFeeRefundServiceTest.cs @@ -23,7 +23,7 @@ public ApplicationFeeRefundServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ApplicationFeeRefundService { Client = this.StripeClient }; + this.service = new ApplicationFeeRefundService(this.StripeClient); this.createOptions = new ApplicationFeeRefundCreateOptions { diff --git a/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs b/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs index 8a33357bc8..1a67b0a2df 100644 --- a/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs +++ b/src/StripeTests/Services/ApplicationFees/ApplicationFeeServiceTest.cs @@ -19,7 +19,7 @@ public ApplicationFeeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ApplicationFeeService { Client = this.StripeClient }; + this.service = new ApplicationFeeService(this.StripeClient); this.listOptions = new ApplicationFeeListOptions { diff --git a/src/StripeTests/Services/AutoPagingTest.cs b/src/StripeTests/Services/AutoPagingTest.cs index 51e0a9a964..7bc15ba81b 100644 --- a/src/StripeTests/Services/AutoPagingTest.cs +++ b/src/StripeTests/Services/AutoPagingTest.cs @@ -43,7 +43,7 @@ public void ListAutoPaging() .Throws(new StripeTestException("Unexpected invocation!")); // Call auto-paging method - var service = new PageableService { Client = this.StripeClient }; + var service = new PageableService(this.StripeClient); var options = new ListOptions { Limit = 2, @@ -98,6 +98,11 @@ public class PageableModel : StripeEntity, IHasId public class PageableService : Service { + public PageableService(IStripeClient client) + : base(client) + { + } + public override string BasePath => "/v1/pageablemodels"; public IEnumerable ListAutoPaging(ListOptions options) diff --git a/src/StripeTests/Services/Balance/BalanceServiceTest.cs b/src/StripeTests/Services/Balance/BalanceServiceTest.cs index f9bc07e67d..d375d9c651 100644 --- a/src/StripeTests/Services/Balance/BalanceServiceTest.cs +++ b/src/StripeTests/Services/Balance/BalanceServiceTest.cs @@ -16,7 +16,7 @@ public BalanceServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new BalanceService { Client = this.StripeClient }; + this.service = new BalanceService(this.StripeClient); } [Fact] diff --git a/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs b/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs index 9411fb8ba8..462f1f1e27 100644 --- a/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs +++ b/src/StripeTests/Services/BalanceTransactions/BalanceTransactionServiceTest.cs @@ -19,7 +19,7 @@ public BalanceTransactionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new BalanceTransactionService { Client = this.StripeClient }; + this.service = new BalanceTransactionService(this.StripeClient); this.listOptions = new BalanceTransactionListOptions { diff --git a/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs b/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs index 767ef95448..f9ded388ba 100644 --- a/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs +++ b/src/StripeTests/Services/BankAccounts/BankAccountServiceTest.cs @@ -24,7 +24,7 @@ public BankAccountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new BankAccountService { Client = this.StripeClient }; + this.service = new BankAccountService(this.StripeClient); this.createOptions = new BankAccountCreateOptions { diff --git a/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs b/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs index 0152f19efd..a0038f61af 100644 --- a/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs +++ b/src/StripeTests/Services/Capabilities/CapabilityServiceTest.cs @@ -21,7 +21,7 @@ public CapabilityServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CapabilityService { Client = this.StripeClient }; + this.service = new CapabilityService(this.StripeClient); this.updateOptions = new CapabilityUpdateOptions { diff --git a/src/StripeTests/Services/Cards/CardServiceTest.cs b/src/StripeTests/Services/Cards/CardServiceTest.cs index a54dfe870e..7f1599b597 100644 --- a/src/StripeTests/Services/Cards/CardServiceTest.cs +++ b/src/StripeTests/Services/Cards/CardServiceTest.cs @@ -27,7 +27,7 @@ public CardServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CardService { Client = this.StripeClient }; + this.service = new CardService(this.StripeClient); this.createOptions = new CardCreateOptions { diff --git a/src/StripeTests/Services/Charges/ChargeServiceTest.cs b/src/StripeTests/Services/Charges/ChargeServiceTest.cs index 4a3b4c9867..3f32d811f4 100644 --- a/src/StripeTests/Services/Charges/ChargeServiceTest.cs +++ b/src/StripeTests/Services/Charges/ChargeServiceTest.cs @@ -23,7 +23,7 @@ public ChargeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ChargeService { Client = this.StripeClient }; + this.service = new ChargeService(this.StripeClient); this.captureOptions = new ChargeCaptureOptions { diff --git a/src/StripeTests/Services/Checkout/SessionServiceTest.cs b/src/StripeTests/Services/Checkout/SessionServiceTest.cs index ad47259e9e..e9caa685e8 100644 --- a/src/StripeTests/Services/Checkout/SessionServiceTest.cs +++ b/src/StripeTests/Services/Checkout/SessionServiceTest.cs @@ -19,7 +19,7 @@ public SessionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SessionService { Client = this.StripeClient }; + this.service = new SessionService(this.StripeClient); this.createOptions = new SessionCreateOptions { diff --git a/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs b/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs index 219a0cd0ba..4b51db8d27 100644 --- a/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs +++ b/src/StripeTests/Services/CountrySpecs/CountrySpecServiceTest.cs @@ -19,7 +19,7 @@ public CountrySpecServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CountrySpecService { Client = this.StripeClient }; + this.service = new CountrySpecService(this.StripeClient); this.listOptions = new CountrySpecListOptions { diff --git a/src/StripeTests/Services/Coupons/CouponServiceTest.cs b/src/StripeTests/Services/Coupons/CouponServiceTest.cs index d760f788c8..b914294043 100644 --- a/src/StripeTests/Services/Coupons/CouponServiceTest.cs +++ b/src/StripeTests/Services/Coupons/CouponServiceTest.cs @@ -22,7 +22,7 @@ public CouponServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CouponService { Client = this.StripeClient }; + this.service = new CouponService(this.StripeClient); this.createOptions = new CouponCreateOptions { diff --git a/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs b/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs index 0321cf2b04..9f91aafa93 100644 --- a/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs +++ b/src/StripeTests/Services/CreditNotes/CreditNoteServiceTest.cs @@ -23,7 +23,7 @@ public CreditNoteServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CreditNoteService { Client = this.StripeClient }; + this.service = new CreditNoteService(this.StripeClient); this.createOptions = new CreditNoteCreateOptions { diff --git a/src/StripeTests/Services/Customers/CustomerServiceTest.cs b/src/StripeTests/Services/Customers/CustomerServiceTest.cs index 0e3e162eaa..e86cf7a2f1 100644 --- a/src/StripeTests/Services/Customers/CustomerServiceTest.cs +++ b/src/StripeTests/Services/Customers/CustomerServiceTest.cs @@ -22,7 +22,7 @@ public CustomerServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CustomerService { Client = this.StripeClient }; + this.service = new CustomerService(this.StripeClient); this.createOptions = new CustomerCreateOptions { diff --git a/src/StripeTests/Services/Discounts/DiscountServiceTest.cs b/src/StripeTests/Services/Discounts/DiscountServiceTest.cs index 45489ce179..c893f8405b 100644 --- a/src/StripeTests/Services/Discounts/DiscountServiceTest.cs +++ b/src/StripeTests/Services/Discounts/DiscountServiceTest.cs @@ -16,7 +16,7 @@ public DiscountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new DiscountService { Client = this.StripeClient }; + this.service = new DiscountService(this.StripeClient); } [Fact] diff --git a/src/StripeTests/Services/Disputes/DisputeServiceTest.cs b/src/StripeTests/Services/Disputes/DisputeServiceTest.cs index 0aff50ad86..df03be3706 100644 --- a/src/StripeTests/Services/Disputes/DisputeServiceTest.cs +++ b/src/StripeTests/Services/Disputes/DisputeServiceTest.cs @@ -21,7 +21,7 @@ public DisputeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new DisputeService { Client = this.StripeClient }; + this.service = new DisputeService(this.StripeClient); this.updateOptions = new DisputeUpdateOptions { diff --git a/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs b/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs index 80ec4bcb6a..80b262b727 100644 --- a/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs +++ b/src/StripeTests/Services/EphemeralKeys/EphemeralKeyServiceTest.cs @@ -19,7 +19,7 @@ public EphemeralKeyServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new EphemeralKeyService { Client = this.StripeClient }; + this.service = new EphemeralKeyService(this.StripeClient); this.createOptions = new EphemeralKeyCreateOptions { diff --git a/src/StripeTests/Services/Events/EventServiceTest.cs b/src/StripeTests/Services/Events/EventServiceTest.cs index 539c1acbd1..0e4f0bf8c3 100644 --- a/src/StripeTests/Services/Events/EventServiceTest.cs +++ b/src/StripeTests/Services/Events/EventServiceTest.cs @@ -19,7 +19,7 @@ public EventServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new EventService { Client = this.StripeClient }; + this.service = new EventService(this.StripeClient); this.listOptions = new EventListOptions { diff --git a/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs b/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs index 319e3ab1b8..950a549271 100644 --- a/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs +++ b/src/StripeTests/Services/ExchangeRates/ExchangeRateServiceTest.cs @@ -17,7 +17,7 @@ public ExchangeRateServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ExchangeRateService { Client = this.StripeClient }; + this.service = new ExchangeRateService(this.StripeClient); this.listOptions = new ExchangeRateListOptions { diff --git a/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs b/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs index 0fce68a09e..ae20a45126 100644 --- a/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs +++ b/src/StripeTests/Services/ExternalAccounts/ExternalAccountServiceTest.cs @@ -23,7 +23,7 @@ public ExternalAccountServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ExternalAccountService { Client = this.StripeClient }; + this.service = new ExternalAccountService(this.StripeClient); this.createOptions = new ExternalAccountCreateOptions { diff --git a/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs b/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs index 8a8844e439..c471c97227 100644 --- a/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs +++ b/src/StripeTests/Services/FileLinks/FileLinkServiceTest.cs @@ -22,7 +22,7 @@ public FileLinkServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new FileLinkService { Client = this.StripeClient }; + this.service = new FileLinkService(this.StripeClient); this.createOptions = new FileLinkCreateOptions { diff --git a/src/StripeTests/Services/Files/FileServiceTest.cs b/src/StripeTests/Services/Files/FileServiceTest.cs index 660528fd85..1b629b6719 100644 --- a/src/StripeTests/Services/Files/FileServiceTest.cs +++ b/src/StripeTests/Services/Files/FileServiceTest.cs @@ -23,7 +23,7 @@ public FileServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new FileService { Client = this.StripeClient }; + this.service = new FileService(this.StripeClient); this.createOptions = new FileCreateOptions { diff --git a/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs b/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs index 5c3d5105fa..4878c5e0ce 100644 --- a/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs +++ b/src/StripeTests/Services/InvoiceItems/InvoiceItemServiceTest.cs @@ -22,7 +22,7 @@ public InvoiceItemServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new InvoiceItemService { Client = this.StripeClient }; + this.service = new InvoiceItemService(this.StripeClient); this.createOptions = new InvoiceItemCreateOptions { diff --git a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs index 97d919cef0..263390f593 100644 --- a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs +++ b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs @@ -30,7 +30,7 @@ public InvoiceServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new InvoiceService { Client = this.StripeClient }; + this.service = new InvoiceService(this.StripeClient); this.createOptions = new InvoiceCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs b/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs index 0b9b770001..1e2d785bc7 100644 --- a/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Authorizations/AuthorizationServiceTest.cs @@ -21,7 +21,7 @@ public AuthorizationServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new AuthorizationService { Client = this.StripeClient }; + this.service = new AuthorizationService(this.StripeClient); this.updateOptions = new AuthorizationUpdateOptions { diff --git a/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs b/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs index b476baf70b..ff08490954 100644 --- a/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Cardholders/CardholderServiceTest.cs @@ -23,7 +23,7 @@ public CardholderServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CardholderService { Client = this.StripeClient }; + this.service = new CardholderService(this.StripeClient); this.createOptions = new CardholderCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs b/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs index 5ee5363523..c1f2983acb 100644 --- a/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Cards/IssuingCardServiceTest.cs @@ -22,7 +22,7 @@ public IssuingCardServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new CardService { Client = this.StripeClient }; + this.service = new CardService(this.StripeClient); this.createOptions = new CardCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs b/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs index 2e7bcb0717..2a831dcf0c 100644 --- a/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Disputes/IssuingDisputeServiceTest.cs @@ -22,7 +22,7 @@ public IssuingDisputeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new DisputeService { Client = this.StripeClient }; + this.service = new DisputeService(this.StripeClient); this.createOptions = new DisputeCreateOptions { diff --git a/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs b/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs index 0f5241c825..a1ba17c174 100644 --- a/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs +++ b/src/StripeTests/Services/Issuing/Transactions/TransactionServiceTest.cs @@ -21,7 +21,7 @@ public TransactionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TransactionService { Client = this.StripeClient }; + this.service = new TransactionService(this.StripeClient); this.updateOptions = new TransactionUpdateOptions { diff --git a/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs b/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs index 308951d78f..5485d9c406 100644 --- a/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs +++ b/src/StripeTests/Services/LoginLinks/LoginLinkServiceTest.cs @@ -19,7 +19,7 @@ public LoginLinkServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new LoginLinkService { Client = this.StripeClient }; + this.service = new LoginLinkService(this.StripeClient); this.createOptions = new LoginLinkCreateOptions { diff --git a/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs b/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs index 973e3e0870..2221d4d458 100644 --- a/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs +++ b/src/StripeTests/Services/OAuth/OAuthTokenServiceTest.cs @@ -24,7 +24,7 @@ public OAuthTokenServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new OAuthTokenService { Client = this.StripeClient }; + this.service = new OAuthTokenService(this.StripeClient); this.createOptions = new OAuthTokenCreateOptions { diff --git a/src/StripeTests/Services/Orders/OrderServiceTest.cs b/src/StripeTests/Services/Orders/OrderServiceTest.cs index 7de8948d2b..b8cfb7ab1f 100644 --- a/src/StripeTests/Services/Orders/OrderServiceTest.cs +++ b/src/StripeTests/Services/Orders/OrderServiceTest.cs @@ -23,7 +23,7 @@ public OrderServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new OrderService { Client = this.StripeClient }; + this.service = new OrderService(this.StripeClient); this.createOptions = new OrderCreateOptions { diff --git a/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs b/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs index 60b94c5801..72b227f04a 100644 --- a/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs +++ b/src/StripeTests/Services/PaymentIntents/PaymentIntentServiceTest.cs @@ -25,7 +25,7 @@ public PaymentIntentServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PaymentIntentService { Client = this.StripeClient }; + this.service = new PaymentIntentService(this.StripeClient); this.cancelOptions = new PaymentIntentCancelOptions { diff --git a/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs b/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs index ab25def79c..d68e728549 100644 --- a/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs +++ b/src/StripeTests/Services/PaymentMethods/PaymentMethodServiceTest.cs @@ -24,7 +24,7 @@ public PaymentMethodServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PaymentMethodService { Client = this.StripeClient }; + this.service = new PaymentMethodService(this.StripeClient); this.attachOptions = new PaymentMethodAttachOptions { diff --git a/src/StripeTests/Services/Payouts/PayoutServiceTest.cs b/src/StripeTests/Services/Payouts/PayoutServiceTest.cs index 619c3fe8a2..a45069bbbc 100644 --- a/src/StripeTests/Services/Payouts/PayoutServiceTest.cs +++ b/src/StripeTests/Services/Payouts/PayoutServiceTest.cs @@ -22,7 +22,7 @@ public PayoutServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PayoutService { Client = this.StripeClient }; + this.service = new PayoutService(this.StripeClient); this.createOptions = new PayoutCreateOptions { diff --git a/src/StripeTests/Services/Persons/PersonServiceTest.cs b/src/StripeTests/Services/Persons/PersonServiceTest.cs index 8f669939a5..ea0fe30964 100644 --- a/src/StripeTests/Services/Persons/PersonServiceTest.cs +++ b/src/StripeTests/Services/Persons/PersonServiceTest.cs @@ -22,7 +22,7 @@ public PersonServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PersonService { Client = this.StripeClient }; + this.service = new PersonService(this.StripeClient); this.createOptions = new PersonCreateOptions { diff --git a/src/StripeTests/Services/Plans/PlanServiceTest.cs b/src/StripeTests/Services/Plans/PlanServiceTest.cs index 34464774dc..fe7db49213 100644 --- a/src/StripeTests/Services/Plans/PlanServiceTest.cs +++ b/src/StripeTests/Services/Plans/PlanServiceTest.cs @@ -22,7 +22,7 @@ public PlanServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new PlanService { Client = this.StripeClient }; + this.service = new PlanService(this.StripeClient); this.createOptions = new PlanCreateOptions { diff --git a/src/StripeTests/Services/Products/ProductServiceTest.cs b/src/StripeTests/Services/Products/ProductServiceTest.cs index 8090bb4615..1fb8cca265 100644 --- a/src/StripeTests/Services/Products/ProductServiceTest.cs +++ b/src/StripeTests/Services/Products/ProductServiceTest.cs @@ -22,7 +22,7 @@ public ProductServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ProductService { Client = this.StripeClient }; + this.service = new ProductService(this.StripeClient); this.createOptions = new ProductCreateOptions { diff --git a/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs b/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs index 0d5eb893b6..8aebdda11d 100644 --- a/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs +++ b/src/StripeTests/Services/Radar/EarlyFraudWarnings/EarlyFraudWarningServiceTest.cs @@ -20,7 +20,7 @@ public EarlyFraudWarningServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new EarlyFraudWarningService { Client = this.StripeClient }; + this.service = new EarlyFraudWarningService(this.StripeClient); this.listOptions = new EarlyFraudWarningListOptions { diff --git a/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs b/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs index fdc43e73a3..7a7adfe518 100644 --- a/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs +++ b/src/StripeTests/Services/Radar/ValueListItems/ValueListItemServiceTest.cs @@ -20,7 +20,7 @@ public ValueListItemServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ValueListItemService { Client = this.StripeClient }; + this.service = new ValueListItemService(this.StripeClient); this.createOptions = new ValueListItemCreateOptions { diff --git a/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs b/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs index 5510f1b620..94cb862831 100644 --- a/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs +++ b/src/StripeTests/Services/Radar/ValueLists/ValueListServiceTest.cs @@ -22,7 +22,7 @@ public ValueListServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ValueListService { Client = this.StripeClient }; + this.service = new ValueListService(this.StripeClient); this.createOptions = new ValueListCreateOptions { diff --git a/src/StripeTests/Services/Refunds/RefundServiceTest.cs b/src/StripeTests/Services/Refunds/RefundServiceTest.cs index dfaa534329..5a306772fb 100644 --- a/src/StripeTests/Services/Refunds/RefundServiceTest.cs +++ b/src/StripeTests/Services/Refunds/RefundServiceTest.cs @@ -22,7 +22,7 @@ public RefundServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new RefundService { Client = this.StripeClient }; + this.service = new RefundService(this.StripeClient); this.createOptions = new RefundCreateOptions { diff --git a/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs b/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs index a3548d8a07..7df6e9b703 100644 --- a/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs +++ b/src/StripeTests/Services/Reporting/ReportRuns/ReportRunServiceTest.cs @@ -21,7 +21,7 @@ public ReportRunServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReportRunService { Client = this.StripeClient }; + this.service = new ReportRunService(this.StripeClient); this.createOptions = new ReportRunCreateOptions { diff --git a/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs b/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs index 412eebc466..cb5dfd8707 100644 --- a/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs +++ b/src/StripeTests/Services/Reporting/ReportTypes/ReportTypeServiceTest.cs @@ -19,7 +19,7 @@ public ReportTypeServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReportTypeService { Client = this.StripeClient }; + this.service = new ReportTypeService(this.StripeClient); this.listOptions = new ReportTypeListOptions { diff --git a/src/StripeTests/Services/Reviews/ReviewServiceTest.cs b/src/StripeTests/Services/Reviews/ReviewServiceTest.cs index 75f749b562..d6a3bb31ed 100644 --- a/src/StripeTests/Services/Reviews/ReviewServiceTest.cs +++ b/src/StripeTests/Services/Reviews/ReviewServiceTest.cs @@ -20,7 +20,7 @@ public ReviewServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReviewService { Client = this.StripeClient }; + this.service = new ReviewService(this.StripeClient); this.approveOptions = new ReviewApproveOptions { diff --git a/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs b/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs index de72d04ec3..6e19e1cdbf 100644 --- a/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs +++ b/src/StripeTests/Services/Sigma/ScheduledQueryRuns/ScheduledQueryRunServiceTest.cs @@ -19,7 +19,7 @@ public ScheduledQueryRunServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ScheduledQueryRunService { Client = this.StripeClient }; + this.service = new ScheduledQueryRunService(this.StripeClient); this.listOptions = new ScheduledQueryRunListOptions { diff --git a/src/StripeTests/Services/Skus/SkuServiceTest.cs b/src/StripeTests/Services/Skus/SkuServiceTest.cs index 3e86050e7b..dd6bf487a0 100644 --- a/src/StripeTests/Services/Skus/SkuServiceTest.cs +++ b/src/StripeTests/Services/Skus/SkuServiceTest.cs @@ -22,7 +22,7 @@ public SkuServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SkuService { Client = this.StripeClient }; + this.service = new SkuService(this.StripeClient); this.createOptions = new SkuCreateOptions { diff --git a/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs b/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs index 56f09e8ffd..6647e508eb 100644 --- a/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs +++ b/src/StripeTests/Services/SourceTransactions/SourceTransactionServiceTest.cs @@ -19,7 +19,7 @@ public SourceTransactionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SourceTransactionService { Client = this.StripeClient }; + this.service = new SourceTransactionService(this.StripeClient); this.listOptions = new SourceTransactionsListOptions { diff --git a/src/StripeTests/Services/Sources/SourceServiceTest.cs b/src/StripeTests/Services/Sources/SourceServiceTest.cs index 9045c04689..a9d02ee817 100644 --- a/src/StripeTests/Services/Sources/SourceServiceTest.cs +++ b/src/StripeTests/Services/Sources/SourceServiceTest.cs @@ -26,7 +26,7 @@ public SourceServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SourceService { Client = this.StripeClient }; + this.service = new SourceService(this.StripeClient); this.attachOptions = new SourceAttachOptions { diff --git a/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs b/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs index c1a8424479..c3aa572e99 100644 --- a/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs @@ -22,7 +22,7 @@ public SubscriptionItemServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionItemService { Client = this.StripeClient }; + this.service = new SubscriptionItemService(this.StripeClient); this.createOptions = new SubscriptionItemCreateOptions { diff --git a/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs b/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs index cc16255fe2..ed50fdcf82 100644 --- a/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionScheduleRevisions.cs/SubscriptionScheduleRevisionServiceTest.cs @@ -20,7 +20,7 @@ public SubscriptionScheduleRevisionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionScheduleRevisionService { Client = this.StripeClient }; + this.service = new SubscriptionScheduleRevisionService(this.StripeClient); this.listOptions = new SubscriptionScheduleRevisionListOptions { diff --git a/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs b/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs index c8fdff6deb..a248f1836a 100644 --- a/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionSchedules/SubscriptionScheduleServiceTest.cs @@ -24,7 +24,7 @@ public SubscriptionScheduleServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionScheduleService { Client = this.StripeClient }; + this.service = new SubscriptionScheduleService(this.StripeClient); this.cancelOptions = new SubscriptionScheduleCancelOptions { diff --git a/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs b/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs index 7b69b2939b..72404e7b35 100644 --- a/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs +++ b/src/StripeTests/Services/Subscriptions/SubscriptionServiceTest.cs @@ -23,7 +23,7 @@ public SubscriptionServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new SubscriptionService { Client = this.StripeClient }; + this.service = new SubscriptionService(this.StripeClient); this.cancelOptions = new SubscriptionCancelOptions { diff --git a/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs b/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs index 94e7ca3f70..a3b0f799e0 100644 --- a/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs +++ b/src/StripeTests/Services/TaxIds/TaxIdServiceTest.cs @@ -21,7 +21,7 @@ public TaxIdServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TaxIdService { Client = this.StripeClient }; + this.service = new TaxIdService(this.StripeClient); this.createOptions = new TaxIdCreateOptions { diff --git a/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs b/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs index cd771d0a75..c6ac710927 100644 --- a/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs +++ b/src/StripeTests/Services/TaxRates/TaxRateServiceTest.cs @@ -22,7 +22,7 @@ public TaxRateServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TaxRateService { Client = this.StripeClient }; + this.service = new TaxRateService(this.StripeClient); this.createOptions = new TaxRateCreateOptions { diff --git a/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs b/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs index 9b2c5c117a..6fc0c40fb1 100644 --- a/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs +++ b/src/StripeTests/Services/Terminal/ConnectionTokens/ConnectionTokenServiceTest.cs @@ -18,7 +18,7 @@ public ConnectionTokenServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ConnectionTokenService { Client = this.StripeClient }; + this.service = new ConnectionTokenService(this.StripeClient); this.createOptions = new ConnectionTokenCreateOptions { diff --git a/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs b/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs index 61c0a6003a..d594f47cce 100644 --- a/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs +++ b/src/StripeTests/Services/Terminal/Locations/LocationServiceTest.cs @@ -23,7 +23,7 @@ public LocationServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new LocationService { Client = this.StripeClient }; + this.service = new LocationService(this.StripeClient); this.createOptions = new LocationCreateOptions { diff --git a/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs b/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs index 02c433d30a..0b0e9ba6a4 100644 --- a/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs +++ b/src/StripeTests/Services/Terminal/Readers/ReaderServiceTest.cs @@ -22,7 +22,7 @@ public ReaderServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ReaderService { Client = this.StripeClient }; + this.service = new ReaderService(this.StripeClient); this.createOptions = new ReaderCreateOptions { diff --git a/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs b/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs index db0da736db..e7aa8e8cb8 100644 --- a/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs +++ b/src/StripeTests/Services/ThreeDSecure/ThreeDSecureServiceTest.cs @@ -17,7 +17,7 @@ public ThreeDSecureServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new ThreeDSecureService { Client = this.StripeClient }; + this.service = new ThreeDSecureService(this.StripeClient); this.createOptions = new ThreeDSecureCreateOptions { diff --git a/src/StripeTests/Services/Tokens/TokenServiceTest.cs b/src/StripeTests/Services/Tokens/TokenServiceTest.cs index 7c1e098853..515ec0ec26 100644 --- a/src/StripeTests/Services/Tokens/TokenServiceTest.cs +++ b/src/StripeTests/Services/Tokens/TokenServiceTest.cs @@ -20,7 +20,7 @@ public TokenServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TokenService { Client = this.StripeClient }; + this.service = new TokenService(this.StripeClient); this.createOptions = new TokenCreateOptions { diff --git a/src/StripeTests/Services/Topups/TopupServiceTest.cs b/src/StripeTests/Services/Topups/TopupServiceTest.cs index f5e33d87e2..7f925dc8de 100644 --- a/src/StripeTests/Services/Topups/TopupServiceTest.cs +++ b/src/StripeTests/Services/Topups/TopupServiceTest.cs @@ -22,7 +22,7 @@ public TopupServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TopupService { Client = this.StripeClient }; + this.service = new TopupService(this.StripeClient); this.createOptions = new TopupCreateOptions { diff --git a/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs b/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs index 192b4c54b3..fdeaaee46f 100644 --- a/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs +++ b/src/StripeTests/Services/TransferReversals/TransferReversalServiceTest.cs @@ -23,7 +23,7 @@ public TransferReversalServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TransferReversalService { Client = this.StripeClient }; + this.service = new TransferReversalService(this.StripeClient); this.createOptions = new TransferReversalCreateOptions { diff --git a/src/StripeTests/Services/Transfers/TransferServiceTest.cs b/src/StripeTests/Services/Transfers/TransferServiceTest.cs index dfe4f63e52..d648e64750 100644 --- a/src/StripeTests/Services/Transfers/TransferServiceTest.cs +++ b/src/StripeTests/Services/Transfers/TransferServiceTest.cs @@ -22,7 +22,7 @@ public TransferServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new TransferService { Client = this.StripeClient }; + this.service = new TransferService(this.StripeClient); this.createOptions = new TransferCreateOptions { diff --git a/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs b/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs index 1a2d89a8d5..572dc876b5 100644 --- a/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs +++ b/src/StripeTests/Services/UsageRecordSummaries/UsageRecordSummaryServiceTest.cs @@ -18,7 +18,7 @@ public UsageRecordSummaryServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new UsageRecordSummaryService { Client = this.StripeClient }; + this.service = new UsageRecordSummaryService(this.StripeClient); this.listOptions = new UsageRecordSummaryListOptions { diff --git a/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs b/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs index 010835066a..92f023d8df 100644 --- a/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs +++ b/src/StripeTests/Services/UsageRecords/UsageRecordServiceTest.cs @@ -18,7 +18,7 @@ public UsageRecordServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new UsageRecordService { Client = this.StripeClient }; + this.service = new UsageRecordService(this.StripeClient); this.createOptions = new UsageRecordCreateOptions { diff --git a/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs b/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs index 403ee861dd..e2460baf25 100644 --- a/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs +++ b/src/StripeTests/Services/WebhookEndpoints/WebhookEndpointServiceTest.cs @@ -22,7 +22,7 @@ public WebhookEndpointServiceTest( MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { - this.service = new WebhookEndpointService { Client = this.StripeClient }; + this.service = new WebhookEndpointService(this.StripeClient); this.createOptions = new WebhookEndpointCreateOptions { diff --git a/src/StripeTests/Services/_base/ServiceTest.cs b/src/StripeTests/Services/_base/ServiceTest.cs index 58041c87ee..2a9b9dea8e 100644 --- a/src/StripeTests/Services/_base/ServiceTest.cs +++ b/src/StripeTests/Services/_base/ServiceTest.cs @@ -15,7 +15,7 @@ public class ServiceTest : BaseStripeTest public void Get_ExpandProperties() { var client = new TestClient(); - var service = new TestService { Client = client }; + var service = new TestService(client); service.ExpandSimple = true; service.ExpandMultiWordProperty = true; @@ -29,7 +29,7 @@ public void Get_ExpandProperties() public void Get_ThrowsIfIdIsNull() { var client = new TestClient(); - var service = new TestService { Client = client }; + var service = new TestService(client); Assert.Throws(() => service.Get(null)); } @@ -38,7 +38,7 @@ public void Get_ThrowsIfIdIsNull() public void Get_ThrowsIfIdIsEmpty() { var client = new TestClient(); - var service = new TestService { Client = client }; + var service = new TestService(client); Assert.Throws(() => service.Get(string.Empty)); } @@ -47,7 +47,7 @@ public void Get_ThrowsIfIdIsEmpty() public void Get_ThrowsIfIdIsWhitespace() { var client = new TestClient(); - var service = new TestService { Client = client }; + var service = new TestService(client); Assert.Throws(() => service.Get(" ")); } @@ -56,7 +56,7 @@ public void Get_ThrowsIfIdIsWhitespace() public void List_ExpandProperties() { var client = new TestClient(); - var service = new TestService { Client = client }; + var service = new TestService(client); service.ExpandSimple = true; service.ExpandMultiWordProperty = true; @@ -103,6 +103,11 @@ private class TestService : Service, IListable, IRetrievable { + public TestService(IStripeClient client) + : base(client) + { + } + public override string BasePath => "/v1/test_entities"; public bool ExpandSimple { get; set; }