From 375783d93fe6dd37420a228bbe048cc06f30bfaa Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Fri, 28 Feb 2020 11:13:55 -0800 Subject: [PATCH 1/7] Drop support for .NET Standard 1.2 (#1933) --- README.md | 2 +- appveyor.yml | 4 ++-- .../FormEncoding/MultipartFormDataContent.cs | 2 -- .../Public/StripeConfiguration.cs | 18 +++------------ .../Public/SystemNetHttpClient.cs | 2 -- src/Stripe.net/Stripe.net.csproj | 23 +------------------ src/StripeTests/StripeTests.csproj | 2 +- 7 files changed, 8 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 7bd7f1b300..d1ca611b51 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Build Status](https://ci.appveyor.com/api/projects/status/rg0pg5tlr1a6f8tf/branch/master?svg=true)](https://ci.appveyor.com/project/stripe/stripe-dotnet) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-dotnet/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-dotnet?branch=master) -The official [Stripe][stripe] .NET library, supporting .NET Standard 1.2+, .NET Core 1.0+, and .NET Framework 4.5+. +The official [Stripe][stripe] .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.5+. ## Installation diff --git a/appveyor.yml b/appveyor.yml index 3c90ea31fb..9fb6ab0c14 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -55,12 +55,12 @@ test_script: after_test: - ps: Write-Host $("`n RUNNING COVERAGE `n") -BackgroundColor DarkCyan - - dotnet test -c Debug -f netcoreapp3.0 src/StripeTests/StripeTests.csproj --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=CompilerGenerated + - dotnet test -c Debug -f netcoreapp3.1 src/StripeTests/StripeTests.csproj --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=CompilerGenerated - ps: | # Secure env vars are not available on all branches, so make sure the # token is available before invoking Coveralls. if (Test-Path env:COVERALLS_REPO_TOKEN) { - .\tools\csmacnz.Coveralls --opencover -i src/StripeTests/coverage.netcoreapp3.0.opencover.xml --useRelativePaths + .\tools\csmacnz.Coveralls --opencover -i src/StripeTests/coverage.netcoreapp3.1.opencover.xml --useRelativePaths } artifacts: diff --git a/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs b/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs index d5ae231d28..d7ff9b3427 100644 --- a/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs +++ b/src/Stripe.net/Infrastructure/FormEncoding/MultipartFormDataContent.cs @@ -46,14 +46,12 @@ private static StreamContent CreateStreamContent(Stream value, string name) var fileName = "blob"; var extension = string.Empty; -#if NET45 || NETSTANDARD2_0 FileStream fileStream = value as FileStream; if ((fileStream != null) && (!string.IsNullOrEmpty(fileStream.Name))) { fileName = fileStream.Name; extension = Path.GetExtension(fileName); } -#endif var content = new StreamContent(value); content.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") diff --git a/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs b/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs index 9eff7611eb..261e161682 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs @@ -2,12 +2,10 @@ namespace Stripe { using System; using System.Collections.Generic; + using System.Configuration; using System.Reflection; using Newtonsoft.Json; using Stripe.Infrastructure; -#if NET45 || NETSTANDARD2_0 - using System.Configuration; -#endif /// /// Global configuration class for Stripe.net settings. @@ -34,26 +32,21 @@ static StripeConfiguration() /// API version used by Stripe.net. public static string ApiVersion => "2019-12-03"; -#if NET45 || NETSTANDARD2_0 /// Gets or sets the API key. /// /// You can also set the API key using the StripeApiKey key in /// . /// -#else - /// Gets or sets the API key. -#endif public static string ApiKey { get { -#if NET45 || NETSTANDARD2_0 if (string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(ConfigurationManager.AppSettings["StripeApiKey"])) { apiKey = ConfigurationManager.AppSettings["StripeApiKey"]; } -#endif + return apiKey; } @@ -68,26 +61,21 @@ public static string ApiKey } } -#if NET45 || NETSTANDARD2_0 /// Gets or sets the client ID. /// /// You can also set the client ID using the StripeClientId key in /// . /// -#else - /// Gets or sets the client ID. -#endif public static string ClientId { get { -#if NET45 || NETSTANDARD2_0 if (string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(ConfigurationManager.AppSettings["StripeClientId"])) { clientId = ConfigurationManager.AppSettings["StripeClientId"]; } -#endif + return clientId; } diff --git a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs index f242ef1afe..9124a859fc 100644 --- a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs +++ b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs @@ -219,8 +219,6 @@ private string BuildStripeClientUserAgentString() var stripeNetTargetFramework = #if NET45 "net45" -#elif NETSTANDARD1_2 - "netstandard1.2" #elif NETSTANDARD2_0 "netstandard2.0" #else diff --git a/src/Stripe.net/Stripe.net.csproj b/src/Stripe.net/Stripe.net.csproj index d283514962..5d59800cb6 100644 --- a/src/Stripe.net/Stripe.net.csproj +++ b/src/Stripe.net/Stripe.net.csproj @@ -7,7 +7,7 @@ 34.26.0 34.26.0 Stripe, Jayme Davis - netstandard1.2;netstandard2.0;net45 + netstandard2.0;net45 Stripe.net Stripe.net stripe;payment;credit;cards;money;gateway;paypal;braintree @@ -16,8 +16,6 @@ https://raw.github.com/stripe/stripe-dotnet/master/LICENSE true win10-x64 - $(PackageTargetFallback);netcoreapp1.0 - 1.6.1 True true true @@ -27,21 +25,6 @@ snupkg - - - - - @@ -70,10 +53,6 @@ - - - - diff --git a/src/StripeTests/StripeTests.csproj b/src/StripeTests/StripeTests.csproj index 2837ef94e3..1a029a1327 100644 --- a/src/StripeTests/StripeTests.csproj +++ b/src/StripeTests/StripeTests.csproj @@ -2,7 +2,7 @@ - netcoreapp1.1;netcoreapp2.1;netcoreapp3.0;net452 + netcoreapp2.0;netcoreapp3.1;net452 StripeTests StripeTests win10-x64 From 0e9e45de89d53e40133561d3fbccc507aa5006a1 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Thu, 27 Feb 2020 22:16:35 -0800 Subject: [PATCH 2/7] Add support for passing parameters for all Delete methods --- .../Services/Accounts/AccountDeleteOptions.cs | 6 ++++ .../Services/Accounts/AccountService.cs | 10 +++--- .../ApplePayDomainDeleteOptions.cs | 6 ++++ .../ApplePayDomains/ApplePayDomainService.cs | 10 +++--- .../BankAccounts/BankAccountDeleteOptions.cs | 6 ++++ .../BankAccounts/BankAccountService.cs | 10 +++--- .../Services/Cards/CardDeleteOptions.cs | 6 ++++ src/Stripe.net/Services/Cards/CardService.cs | 10 +++--- .../Services/Coupons/CouponDeleteOptions.cs | 6 ++++ .../Services/Coupons/CouponService.cs | 10 +++--- .../Customers/CustomerDeleteOptions.cs | 6 ++++ .../Services/Customers/CustomerService.cs | 10 +++--- .../EphemeralKeyDeleteOptions.cs | 6 ++++ .../EphemeralKeys/EphemeralKeyService.cs | 10 +++--- .../ExternalAccountDeleteOptions.cs | 6 ++++ .../ExternalAccountService.cs | 10 +++--- .../InvoiceItems/InvoiceItemDeleteOptions.cs | 6 ++++ .../InvoiceItems/InvoiceItemService.cs | 10 +++--- .../Services/Invoices/InvoiceDeleteOptions.cs | 6 ++++ .../Services/Invoices/InvoiceService.cs | 9 ++--- .../Services/Persons/PersonDeleteOptions.cs | 6 ++++ .../Services/Persons/PersonService.cs | 9 ++--- .../Services/Plans/PlanDeleteOptions.cs | 6 ++++ src/Stripe.net/Services/Plans/PlanService.cs | 10 +++--- .../Services/Products/ProductDeleteOptions.cs | 6 ++++ .../Services/Products/ProductService.cs | 10 +++--- .../ValueListItemDeleteOptions.cs | 6 ++++ .../ValueListItems/ValueListItemService.cs | 9 ++--- .../ValueLists/ValueListDeleteOptions.cs | 6 ++++ .../Radar/ValueLists/ValueListService.cs | 9 ++--- .../Services/Skus/SkuDeleteOptions.cs | 6 ++++ src/Stripe.net/Services/Skus/SkuService.cs | 10 +++--- .../SubscriptionItemDeleteOptions.cs | 36 +++++++++++++++++++ .../SubscriptionItemService.cs | 10 +++--- .../Services/TaxIds/TaxIdDeleteOptions.cs | 6 ++++ .../Services/TaxIds/TaxIdService.cs | 9 ++--- .../Locations/LocationDeleteOptions.cs | 6 ++++ .../Terminal/Locations/LocationService.cs | 10 +++--- .../Terminal/Readers/ReaderDeleteOptions.cs | 6 ++++ .../Terminal/Readers/ReaderService.cs | 10 +++--- .../WebhookEndpointDeleteOptions.cs | 6 ++++ .../WebhookEndpointService.cs | 10 +++--- .../Services/_interfaces/IDeletable.cs | 7 ++-- .../Services/_interfaces/INestedDeletable.cs | 7 ++-- .../SubscriptionItemServiceTest.cs | 10 ++++-- 45 files changed, 277 insertions(+), 108 deletions(-) create mode 100644 src/Stripe.net/Services/Accounts/AccountDeleteOptions.cs create mode 100644 src/Stripe.net/Services/ApplePayDomains/ApplePayDomainDeleteOptions.cs create mode 100644 src/Stripe.net/Services/BankAccounts/BankAccountDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Cards/CardDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Coupons/CouponDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Customers/CustomerDeleteOptions.cs create mode 100644 src/Stripe.net/Services/EphemeralKeys/EphemeralKeyDeleteOptions.cs create mode 100644 src/Stripe.net/Services/ExternalAccounts/ExternalAccountDeleteOptions.cs create mode 100644 src/Stripe.net/Services/InvoiceItems/InvoiceItemDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Invoices/InvoiceDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Persons/PersonDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Plans/PlanDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Products/ProductDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Radar/ValueListItems/ValueListItemDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Radar/ValueLists/ValueListDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Skus/SkuDeleteOptions.cs create mode 100644 src/Stripe.net/Services/SubscriptionItems/SubscriptionItemDeleteOptions.cs create mode 100644 src/Stripe.net/Services/TaxIds/TaxIdDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Terminal/Locations/LocationDeleteOptions.cs create mode 100644 src/Stripe.net/Services/Terminal/Readers/ReaderDeleteOptions.cs create mode 100644 src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointDeleteOptions.cs diff --git a/src/Stripe.net/Services/Accounts/AccountDeleteOptions.cs b/src/Stripe.net/Services/Accounts/AccountDeleteOptions.cs new file mode 100644 index 0000000000..2080999d14 --- /dev/null +++ b/src/Stripe.net/Services/Accounts/AccountDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class AccountDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Accounts/AccountService.cs b/src/Stripe.net/Services/Accounts/AccountService.cs index 2311ea16b0..79ea5aeef9 100644 --- a/src/Stripe.net/Services/Accounts/AccountService.cs +++ b/src/Stripe.net/Services/Accounts/AccountService.cs @@ -8,7 +8,7 @@ namespace Stripe public class AccountService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -35,14 +35,14 @@ public virtual Account Create(AccountCreateOptions options, RequestOptions reque return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Account Delete(string accountId, RequestOptions requestOptions = null) + public virtual Account Delete(string accountId, AccountDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(accountId, null, requestOptions); + return this.DeleteEntity(accountId, options, requestOptions); } - public virtual Task DeleteAsync(string accountId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string accountId, AccountDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(accountId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(accountId, options, requestOptions, cancellationToken); } public virtual Account Get(string accountId, AccountGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainDeleteOptions.cs b/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainDeleteOptions.cs new file mode 100644 index 0000000000..f252a70c30 --- /dev/null +++ b/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class ApplePayDomainDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs b/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs index bbbf58ca06..7110afca40 100644 --- a/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs +++ b/src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs @@ -6,7 +6,7 @@ namespace Stripe public class ApplePayDomainService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable { @@ -32,14 +32,14 @@ public virtual ApplePayDomain Create(ApplePayDomainCreateOptions options, Reques return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual ApplePayDomain Delete(string domainId, RequestOptions requestOptions = null) + public virtual ApplePayDomain Delete(string domainId, ApplePayDomainDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(domainId, null, requestOptions); + return this.DeleteEntity(domainId, options, requestOptions); } - public virtual Task DeleteAsync(string domainId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string domainId, ApplePayDomainDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(domainId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(domainId, options, requestOptions, cancellationToken); } public virtual ApplePayDomain Get(string domainId, ApplePayDomainGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/BankAccounts/BankAccountDeleteOptions.cs b/src/Stripe.net/Services/BankAccounts/BankAccountDeleteOptions.cs new file mode 100644 index 0000000000..41b0c69afd --- /dev/null +++ b/src/Stripe.net/Services/BankAccounts/BankAccountDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class BankAccountDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/BankAccounts/BankAccountService.cs b/src/Stripe.net/Services/BankAccounts/BankAccountService.cs index dc1f25a415..fa13c4c00d 100644 --- a/src/Stripe.net/Services/BankAccounts/BankAccountService.cs +++ b/src/Stripe.net/Services/BankAccounts/BankAccountService.cs @@ -8,7 +8,7 @@ namespace Stripe public class BankAccountService : ServiceNested, INestedCreatable, - INestedDeletable, + INestedDeletable, INestedListable, INestedRetrievable, INestedUpdatable @@ -35,14 +35,14 @@ public virtual BankAccount Create(string customerId, BankAccountCreateOptions op return this.CreateNestedEntityAsync(customerId, options, requestOptions, cancellationToken); } - public virtual BankAccount Delete(string customerId, string bankAccountId, RequestOptions requestOptions = null) + public virtual BankAccount Delete(string customerId, string bankAccountId, BankAccountDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteNestedEntity(customerId, bankAccountId, null, requestOptions); + return this.DeleteNestedEntity(customerId, bankAccountId, options, requestOptions); } - public virtual Task DeleteAsync(string customerId, string bankAccountId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string customerId, string bankAccountId, BankAccountDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteNestedEntityAsync(customerId, bankAccountId, null, requestOptions, cancellationToken); + return this.DeleteNestedEntityAsync(customerId, bankAccountId, options, requestOptions, cancellationToken); } public virtual BankAccount Get(string customerId, string bankAccountId, BankAccountGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Cards/CardDeleteOptions.cs b/src/Stripe.net/Services/Cards/CardDeleteOptions.cs new file mode 100644 index 0000000000..d028577262 --- /dev/null +++ b/src/Stripe.net/Services/Cards/CardDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class CardDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Cards/CardService.cs b/src/Stripe.net/Services/Cards/CardService.cs index b6b5c13f59..4ecf7f320e 100644 --- a/src/Stripe.net/Services/Cards/CardService.cs +++ b/src/Stripe.net/Services/Cards/CardService.cs @@ -7,7 +7,7 @@ namespace Stripe public class CardService : ServiceNested, INestedCreatable, - INestedDeletable, + INestedDeletable, INestedListable, INestedRetrievable, INestedUpdatable @@ -34,14 +34,14 @@ public virtual Card Create(string customerId, CardCreateOptions options, Request return this.CreateNestedEntityAsync(customerId, options, requestOptions, cancellationToken); } - public virtual Card Delete(string customerId, string cardId, RequestOptions requestOptions = null) + public virtual Card Delete(string customerId, string cardId, CardDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteNestedEntity(customerId, cardId, null, requestOptions); + return this.DeleteNestedEntity(customerId, cardId, options, requestOptions); } - public virtual Task DeleteAsync(string customerId, string cardId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string customerId, string cardId, CardDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteNestedEntityAsync(customerId, cardId, null, requestOptions, cancellationToken); + return this.DeleteNestedEntityAsync(customerId, cardId, options, requestOptions, cancellationToken); } public virtual Card Get(string customerId, string cardId, CardGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Coupons/CouponDeleteOptions.cs b/src/Stripe.net/Services/Coupons/CouponDeleteOptions.cs new file mode 100644 index 0000000000..d878de509a --- /dev/null +++ b/src/Stripe.net/Services/Coupons/CouponDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class CouponDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Coupons/CouponService.cs b/src/Stripe.net/Services/Coupons/CouponService.cs index 1bc36e2052..d58c4159b6 100644 --- a/src/Stripe.net/Services/Coupons/CouponService.cs +++ b/src/Stripe.net/Services/Coupons/CouponService.cs @@ -6,7 +6,7 @@ namespace Stripe public class CouponService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -33,14 +33,14 @@ public virtual Coupon Create(CouponCreateOptions options, RequestOptions request return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Coupon Delete(string couponId, RequestOptions requestOptions = null) + public virtual Coupon Delete(string couponId, CouponDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(couponId, null, requestOptions); + return this.DeleteEntity(couponId, options, requestOptions); } - public virtual Task DeleteAsync(string couponId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string couponId, CouponDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(couponId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(couponId, options, requestOptions, cancellationToken); } public virtual Coupon Get(string couponId, CouponGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Customers/CustomerDeleteOptions.cs b/src/Stripe.net/Services/Customers/CustomerDeleteOptions.cs new file mode 100644 index 0000000000..3379c7f2f9 --- /dev/null +++ b/src/Stripe.net/Services/Customers/CustomerDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class CustomerDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Customers/CustomerService.cs b/src/Stripe.net/Services/Customers/CustomerService.cs index a1419695d2..c849d1f762 100644 --- a/src/Stripe.net/Services/Customers/CustomerService.cs +++ b/src/Stripe.net/Services/Customers/CustomerService.cs @@ -7,7 +7,7 @@ namespace Stripe public class CustomerService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -34,14 +34,14 @@ public virtual Customer Create(CustomerCreateOptions options, RequestOptions req return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Customer Delete(string customerId, RequestOptions requestOptions = null) + public virtual Customer Delete(string customerId, CustomerDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(customerId, null, requestOptions); + return this.DeleteEntity(customerId, options, requestOptions); } - public virtual Task DeleteAsync(string customerId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string customerId, CustomerDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(customerId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(customerId, options, requestOptions, cancellationToken); } public virtual Customer Get(string customerId, CustomerGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyDeleteOptions.cs b/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyDeleteOptions.cs new file mode 100644 index 0000000000..bff5b3a85f --- /dev/null +++ b/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class EphemeralKeyDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs b/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs index f473079b4b..101eead5db 100644 --- a/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs +++ b/src/Stripe.net/Services/EphemeralKeys/EphemeralKeyService.cs @@ -7,7 +7,7 @@ namespace Stripe public class EphemeralKeyService : Service, ICreatable, - IDeletable + IDeletable { public EphemeralKeyService() : base(null) @@ -46,14 +46,14 @@ public virtual EphemeralKey Create(EphemeralKeyCreateOptions options, RequestOpt return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual EphemeralKey Delete(string keyId, RequestOptions requestOptions = null) + public virtual EphemeralKey Delete(string keyId, EphemeralKeyDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(keyId, null, requestOptions); + return this.DeleteEntity(keyId, options, requestOptions); } - public virtual Task DeleteAsync(string keyId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string keyId, EphemeralKeyDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(keyId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(keyId, options, requestOptions, cancellationToken); } } } diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountDeleteOptions.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountDeleteOptions.cs new file mode 100644 index 0000000000..f1a46dea4a --- /dev/null +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class ExternalAccountDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs index 26a94bdcbe..502d178ab6 100644 --- a/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs +++ b/src/Stripe.net/Services/ExternalAccounts/ExternalAccountService.cs @@ -6,7 +6,7 @@ namespace Stripe public class ExternalAccountService : ServiceNested, INestedCreatable, - INestedDeletable, + INestedDeletable, INestedListable, INestedRetrievable, INestedUpdatable @@ -33,14 +33,14 @@ public virtual IExternalAccount Create(string accountId, ExternalAccountCreateOp return this.CreateNestedEntityAsync(accountId, options, requestOptions, cancellationToken); } - public virtual IExternalAccount Delete(string accountId, string externalAccountId, RequestOptions requestOptions = null) + public virtual IExternalAccount Delete(string accountId, string externalAccountId, ExternalAccountDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteNestedEntity(accountId, externalAccountId, null, requestOptions); + return this.DeleteNestedEntity(accountId, externalAccountId, options, requestOptions); } - public virtual Task DeleteAsync(string accountId, string externalAccountId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string accountId, string externalAccountId, ExternalAccountDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteNestedEntityAsync(accountId, externalAccountId, null, requestOptions, cancellationToken); + return this.DeleteNestedEntityAsync(accountId, externalAccountId, options, requestOptions, cancellationToken); } public virtual IExternalAccount Get(string accountId, string externalAccountId, ExternalAccountGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemDeleteOptions.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemDeleteOptions.cs new file mode 100644 index 0000000000..77f442bc87 --- /dev/null +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class InvoiceItemDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs b/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs index c36db41908..971c0e92c0 100644 --- a/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs +++ b/src/Stripe.net/Services/InvoiceItems/InvoiceItemService.cs @@ -7,7 +7,7 @@ namespace Stripe public class InvoiceItemService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -34,14 +34,14 @@ public virtual InvoiceItem Create(InvoiceItemCreateOptions options, RequestOptio return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual InvoiceItem Delete(string invoiceitemId, RequestOptions requestOptions = null) + public virtual InvoiceItem Delete(string invoiceitemId, InvoiceItemDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(invoiceitemId, null, requestOptions); + return this.DeleteEntity(invoiceitemId, options, requestOptions); } - public virtual Task DeleteAsync(string invoiceitemId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string invoiceitemId, InvoiceItemDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(invoiceitemId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(invoiceitemId, options, requestOptions, cancellationToken); } public virtual InvoiceItem Get(string invoiceitemId, InvoiceItemGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Invoices/InvoiceDeleteOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceDeleteOptions.cs new file mode 100644 index 0000000000..a677d77ea0 --- /dev/null +++ b/src/Stripe.net/Services/Invoices/InvoiceDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class InvoiceDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Invoices/InvoiceService.cs b/src/Stripe.net/Services/Invoices/InvoiceService.cs index f268f9b59e..a586c3b91c 100644 --- a/src/Stripe.net/Services/Invoices/InvoiceService.cs +++ b/src/Stripe.net/Services/Invoices/InvoiceService.cs @@ -8,6 +8,7 @@ namespace Stripe public class InvoiceService : Service, ICreatable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -34,14 +35,14 @@ public virtual Invoice Create(InvoiceCreateOptions options, RequestOptions reque return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Invoice Delete(string invoiceId, RequestOptions requestOptions = null) + public virtual Invoice Delete(string invoiceId, InvoiceDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(invoiceId, null, requestOptions); + return this.DeleteEntity(invoiceId, options, requestOptions); } - public virtual Task DeleteAsync(string invoiceId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string invoiceId, InvoiceDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(invoiceId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(invoiceId, options, requestOptions, cancellationToken); } public virtual Invoice FinalizeInvoice(string invoiceId, InvoiceFinalizeOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Persons/PersonDeleteOptions.cs b/src/Stripe.net/Services/Persons/PersonDeleteOptions.cs new file mode 100644 index 0000000000..cfd4618c0b --- /dev/null +++ b/src/Stripe.net/Services/Persons/PersonDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class PersonDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Persons/PersonService.cs b/src/Stripe.net/Services/Persons/PersonService.cs index f523da3c1e..16d6c33f5e 100644 --- a/src/Stripe.net/Services/Persons/PersonService.cs +++ b/src/Stripe.net/Services/Persons/PersonService.cs @@ -7,6 +7,7 @@ namespace Stripe public class PersonService : ServiceNested, INestedCreatable, + INestedDeletable, INestedListable, INestedRetrievable, INestedUpdatable @@ -33,14 +34,14 @@ public virtual Person Create(string accountId, PersonCreateOptions options = nul return this.CreateNestedEntityAsync(accountId, options, requestOptions, cancellationToken); } - public virtual Person Delete(string accountId, string personId, RequestOptions requestOptions = null) + public virtual Person Delete(string accountId, string personId, PersonDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteNestedEntity(accountId, personId, null, requestOptions); + return this.DeleteNestedEntity(accountId, personId, options, requestOptions); } - public virtual Task DeleteAsync(string accountId, string personId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string accountId, string personId, PersonDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteNestedEntityAsync(accountId, personId, null, requestOptions, cancellationToken); + return this.DeleteNestedEntityAsync(accountId, personId, options, requestOptions, cancellationToken); } public virtual Person Get(string accountId, string personId, PersonGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Plans/PlanDeleteOptions.cs b/src/Stripe.net/Services/Plans/PlanDeleteOptions.cs new file mode 100644 index 0000000000..ad6b81dc49 --- /dev/null +++ b/src/Stripe.net/Services/Plans/PlanDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class PlanDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Plans/PlanService.cs b/src/Stripe.net/Services/Plans/PlanService.cs index 86ebfacfff..7c84770b5e 100644 --- a/src/Stripe.net/Services/Plans/PlanService.cs +++ b/src/Stripe.net/Services/Plans/PlanService.cs @@ -7,7 +7,7 @@ namespace Stripe public class PlanService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -34,14 +34,14 @@ public virtual Plan Create(PlanCreateOptions options, RequestOptions requestOpti return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Plan Delete(string planId, RequestOptions requestOptions = null) + public virtual Plan Delete(string planId, PlanDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(planId, null, requestOptions); + return this.DeleteEntity(planId, options, requestOptions); } - public virtual Task DeleteAsync(string planId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string planId, PlanDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(planId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(planId, options, requestOptions, cancellationToken); } public virtual Plan Get(string planId, PlanGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Products/ProductDeleteOptions.cs b/src/Stripe.net/Services/Products/ProductDeleteOptions.cs new file mode 100644 index 0000000000..0dde7e6272 --- /dev/null +++ b/src/Stripe.net/Services/Products/ProductDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class ProductDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Products/ProductService.cs b/src/Stripe.net/Services/Products/ProductService.cs index fa76e6d3bc..0b99f01507 100644 --- a/src/Stripe.net/Services/Products/ProductService.cs +++ b/src/Stripe.net/Services/Products/ProductService.cs @@ -6,7 +6,7 @@ namespace Stripe public class ProductService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -33,14 +33,14 @@ public virtual Product Create(ProductCreateOptions options, RequestOptions reque return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Product Delete(string productId, RequestOptions requestOptions = null) + public virtual Product Delete(string productId, ProductDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(productId, null, requestOptions); + return this.DeleteEntity(productId, options, requestOptions); } - public virtual Task DeleteAsync(string productId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string productId, ProductDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(productId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(productId, options, requestOptions, cancellationToken); } public virtual Product Get(string productId, ProductGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemDeleteOptions.cs b/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemDeleteOptions.cs new file mode 100644 index 0000000000..e03a8fa282 --- /dev/null +++ b/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe.Radar +{ + public class ValueListItemDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs b/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs index 0808fea662..bb0d059983 100644 --- a/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs +++ b/src/Stripe.net/Services/Radar/ValueListItems/ValueListItemService.cs @@ -6,6 +6,7 @@ namespace Stripe.Radar public class ValueListItemService : Service, ICreatable, + IDeletable, IListable, IRetrievable { @@ -31,14 +32,14 @@ public virtual ValueListItem Create(ValueListItemCreateOptions options, RequestO return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual ValueListItem Delete(string valueListItemId, RequestOptions requestOptions = null) + public virtual ValueListItem Delete(string valueListItemId, ValueListItemDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(valueListItemId, null, requestOptions); + return this.DeleteEntity(valueListItemId, options, requestOptions); } - public virtual Task DeleteAsync(string valueListItemId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string valueListItemId, ValueListItemDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(valueListItemId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(valueListItemId, options, requestOptions, cancellationToken); } public virtual ValueListItem Get(string valueListItemId, ValueListItemGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Radar/ValueLists/ValueListDeleteOptions.cs b/src/Stripe.net/Services/Radar/ValueLists/ValueListDeleteOptions.cs new file mode 100644 index 0000000000..5603dfb371 --- /dev/null +++ b/src/Stripe.net/Services/Radar/ValueLists/ValueListDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe.Radar +{ + public class ValueListDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs b/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs index 4f5b0785d5..c2a712f1bf 100644 --- a/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs +++ b/src/Stripe.net/Services/Radar/ValueLists/ValueListService.cs @@ -6,6 +6,7 @@ namespace Stripe.Radar public class ValueListService : Service, ICreatable, + IDeletable, IListable, IRetrievable { @@ -31,14 +32,14 @@ public virtual ValueList Create(ValueListCreateOptions options, RequestOptions r return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual ValueList Delete(string valueListId, RequestOptions requestOptions = null) + public virtual ValueList Delete(string valueListId, ValueListDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(valueListId, null, requestOptions); + return this.DeleteEntity(valueListId, options, requestOptions); } - public virtual Task DeleteAsync(string valueListId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string valueListId, ValueListDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(valueListId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(valueListId, options, requestOptions, cancellationToken); } public virtual ValueList Get(string valueListId, ValueListGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Skus/SkuDeleteOptions.cs b/src/Stripe.net/Services/Skus/SkuDeleteOptions.cs new file mode 100644 index 0000000000..dba021de08 --- /dev/null +++ b/src/Stripe.net/Services/Skus/SkuDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class SkuDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Skus/SkuService.cs b/src/Stripe.net/Services/Skus/SkuService.cs index e297b09489..7469f14942 100644 --- a/src/Stripe.net/Services/Skus/SkuService.cs +++ b/src/Stripe.net/Services/Skus/SkuService.cs @@ -7,7 +7,7 @@ namespace Stripe public class SkuService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -34,14 +34,14 @@ public virtual Sku Create(SkuCreateOptions options, RequestOptions requestOption return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Sku Delete(string skuId, RequestOptions requestOptions = null) + public virtual Sku Delete(string skuId, SkuDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(skuId, null, requestOptions); + return this.DeleteEntity(skuId, options, requestOptions); } - public virtual Task DeleteAsync(string skuId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string skuId, SkuDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(skuId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(skuId, options, requestOptions, cancellationToken); } public virtual Sku Get(string skuId, SkuGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemDeleteOptions.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemDeleteOptions.cs new file mode 100644 index 0000000000..1da991a930 --- /dev/null +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemDeleteOptions.cs @@ -0,0 +1,36 @@ +namespace Stripe +{ + using System; + using Newtonsoft.Json; + using Stripe.Infrastructure; + + public class SubscriptionItemDeleteOptions : BaseOptions + { + /// + /// Delete all usage for the given subscription item. Only allowed when the current plan’s + /// usage_type is metered. + /// + [JsonProperty("clear_usage")] + public bool? ClearUsage { get; set; } + + /// + /// Determines how to handle + /// prorations + /// when the billing cycle changes. The value defaults to + /// create_prorations, indicating that proration invoice items should + /// be created. Prorations can be disabled by setting the value to + /// none. + /// + [JsonProperty("proration_behavior")] + public string ProrationBehavior { get; set; } + + /// + /// If set, the proration will be calculated as though the subscription was updated at the + /// given time. This can be used to apply the same proration that was previewed with the + /// upcoming invoice endpoint. + /// + [JsonProperty("proration_date")] + [JsonConverter(typeof(DateTimeConverter))] + public DateTime? ProrationDate { get; set; } + } +} diff --git a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs index 333a7837be..48c401a103 100644 --- a/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs +++ b/src/Stripe.net/Services/SubscriptionItems/SubscriptionItemService.cs @@ -6,7 +6,7 @@ namespace Stripe public class SubscriptionItemService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -33,14 +33,14 @@ public virtual SubscriptionItem Create(SubscriptionItemCreateOptions options, Re return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual SubscriptionItem Delete(string subscriptionItemId, RequestOptions requestOptions = null) + public virtual SubscriptionItem Delete(string subscriptionItemId, SubscriptionItemDeleteOptions options, RequestOptions requestOptions = null) { - return this.DeleteEntity(subscriptionItemId, null, requestOptions); + return this.DeleteEntity(subscriptionItemId, options, requestOptions); } - public virtual Task DeleteAsync(string subscriptionItemId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string subscriptionItemId, SubscriptionItemDeleteOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(subscriptionItemId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(subscriptionItemId, options, requestOptions, cancellationToken); } public virtual SubscriptionItem Get(string subscriptionItemId, SubscriptionItemGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/TaxIds/TaxIdDeleteOptions.cs b/src/Stripe.net/Services/TaxIds/TaxIdDeleteOptions.cs new file mode 100644 index 0000000000..57755a4e52 --- /dev/null +++ b/src/Stripe.net/Services/TaxIds/TaxIdDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class TaxIdDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/TaxIds/TaxIdService.cs b/src/Stripe.net/Services/TaxIds/TaxIdService.cs index e4dfc3262e..9a58c3a43a 100644 --- a/src/Stripe.net/Services/TaxIds/TaxIdService.cs +++ b/src/Stripe.net/Services/TaxIds/TaxIdService.cs @@ -7,6 +7,7 @@ namespace Stripe public class TaxIdService : ServiceNested, INestedCreatable, + INestedDeletable, INestedListable, INestedRetrievable { @@ -32,14 +33,14 @@ public virtual TaxId Create(string customerId, TaxIdCreateOptions options = null return this.CreateNestedEntityAsync(customerId, options, requestOptions, cancellationToken); } - public virtual TaxId Delete(string customerId, string taxIdId, RequestOptions requestOptions = null) + public virtual TaxId Delete(string customerId, string taxIdId, TaxIdDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteNestedEntity(customerId, taxIdId, null, requestOptions); + return this.DeleteNestedEntity(customerId, taxIdId, options, requestOptions); } - public virtual Task DeleteAsync(string customerId, string taxIdId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string customerId, string taxIdId, TaxIdDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteNestedEntityAsync(customerId, taxIdId, null, requestOptions, cancellationToken); + return this.DeleteNestedEntityAsync(customerId, taxIdId, options, requestOptions, cancellationToken); } public virtual TaxId Get(string customerId, string taxIdId, TaxIdGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationDeleteOptions.cs b/src/Stripe.net/Services/Terminal/Locations/LocationDeleteOptions.cs new file mode 100644 index 0000000000..4d6cd5a284 --- /dev/null +++ b/src/Stripe.net/Services/Terminal/Locations/LocationDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe.Terminal +{ + public class LocationDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Terminal/Locations/LocationService.cs b/src/Stripe.net/Services/Terminal/Locations/LocationService.cs index 65d11d785d..21dcb28b98 100644 --- a/src/Stripe.net/Services/Terminal/Locations/LocationService.cs +++ b/src/Stripe.net/Services/Terminal/Locations/LocationService.cs @@ -8,7 +8,7 @@ namespace Stripe.Terminal public class LocationService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -35,14 +35,14 @@ public virtual Location Create(LocationCreateOptions options, RequestOptions req return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Location Delete(string locationId, RequestOptions requestOptions = null) + public virtual Location Delete(string locationId, LocationDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(locationId, null, requestOptions); + return this.DeleteEntity(locationId, options, requestOptions); } - public virtual Task DeleteAsync(string locationId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string locationId, LocationDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(locationId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(locationId, options, requestOptions, cancellationToken); } public virtual Location Get(string locationId, LocationGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderDeleteOptions.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderDeleteOptions.cs new file mode 100644 index 0000000000..ef7b121afe --- /dev/null +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe.Terminal +{ + public class ReaderDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs b/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs index 47e1a45c41..57077ac064 100644 --- a/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs +++ b/src/Stripe.net/Services/Terminal/Readers/ReaderService.cs @@ -8,7 +8,7 @@ namespace Stripe.Terminal public class ReaderService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -35,14 +35,14 @@ public virtual Reader Create(ReaderCreateOptions options, RequestOptions request return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual Reader Delete(string readerId, RequestOptions requestOptions = null) + public virtual Reader Delete(string readerId, ReaderDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(readerId, null, requestOptions); + return this.DeleteEntity(readerId, options, requestOptions); } - public virtual Task DeleteAsync(string readerId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string readerId, ReaderDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(readerId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(readerId, options, requestOptions, cancellationToken); } public virtual Reader Get(string readerId, ReaderGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointDeleteOptions.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointDeleteOptions.cs new file mode 100644 index 0000000000..efbc71a447 --- /dev/null +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointDeleteOptions.cs @@ -0,0 +1,6 @@ +namespace Stripe +{ + public class WebhookEndpointDeleteOptions : BaseOptions + { + } +} diff --git a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs index c693c143f9..0c0f7369de 100644 --- a/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs +++ b/src/Stripe.net/Services/WebhookEndpoints/WebhookEndpointService.cs @@ -6,7 +6,7 @@ namespace Stripe public class WebhookEndpointService : Service, ICreatable, - IDeletable, + IDeletable, IListable, IRetrievable, IUpdatable @@ -33,14 +33,14 @@ public virtual WebhookEndpoint Create(WebhookEndpointCreateOptions options, Requ return this.CreateEntityAsync(options, requestOptions, cancellationToken); } - public virtual WebhookEndpoint Delete(string endpointId, RequestOptions requestOptions = null) + public virtual WebhookEndpoint Delete(string endpointId, WebhookEndpointDeleteOptions options = null, RequestOptions requestOptions = null) { - return this.DeleteEntity(endpointId, null, requestOptions); + return this.DeleteEntity(endpointId, options, requestOptions); } - public virtual Task DeleteAsync(string endpointId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) + public virtual Task DeleteAsync(string endpointId, WebhookEndpointDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.DeleteEntityAsync(endpointId, null, requestOptions, cancellationToken); + return this.DeleteEntityAsync(endpointId, options, requestOptions, cancellationToken); } public virtual WebhookEndpoint Get(string endpointId, WebhookEndpointGetOptions options = null, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/_interfaces/IDeletable.cs b/src/Stripe.net/Services/_interfaces/IDeletable.cs index e4ec159ee7..4dc218a26f 100644 --- a/src/Stripe.net/Services/_interfaces/IDeletable.cs +++ b/src/Stripe.net/Services/_interfaces/IDeletable.cs @@ -3,11 +3,12 @@ namespace Stripe using System.Threading; using System.Threading.Tasks; - public interface IDeletable + public interface IDeletable where TEntity : IStripeEntity, IHasId + where TOptions : BaseOptions, new() { - TEntity Delete(string id, RequestOptions requestOptions = null); + TEntity Delete(string id, TOptions options, RequestOptions requestOptions = null); - Task DeleteAsync(string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAsync(string id, TOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Stripe.net/Services/_interfaces/INestedDeletable.cs b/src/Stripe.net/Services/_interfaces/INestedDeletable.cs index 18498fdd33..693d3d0471 100644 --- a/src/Stripe.net/Services/_interfaces/INestedDeletable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedDeletable.cs @@ -3,11 +3,12 @@ namespace Stripe using System.Threading; using System.Threading.Tasks; - public interface INestedDeletable + public interface INestedDeletable where TEntity : IStripeEntity, IHasId + where TOptions : BaseOptions, new() { - TEntity Delete(string parentId, string id, RequestOptions requestOptions = null); + TEntity Delete(string parentId, string id, TOptions options, RequestOptions requestOptions = null); - Task DeleteAsync(string parentId, string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAsync(string parentId, string id, TOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs b/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs index 96faae7eaf..4b07feeae6 100644 --- a/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs +++ b/src/StripeTests/Services/SubscriptionItems/SubscriptionItemServiceTest.cs @@ -14,6 +14,7 @@ public class SubscriptionItemServiceTest : BaseStripeTest private readonly SubscriptionItemService service; private readonly SubscriptionItemCreateOptions createOptions; + private readonly SubscriptionItemDeleteOptions deleteOptions; private readonly SubscriptionItemUpdateOptions updateOptions; private readonly SubscriptionItemListOptions listOptions; @@ -31,6 +32,11 @@ public SubscriptionItemServiceTest( Subscription = "sub_123", }; + this.deleteOptions = new SubscriptionItemDeleteOptions + { + ClearUsage = true, + }; + this.updateOptions = new SubscriptionItemUpdateOptions { Metadata = new Dictionary @@ -67,7 +73,7 @@ public async Task CreateAsync() [Fact] public void Delete() { - var deleted = this.service.Delete(SubscriptionItemId); + var deleted = this.service.Delete(SubscriptionItemId, this.deleteOptions); this.AssertRequest(HttpMethod.Delete, "/v1/subscription_items/si_123"); Assert.NotNull(deleted); } @@ -75,7 +81,7 @@ public void Delete() [Fact] public async Task DeleteAsync() { - var deleted = await this.service.DeleteAsync(SubscriptionItemId); + var deleted = await this.service.DeleteAsync(SubscriptionItemId, this.deleteOptions); this.AssertRequest(HttpMethod.Delete, "/v1/subscription_items/si_123"); Assert.NotNull(deleted); } From 8eb8dbd84bd1ee7aa3f342eaa16c92524d9aac7d Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Fri, 28 Feb 2020 13:42:03 -0800 Subject: [PATCH 3/7] Make options optional --- src/Stripe.net/Services/_interfaces/IDeletable.cs | 4 ++-- src/Stripe.net/Services/_interfaces/INestedDeletable.cs | 4 ++-- src/Stripe.net/Services/_interfaces/INestedRetrievable.cs | 4 ++-- src/Stripe.net/Services/_interfaces/IRetrievable.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Stripe.net/Services/_interfaces/IDeletable.cs b/src/Stripe.net/Services/_interfaces/IDeletable.cs index 4dc218a26f..991ddcf29e 100644 --- a/src/Stripe.net/Services/_interfaces/IDeletable.cs +++ b/src/Stripe.net/Services/_interfaces/IDeletable.cs @@ -7,8 +7,8 @@ public interface IDeletable where TEntity : IStripeEntity, IHasId where TOptions : BaseOptions, new() { - TEntity Delete(string id, TOptions options, RequestOptions requestOptions = null); + TEntity Delete(string id, TOptions options = null, RequestOptions requestOptions = null); - Task DeleteAsync(string id, TOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAsync(string id, TOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Stripe.net/Services/_interfaces/INestedDeletable.cs b/src/Stripe.net/Services/_interfaces/INestedDeletable.cs index 693d3d0471..d4c63f6b10 100644 --- a/src/Stripe.net/Services/_interfaces/INestedDeletable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedDeletable.cs @@ -7,8 +7,8 @@ public interface INestedDeletable where TEntity : IStripeEntity, IHasId where TOptions : BaseOptions, new() { - TEntity Delete(string parentId, string id, TOptions options, RequestOptions requestOptions = null); + TEntity Delete(string parentId, string id, TOptions options = null, RequestOptions requestOptions = null); - Task DeleteAsync(string parentId, string id, TOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteAsync(string parentId, string id, TOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs b/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs index c70b9b932a..e150e56ff4 100644 --- a/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs +++ b/src/Stripe.net/Services/_interfaces/INestedRetrievable.cs @@ -7,8 +7,8 @@ public interface INestedRetrievable where TEntity : IStripeEntity, IHasId where TOptions : BaseOptions, new() { - TEntity Get(string parentId, string id, TOptions retrieveOptions, RequestOptions requestOptions = null); + TEntity Get(string parentId, string id, TOptions retrieveOptions = null, RequestOptions requestOptions = null); - Task GetAsync(string parentId, string id, TOptions retrieveOptions, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); + Task GetAsync(string parentId, string id, TOptions retrieveOptions = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/Stripe.net/Services/_interfaces/IRetrievable.cs b/src/Stripe.net/Services/_interfaces/IRetrievable.cs index af715a452e..dacc15c8cc 100644 --- a/src/Stripe.net/Services/_interfaces/IRetrievable.cs +++ b/src/Stripe.net/Services/_interfaces/IRetrievable.cs @@ -7,8 +7,8 @@ public interface IRetrievable where TEntity : IStripeEntity, IHasId where TOptions : BaseOptions, new() { - TEntity Get(string id, TOptions retrieveOptions, RequestOptions requestOptions = null); + TEntity Get(string id, TOptions retrieveOptions = null, RequestOptions requestOptions = null); - Task GetAsync(string id, TOptions retrieveOptions, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); + Task GetAsync(string id, TOptions retrieveOptions = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)); } } From 77ec133fd6cc242108467a42791dd57f51d50d54 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Sun, 1 Mar 2020 17:03:55 -0800 Subject: [PATCH 4/7] Remove conditional compilation macros (#1935) --- .../Infrastructure/FormEncoding/FormEncoderTest.cs | 2 -- src/StripeTests/StripeTests.csproj | 6 +++--- .../Wholesome/AllStripeObjectClassesPresentInDictionary.cs | 2 -- src/StripeTests/Wholesome/CorrectJsonConvertersForTypes.cs | 2 -- src/StripeTests/Wholesome/DontForgetEntityType.cs | 2 -- src/StripeTests/Wholesome/DontForgetIHasInterfaces.cs | 2 -- src/StripeTests/Wholesome/DontSerializeNullDeletedAttrs.cs | 2 -- src/StripeTests/Wholesome/JsonNamesAreSnakeCase.cs | 2 -- src/StripeTests/Wholesome/JsonNamesMatchPropertyNames.cs | 2 -- src/StripeTests/Wholesome/NoDuplicateJsonPropertyValues.cs | 2 -- src/StripeTests/Wholesome/NullableValueTypes.cs | 2 -- src/StripeTests/Wholesome/PropertiesHaveJsonAttributes.cs | 2 -- src/StripeTests/Wholesome/UseListsInsteadOfArrays.cs | 2 -- src/StripeTests/Wholesome/WholesomeTest.cs | 2 -- 14 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/StripeTests/Infrastructure/FormEncoding/FormEncoderTest.cs b/src/StripeTests/Infrastructure/FormEncoding/FormEncoderTest.cs index ee4bd817a5..e25cc03b32 100644 --- a/src/StripeTests/Infrastructure/FormEncoding/FormEncoderTest.cs +++ b/src/StripeTests/Infrastructure/FormEncoding/FormEncoderTest.cs @@ -399,7 +399,6 @@ public void EnumEncodeValidValue() Assert.Contains("enum=test_one", FormEncoder.CreateQueryString(options)); } - #if !NETCOREAPP1_1 [Fact] public void IgnoresCulture() { @@ -420,7 +419,6 @@ public void IgnoresCulture() Thread.CurrentThread.CurrentCulture = currentCulture; } } - #endif [Fact] public void UrlEncodesKeysAndValues() diff --git a/src/StripeTests/StripeTests.csproj b/src/StripeTests/StripeTests.csproj index 1a029a1327..f24e43e09d 100644 --- a/src/StripeTests/StripeTests.csproj +++ b/src/StripeTests/StripeTests.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0;netcoreapp3.1;net452 + netcoreapp2.0;netcoreapp3.1;net45 StripeTests StripeTests win10-x64 @@ -17,7 +17,7 @@ - + runtime; build; native; contentfiles; analyzers all @@ -26,7 +26,7 @@ - + diff --git a/src/StripeTests/Wholesome/AllStripeObjectClassesPresentInDictionary.cs b/src/StripeTests/Wholesome/AllStripeObjectClassesPresentInDictionary.cs index 1f5d8633bb..14f5a2e0db 100644 --- a/src/StripeTests/Wholesome/AllStripeObjectClassesPresentInDictionary.cs +++ b/src/StripeTests/Wholesome/AllStripeObjectClassesPresentInDictionary.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -47,4 +46,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/CorrectJsonConvertersForTypes.cs b/src/StripeTests/Wholesome/CorrectJsonConvertersForTypes.cs index aaeabd5c38..7c04d86fbe 100644 --- a/src/StripeTests/Wholesome/CorrectJsonConvertersForTypes.cs +++ b/src/StripeTests/Wholesome/CorrectJsonConvertersForTypes.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -118,4 +117,3 @@ private static string GetConverterName(Type type, Type[] genericTypeArguments) } } } -#endif diff --git a/src/StripeTests/Wholesome/DontForgetEntityType.cs b/src/StripeTests/Wholesome/DontForgetEntityType.cs index 8822b90f0f..0a77b4fe93 100644 --- a/src/StripeTests/Wholesome/DontForgetEntityType.cs +++ b/src/StripeTests/Wholesome/DontForgetEntityType.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -55,4 +54,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/DontForgetIHasInterfaces.cs b/src/StripeTests/Wholesome/DontForgetIHasInterfaces.cs index 01aaa2d1db..9957420b48 100644 --- a/src/StripeTests/Wholesome/DontForgetIHasInterfaces.cs +++ b/src/StripeTests/Wholesome/DontForgetIHasInterfaces.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -65,4 +64,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/DontSerializeNullDeletedAttrs.cs b/src/StripeTests/Wholesome/DontSerializeNullDeletedAttrs.cs index e12fdd16ae..48ea047495 100644 --- a/src/StripeTests/Wholesome/DontSerializeNullDeletedAttrs.cs +++ b/src/StripeTests/Wholesome/DontSerializeNullDeletedAttrs.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -73,4 +72,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/JsonNamesAreSnakeCase.cs b/src/StripeTests/Wholesome/JsonNamesAreSnakeCase.cs index d12bf4b09c..0b576f2e12 100644 --- a/src/StripeTests/Wholesome/JsonNamesAreSnakeCase.cs +++ b/src/StripeTests/Wholesome/JsonNamesAreSnakeCase.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -54,4 +53,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/JsonNamesMatchPropertyNames.cs b/src/StripeTests/Wholesome/JsonNamesMatchPropertyNames.cs index bb3709fd23..89b686c4f9 100644 --- a/src/StripeTests/Wholesome/JsonNamesMatchPropertyNames.cs +++ b/src/StripeTests/Wholesome/JsonNamesMatchPropertyNames.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -65,4 +64,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/NoDuplicateJsonPropertyValues.cs b/src/StripeTests/Wholesome/NoDuplicateJsonPropertyValues.cs index 9e3f71891b..5b550e813e 100644 --- a/src/StripeTests/Wholesome/NoDuplicateJsonPropertyValues.cs +++ b/src/StripeTests/Wholesome/NoDuplicateJsonPropertyValues.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -57,4 +56,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/NullableValueTypes.cs b/src/StripeTests/Wholesome/NullableValueTypes.cs index bc80536841..0d948facf1 100644 --- a/src/StripeTests/Wholesome/NullableValueTypes.cs +++ b/src/StripeTests/Wholesome/NullableValueTypes.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -60,4 +59,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/PropertiesHaveJsonAttributes.cs b/src/StripeTests/Wholesome/PropertiesHaveJsonAttributes.cs index b1dd6842ba..35d2086066 100644 --- a/src/StripeTests/Wholesome/PropertiesHaveJsonAttributes.cs +++ b/src/StripeTests/Wholesome/PropertiesHaveJsonAttributes.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -59,4 +58,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/UseListsInsteadOfArrays.cs b/src/StripeTests/Wholesome/UseListsInsteadOfArrays.cs index 8ec5b14f2b..1b700365f3 100644 --- a/src/StripeTests/Wholesome/UseListsInsteadOfArrays.cs +++ b/src/StripeTests/Wholesome/UseListsInsteadOfArrays.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -53,4 +52,3 @@ public void Check() } } } -#endif diff --git a/src/StripeTests/Wholesome/WholesomeTest.cs b/src/StripeTests/Wholesome/WholesomeTest.cs index c681626ff8..1346c0a1aa 100644 --- a/src/StripeTests/Wholesome/WholesomeTest.cs +++ b/src/StripeTests/Wholesome/WholesomeTest.cs @@ -1,4 +1,3 @@ -#if NETCOREAPP namespace StripeTests { using System; @@ -68,4 +67,3 @@ protected static List GetClassesWithInterface(Type implementedInterface) } } } -#endif From 623c81725c09da0b2229bac543524c098daae040 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Tue, 3 Mar 2020 09:03:15 -0800 Subject: [PATCH 5/7] Move to latest API version and remove deprecated properties --- appveyor.yml | 2 +- .../ChargePaymentMethodDetailsCardPresent.cs | 8 -------- .../Entities/WebhookEndpoints/WebhookEndpoint.cs | 8 -------- .../Infrastructure/Public/StripeConfiguration.cs | 2 +- src/Stripe.net/Services/Charges/ChargeListOptions.cs | 4 ---- .../Issuing/Cards/AuthorizationControlsOptions.cs | 4 ---- src/StripeTests/StripeMockFixture.cs | 2 +- 7 files changed, 3 insertions(+), 27 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9fb6ab0c14..d5f0d559b1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ environment: COVERALLS_REPO_TOKEN: secure: T0PmP8uyzCseacBCDRBlti2y9Tz5DL6fknea0MKWvbPYrzADmLY2/5kOTfYIsPUk # If you bump this, don't forget to bump `MinimumMockVersion` in `StripeMockFixture.cs` as well. - STRIPE_MOCK_VERSION: 0.82.0 + STRIPE_MOCK_VERSION: 0.83.0 deploy: - provider: NuGet diff --git a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardPresent.cs b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardPresent.cs index 26c812e944..e52cd1e2c5 100644 --- a/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardPresent.cs +++ b/src/Stripe.net/Entities/Charges/ChargePaymentMethodDetails/ChargePaymentMethodDetailsCardPresent.cs @@ -61,14 +61,6 @@ public class ChargePaymentMethodDetailsCardPresent : StripeEntity this.GeneratedCard; - set => this.GeneratedCardId = value; - } - /// /// The last four digits of the card. /// diff --git a/src/Stripe.net/Entities/WebhookEndpoints/WebhookEndpoint.cs b/src/Stripe.net/Entities/WebhookEndpoints/WebhookEndpoint.cs index 806cd7833e..3d73b7cf48 100644 --- a/src/Stripe.net/Entities/WebhookEndpoints/WebhookEndpoint.cs +++ b/src/Stripe.net/Entities/WebhookEndpoints/WebhookEndpoint.cs @@ -31,14 +31,6 @@ public class WebhookEndpoint : StripeEntity, IHasId, IHasObject [JsonProperty("application")] public string Application { get; set; } - [Obsolete("Use Application instead")] - [JsonIgnore] - public string ApplicationId - { - get => this.Application; - set => this.Application = value; - } - [Obsolete("This property was never returned. Use Application instead")] [JsonProperty("connect")] public bool Connect { get; set; } diff --git a/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs b/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs index 261e161682..aeffec3005 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeConfiguration.cs @@ -30,7 +30,7 @@ static StripeConfiguration() } /// API version used by Stripe.net. - public static string ApiVersion => "2019-12-03"; + public static string ApiVersion => "2020-03-02"; /// Gets or sets the API key. /// diff --git a/src/Stripe.net/Services/Charges/ChargeListOptions.cs b/src/Stripe.net/Services/Charges/ChargeListOptions.cs index 7be538ce66..40eac9cd9e 100644 --- a/src/Stripe.net/Services/Charges/ChargeListOptions.cs +++ b/src/Stripe.net/Services/Charges/ChargeListOptions.cs @@ -18,10 +18,6 @@ public class ChargeListOptions : ListOptionsWithCreated [JsonProperty("payment_intent")] public string PaymentIntent { get; set; } - [Obsolete("This parameter is deprecated. Filter the returned list of charges instead.")] - [JsonProperty("source")] - public ChargeSourceListOptions Source { get; set; } - /// /// Only return charges for this transfer group. /// diff --git a/src/Stripe.net/Services/Issuing/Cards/AuthorizationControlsOptions.cs b/src/Stripe.net/Services/Issuing/Cards/AuthorizationControlsOptions.cs index a311206067..217b3725d9 100644 --- a/src/Stripe.net/Services/Issuing/Cards/AuthorizationControlsOptions.cs +++ b/src/Stripe.net/Services/Issuing/Cards/AuthorizationControlsOptions.cs @@ -19,10 +19,6 @@ public class AuthorizationControlsOptions : INestedOptions [JsonProperty("blocked_categories")] public List BlockedCategories { get; set; } - [Obsolete("Use SpendingLimits instead.")] - [JsonProperty("max_amount")] - public long? MaxAmount { get; set; } - /// /// Maximum count of approved authorizations on this card. Counts all authorizations /// retroactively. diff --git a/src/StripeTests/StripeMockFixture.cs b/src/StripeTests/StripeMockFixture.cs index 4e360fa65e..ba57671ef9 100644 --- a/src/StripeTests/StripeMockFixture.cs +++ b/src/StripeTests/StripeMockFixture.cs @@ -13,7 +13,7 @@ public class StripeMockFixture : IDisposable /// If you bump this, don't forget to bump STRIPE_MOCK_VERSION in appveyor.yml /// as well. /// - private const string MockMinimumVersion = "0.82.0"; + private const string MockMinimumVersion = "0.83.0"; private readonly string port; From 47acacacd737a19e9f901f74f7c938c75e264619 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Tue, 3 Mar 2020 09:32:15 -0800 Subject: [PATCH 6/7] Get accurate runtime version (#1936) --- .../Public/SystemNetHttpClient.cs | 32 +-- .../Infrastructure/RuntimeInformation.cs | 269 ++++++++++++++++-- src/Stripe.net/Stripe.net.csproj | 3 +- 3 files changed, 254 insertions(+), 50 deletions(-) diff --git a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs index 9124a859fc..87e427a15b 100644 --- a/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs +++ b/src/Stripe.net/Infrastructure/Public/SystemNetHttpClient.cs @@ -21,6 +21,16 @@ namespace Stripe /// public class SystemNetHttpClient : IHttpClient { + private const string StripeNetTargetFramework = +#if NETSTANDARD2_0 + "netstandard2.0" +#elif NET45 + "net45" +#else + "unknown" +#endif + ; + private static readonly Lazy LazyDefaultHttpClient = new Lazy(BuildDefaultSystemNetHttpClient); @@ -204,29 +214,11 @@ private string BuildStripeClientUserAgentString() { "bindings_version", StripeConfiguration.StripeNetVersion }, { "lang", ".net" }, { "publisher", "stripe" }, - { "lang_version", RuntimeInformation.GetLanguageVersion() }, + { "lang_version", RuntimeInformation.GetRuntimeVersion() }, { "os_version", RuntimeInformation.GetOSVersion() }, + { "stripe_net_target_framework", StripeNetTargetFramework }, }; -#if NET45 - string monoVersion = RuntimeInformation.GetMonoVersion(); - if (!string.IsNullOrEmpty(monoVersion)) - { - values.Add("mono_version", monoVersion); - } -#endif - - var stripeNetTargetFramework = -#if NET45 - "net45" -#elif NETSTANDARD2_0 - "netstandard2.0" -#else - "unknown" -#endif - ; - values.Add("stripe_net_target_framework", stripeNetTargetFramework); - if (this.appInfo != null) { values.Add("application", this.appInfo); diff --git a/src/Stripe.net/Infrastructure/RuntimeInformation.cs b/src/Stripe.net/Infrastructure/RuntimeInformation.cs index d234dda8f0..4a2e118bec 100644 --- a/src/Stripe.net/Infrastructure/RuntimeInformation.cs +++ b/src/Stripe.net/Infrastructure/RuntimeInformation.cs @@ -1,53 +1,264 @@ namespace Stripe.Infrastructure { -#if NET45 using System; + using System.Diagnostics; + using System.IO; + using System.Linq; using System.Reflection; - using Microsoft.Win32; -#endif + using System.Runtime.Versioning; + using static System.Runtime.InteropServices.RuntimeInformation; + /// + /// This class is used to gather information about the runtime environment. This is actually a + /// non-trivial task. The code below is largely borrowed from the + /// BenchmarkDotNet project. + /// internal static class RuntimeInformation { - public static string GetLanguageVersion() + internal const string Unknown = "?"; + + internal static bool IsMono { get; } = Type.GetType("Mono.Runtime") != null; + + internal static bool IsFullFramework => FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase); + + internal static bool IsNetCore => FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(typeof(object).Assembly.Location); + + /// + /// "The north star for CoreRT is to be a flavor of .NET Core" -> CoreRT reports .NET Core everywhere. + /// + internal static bool IsCoreRT + => FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase) + && string.IsNullOrEmpty(typeof(object).Assembly.Location); // but it's merged to a single .exe and .Location returns null here ;) + + internal static bool IsRunningInContainer => string.Equals(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER"), "true"); + + /// Returns a string that describes the operating system on which the app is running. + /// A string that describes the operating system on which the app is running. + public static string GetOSVersion() { -#if NET45 - return ".NET Framework 4.5+"; -#else - return System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; -#endif + return OSDescription; } - public static string GetOSVersion() + /// Returns a string that indicates the name of the .NET installation on which an app is running. + /// A string that indicates the name of the .NET installation on which an app is running. + public static string GetRuntimeVersion() + { + if (IsMono) + { + return GetMonoVersion(); + } + else if (IsFullFramework) + { + return GetFullFrameworkVersion(); + } + else if (IsNetCore) + { + return GetNetCoreVersion(); + } + else if (IsCoreRT) + { + return FrameworkDescription.Replace("Core ", "CoreRT "); + } + + return Unknown; + } + + internal static string GetMonoVersion() + { + var monoRuntimeType = Type.GetType("Mono.Runtime"); + var monoDisplayName = monoRuntimeType?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); + if (monoDisplayName != null) + { + string version = monoDisplayName.Invoke(null, null)?.ToString(); + if (version != null) + { + int bracket1 = version.IndexOf('('), bracket2 = version.IndexOf(')'); + if (bracket1 != -1 && bracket2 != -1) + { + string comment = version.Substring(bracket1 + 1, bracket2 - bracket1 - 1); + var commentParts = comment.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + if (commentParts.Length > 2) + { + version = version.Substring(0, bracket1) + "(" + commentParts[0] + " " + commentParts[1] + ")"; + } + } + } + + return "Mono " + version; + } + + return Unknown; + } + + internal static string GetFullFrameworkVersion() { -#if NET45 - return Environment.OSVersion.ToString(); -#else - return System.Runtime.InteropServices.RuntimeInformation.OSDescription; -#endif + var fullName = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; // sth like .NET Framework 4.7.3324.0 + var servicingVersion = new string(fullName.SkipWhile(c => !char.IsDigit(c)).ToArray()); + var releaseVersion = MapToReleaseVersion(servicingVersion); + + return $".NET Framework {releaseVersion}"; } -#if NET45 - public static string GetMonoVersion() + internal static string MapToReleaseVersion(string servicingVersion) { - Type monoRuntimeType = typeof(object).Assembly.GetType("Mono.Runtime"); + // the following code assumes that .NET 4.5 is the oldest supported version + if (string.Compare(servicingVersion, "4.5.1") < 0) + { + return "4.5"; + } + + if (string.Compare(servicingVersion, "4.5.2") < 0) + { + return "4.5.1"; + } + + if (string.Compare(servicingVersion, "4.6") < 0) + { + return "4.5.2"; + } + + if (string.Compare(servicingVersion, "4.6.1") < 0) + { + return "4.6"; + } + + if (string.Compare(servicingVersion, "4.6.2") < 0) + { + return "4.6.1"; + } + + if (string.Compare(servicingVersion, "4.7") < 0) + { + return "4.6.2"; + } - if (monoRuntimeType != null) + if (string.Compare(servicingVersion, "4.7.1") < 0) { - MethodInfo getDisplayNameMethod = monoRuntimeType.GetMethod( - "GetDisplayName", - BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.ExactBinding, - null, - Type.EmptyTypes, - null); + return "4.7"; + } - if (getDisplayNameMethod != null) + if (string.Compare(servicingVersion, "4.7.2") < 0) + { + return "4.7.1"; + } + + if (string.Compare(servicingVersion, "4.8") < 0) + { + return "4.7.2"; + } + + return "4.8"; // most probably the last major release of Full .NET Framework + } + + internal static string GetNetCoreVersion() + { + string runtimeVersion = TryGetCoreRuntimeVersion(out var version) ? version.ToString() : "?"; + + return $".NET Core {runtimeVersion}"; + } + + internal static bool TryGetCoreRuntimeVersion(out Version version) + { + // we can't just use System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription + // because it can be null and it reports versions like 4.6.* for .NET Core 2.* + string runtimeDirectory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(); + if (TryGetVersionFromRuntimeDirectory(runtimeDirectory, out version)) + { + return true; + } + + // systemPrivateCoreLib.Product*Part properties return 0 so we have to implement some ugly parsing... + var systemPrivateCoreLib = FileVersionInfo.GetVersionInfo(typeof(object).Assembly.Location); + if (TryGetVersionFromProductInfo(systemPrivateCoreLib.ProductVersion, systemPrivateCoreLib.ProductName, out version)) + { + return true; + } + + string frameworkName = Assembly.GetEntryAssembly()?.GetCustomAttribute()?.FrameworkName; + if (TryGetVersionFromFrameworkName(frameworkName, out version)) + { + return true; + } + + if (IsRunningInContainer) + { + return Version.TryParse(Environment.GetEnvironmentVariable("DOTNET_VERSION"), out version) + || Version.TryParse(Environment.GetEnvironmentVariable("ASPNETCORE_VERSION"), out version); + } + + version = null; + return false; + } + + // sample input: + // for dotnet run: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.12\ + // for dotnet publish: C:\Users\adsitnik\source\repos\ConsoleApp25\ConsoleApp25\bin\Release\netcoreapp2.0\win-x64\publish\ + internal static bool TryGetVersionFromRuntimeDirectory(string runtimeDirectory, out Version version) + { + if (!string.IsNullOrEmpty(runtimeDirectory) && Version.TryParse(GetParsableVersionPart(new DirectoryInfo(runtimeDirectory).Name), out version)) + { + return true; + } + + version = null; + return false; + } + + // sample input: + // 2.0: 4.6.26614.01 @BuiltBy: dlab14-DDVSOWINAGE018 @Commit: a536e7eec55c538c94639cefe295aa672996bf9b, Microsoft .NET Framework + // 2.1: 4.6.27817.01 @BuiltBy: dlab14-DDVSOWINAGE101 @Branch: release/2.1 @SrcCode: https://github.com/dotnet/coreclr/tree/6f78fbb3f964b4f407a2efb713a186384a167e5c, Microsoft .NET Framework + // 2.2: 4.6.27817.03 @BuiltBy: dlab14-DDVSOWINAGE101 @Branch: release/2.2 @SrcCode: https://github.com/dotnet/coreclr/tree/ce1d090d33b400a25620c0145046471495067cc7, Microsoft .NET Framework + // 3.0: 3.0.0-preview8.19379.2+ac25be694a5385a6a1496db40de932df0689b742, Microsoft .NET Core + // 5.0: 5.0.0-alpha1.19413.7+0ecefa44c9d66adb8a997d5778dc6c246ad393a7, Microsoft .NET Core + internal static bool TryGetVersionFromProductInfo(string productVersion, string productName, out Version version) + { + if (!string.IsNullOrEmpty(productVersion) && !string.IsNullOrEmpty(productName)) + { + if (productName.IndexOf(".NET Core", StringComparison.OrdinalIgnoreCase) >= 0) { - return (string)getDisplayNameMethod.Invoke(null, null); + string parsableVersion = GetParsableVersionPart(productVersion); + if (Version.TryParse(productVersion, out version) || Version.TryParse(parsableVersion, out version)) + { + return true; + } + } + + // yes, .NET Core 2.X has a product name == .NET Framework... + if (productName.IndexOf(".NET Framework", StringComparison.OrdinalIgnoreCase) >= 0) + { + const string releaseVersionPrefix = "release/"; + int releaseVersionIndex = productVersion.IndexOf(releaseVersionPrefix); + if (releaseVersionIndex > 0) + { + string releaseVersion = GetParsableVersionPart(productVersion.Substring(releaseVersionIndex + releaseVersionPrefix.Length)); + + return Version.TryParse(releaseVersion, out version); + } } } - return null; + version = null; + return false; } -#endif + + // sample input: + // .NETCoreApp,Version=v2.0 + // .NETCoreApp,Version=v2.1 + internal static bool TryGetVersionFromFrameworkName(string frameworkName, out Version version) + { + const string versionPrefix = ".NETCoreApp,Version=v"; + if (!string.IsNullOrEmpty(frameworkName) && frameworkName.StartsWith(versionPrefix)) + { + string frameworkVersion = GetParsableVersionPart(frameworkName.Substring(versionPrefix.Length)); + + return Version.TryParse(frameworkVersion, out version); + } + + version = null; + return false; + } + + // Version.TryParse does not handle thing like 3.0.0-WORD + private static string GetParsableVersionPart(string fullVersionName) => new string(fullVersionName.TakeWhile(c => char.IsDigit(c) || c == '.').ToArray()); } } diff --git a/src/Stripe.net/Stripe.net.csproj b/src/Stripe.net/Stripe.net.csproj index 5d59800cb6..791083ae7e 100644 --- a/src/Stripe.net/Stripe.net.csproj +++ b/src/Stripe.net/Stripe.net.csproj @@ -26,7 +26,7 @@ - + runtime; build; native; contentfiles; analyzers @@ -39,6 +39,7 @@ + From 7960e377103c0766fc6f56c797aaa30a70baabcf Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Tue, 3 Mar 2020 09:47:37 -0800 Subject: [PATCH 7/7] Add support for `NextInvoiceSequence` on `Customer` --- src/Stripe.net/Entities/Customers/Customer.cs | 6 ++++++ src/Stripe.net/Services/Customers/CustomerCreateOptions.cs | 6 ++++++ src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/Stripe.net/Entities/Customers/Customer.cs b/src/Stripe.net/Entities/Customers/Customer.cs index b644ee79c3..7c277d29bc 100644 --- a/src/Stripe.net/Entities/Customers/Customer.cs +++ b/src/Stripe.net/Entities/Customers/Customer.cs @@ -134,6 +134,12 @@ public IPaymentSource DefaultSource [JsonProperty("name")] public string Name { get; set; } + /// + /// The suffix of the customer’s next invoice number. + /// + [JsonProperty("next_invoice_sequence")] + public long NextInvoiceSequence { get; set; } + /// /// The customer’s phone number. /// diff --git a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs index dc7e293d7b..9dd72a5040 100644 --- a/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerCreateOptions.cs @@ -47,6 +47,12 @@ public class CustomerCreateOptions : BaseOptions, IHasMetadata [JsonProperty("name")] public string Name { get; set; } + /// + /// The suffix of the customer’s next invoice number. + /// + [JsonProperty("next_invoice_sequence")] + public long? NextInvoiceSequence { get; set; } + [JsonProperty("payment_method")] public string PaymentMethod { get; set; } diff --git a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs index 4e1618352e..6841a6ed8b 100644 --- a/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs +++ b/src/Stripe.net/Services/Customers/CustomerUpdateOptions.cs @@ -50,6 +50,12 @@ public class CustomerUpdateOptions : BaseOptions, IHasMetadata [JsonProperty("name")] public string Name { get; set; } + /// + /// The suffix of the customer’s next invoice number. + /// + [JsonProperty("next_invoice_sequence")] + public long? NextInvoiceSequence { get; set; } + /// /// The customer’s phone number. ///