Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Release a major version with multiple large breaking changes #1277

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ a) In your application initialization, set your API key (only once once during s
StripeConfiguration.SetApiKey("[your api key here]");
```

b) Pass the API key to [StripeRequestOptions](#requestoptions):
b) Pass the API key to [RequestOptions](#requestoptions):

```csharp
var planService = new StripePlanService();
planService.Get(*planId*, new StripeRequestOptions() { ApiKey = "[your api key here]" });
var planService = new PlanService();
planService.Get(*planId*, new RequestOptions() { ApiKey = "[your api key here]" });
```

You can obtain your secret API key from the [API Settings](https://dashboard.stripe.com/account/apikeys) in the Dashboard.
Expand All @@ -63,10 +63,10 @@ If you are using Xamarin/Mono, you may want to provide your own `HttpMessageHand

### Request Options

All of the service methods accept an optional `StripeRequestOptions` object. This is used if you need an [Idempotency Key](https://stripe.com/docs/api?lang=curl#idempotent_requests), if you are using [Stripe Connect](https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header), or if you want to pass the secret API key on each method.
All of the service methods accept an optional `RequestOptions` object. This is used if you need an [Idempotency Key](https://stripe.com/docs/api?lang=curl#idempotent_requests), if you are using [Stripe Connect](https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header), or if you want to pass the secret API key on each method.

```csharp
var requestOptions = new StripeRequestOptions();
var requestOptions = new RequestOptions();
requestOptions.ApiKey = "SECRET API KEY"; // (optional) set the api key on a per-request basis
requestOptions.IdempotencyKey = "SOME STRING"; // (optional) create an idempotent request
requestOptions.StripeConnectAccountId = "CONNECTED ACCOUNT ID"; // (optional) authenticate as a connected account
Expand All @@ -78,7 +78,7 @@ The [`StripeResponse`](./src/Stripe.net/Infrastructure/public/StripeResponse.cs)

**Example: Access the StripeResponse**
```csharp
var chargeService = new StripeChargeService();
var chargeService = new ChargeService();
StripeCharge charge = chargeService.Create(...);
StripeResponse response = charge.StripeResponse;
```
Expand Down Expand Up @@ -113,18 +113,18 @@ public class StripeResponse

### Date Filtering

Many of the `List()`-methods support parameters to filter by date. You can use the `StripeDateFilter` class to combine the filters to make more interesting and complex queries.
Many of the `List()`-methods support parameters to filter by date. You can use the `DateFilter` class to combine the filters to make more interesting and complex queries.

**Example: Interesting Queries with StripeDateFilter**
**Example: Interesting Queries with DateFilter**
```csharp
var chargeService = new StripeChargeService();
var chargeService = new ChargeService();

var chargesToday = chargeService.List(new StripeChargeListOptions {
Created = new StripeDateFilter { GreaterThanOrEqual = DateTime.UtcNow.Date }
var chargesToday = chargeService.List(new ChargeListOptions {
Created = new DateFilter { GreaterThanOrEqual = DateTime.UtcNow.Date }
});

var chargesYesterday = chargeService.List(new StripeChargeListOptions {
Created = new StripeDateFilter {
var chargesYesterday = chargeService.List(new ChargeListOptions {
Created = new DateFilter {
GreaterThanOrEqual = DateTime.Now.AddDays(-1).Date,
LessThan = DateTime.Now.Date
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeAccountType
public static class AccountType
{
public const string Custom = "custom";
public const string Standard = "standard";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
using System;

public static class StripeEvents
public static class Events
{
/// <summary>
/// Occurs whenever an account status or property has changed.
Expand Down Expand Up @@ -452,7 +452,12 @@ public static class StripeEvents
/// <summary>
/// Occurs whenever a source transaction is created.
/// </summary>
public const string SourceTransactionCanceled = "source.transaction.created";
public const string SourceTransactionCreated = "source.transaction.created";

/// <summary>
/// Occurs whenever a source transaction is updated.
/// </summary>
public const string SourceTransactionUpdated = "source.transaction.updated";

/// <summary>
/// Occurs whenever a new transfer is created.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeFilePurpose
public static class FilePurpose
{
public const string BusinessLogo = "business_logo";
public const string DisputeEvidence = "dispute_evidence";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripePlanIntervals
public static class PlanIntervals
{
public const string Day = "day";
public const string Week = "week";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeRefundReasons
public static class RefundReasons
{
public const string Unknown = null;
public const string Duplicate = "duplicate";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeSourceFlow
public static class SourceFlow
{
public const string Redirect = "redirect";
public const string Receiver = "receiver";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeSourceType
public static class SourceType
{
public const string AchCreditTransfer = "ach_credit_transfer";
public const string Bancontact = "bancontact";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeSourceUsage
public static class SourceUsage
{
public const string Reusable = "reusable";
public const string SingleUse = "single_use";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeSubscriptionStatuses
public static class SubscriptionStatuses
{
public const string Trialing = "trialing";
public const string Active = "active";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeTransferFailureCodes
public static class TransferFailureCodes
{
public const string InsufficientFunds = "insufficient_funds";
public const string AccountClosed = "account_closed";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Stripe
{
public static class StripeTransferMethod
public static class TransferMethod
{
/// <summary>
/// Standard is the default method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class StripeAccount : StripeEntityWithId, ISupportMetadata
public class Account : StripeEntityWithId, ISupportMetadata
{
[JsonProperty("object")]
public string Object { get; set; }
Expand All @@ -15,14 +15,14 @@ public class StripeAccount : StripeEntityWithId, ISupportMetadata
public string BusinessLogoFileId { get; set; }

[JsonIgnore]
public StripeFileUpload BusinessLogo { get; set; }
public FileUpload BusinessLogo { get; set; }

[JsonProperty("business_logo")]
internal object InternalBusinessLogo
{
set
{
StringOrObject<StripeFileUpload>.Map(value, s => this.BusinessLogoFileId = s, o => this.BusinessLogo = o);
StringOrObject<FileUpload>.Map(value, s => this.BusinessLogoFileId = s, o => this.BusinessLogo = o);
}
}
#endregion
Expand All @@ -43,7 +43,7 @@ internal object InternalBusinessLogo
public string Country { get; set; }

[JsonProperty("created")]
[JsonConverter(typeof(StripeDateTimeConverter))]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime Created { get; set; }

[JsonProperty("currencies_supported")]
Expand All @@ -53,11 +53,17 @@ internal object InternalBusinessLogo
public bool DebitNegativeBalances { get; set; }

[JsonProperty("decline_charge_on")]
public StripeDeclineChargeOn DeclineChargeOn { get; set; }
public DeclineChargeOn DeclineChargeOn { get; set; }

[JsonProperty("default_currency")]
public string DefaultCurrency { get; set; }

/// <summary>
/// Whether this object is deleted or not.
/// </summary>
[JsonProperty("deleted")]
public bool Deleted { get; set; }

[JsonProperty("details_submitted")]
public bool DetailsSubmitted { get; set; }

Expand All @@ -68,10 +74,10 @@ internal object InternalBusinessLogo
public string Email { get; set; }

[JsonProperty("external_accounts")]
public StripeList<StripeExternalAccount> ExternalAccounts { get; set; }
public StripeList<ExternalAccount> ExternalAccounts { get; set; }

[JsonProperty("legal_entity")]
public StripeLegalEntity LegalEntity { get; set; }
public LegalEntity LegalEntity { get; set; }

[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
Expand All @@ -95,7 +101,7 @@ internal object InternalBusinessLogo
public string Timezone { get; set; }

[JsonProperty("tos_acceptance")]
public StripeTermsOfServiceAcceptance TermsOfServiceAcceptance { get; set; }
public TermsOfServiceAcceptance TermsOfServiceAcceptance { get; set; }

[JsonProperty("type")]
public string Type { get; set; }
Expand All @@ -104,15 +110,15 @@ internal object InternalBusinessLogo
public bool PayoutsEnabled { get; set; }

[JsonProperty("payout_schedule")]
public StripePayoutSchedule PayoutSchedule { get; set; }
public PayoutSchedule PayoutSchedule { get; set; }

[JsonProperty("payout_statement_descriptor")]
public string PayoutStatementDescriptor { get; set; }

[JsonProperty("verification")]
public StripeAccountVerification AccountVerification { get; set; }
public AccountVerification AccountVerification { get; set; }

[JsonProperty("keys")]
public StripeCustomAccountKeys CustomAccountKeys { get; set; }
public CustomAccountKeys CustomAccountKeys { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class StripeAccountVerification : StripeEntity
public class AccountVerification : StripeEntity
{
[JsonProperty("disabled_reason")]
public string DisabledReason { get; set; }

[JsonProperty("due_by")]
[JsonConverter(typeof(StripeDateTimeConverter))]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime? DueBy { get; set; }

[JsonProperty("fields_needed")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{
using Newtonsoft.Json;

public class StripeAdditionalOwners : StripeEntity
public class AdditionalOwners : StripeEntity
{
[JsonProperty("address")]
public StripeAddress Address { get; set; }
public Address Address { get; set; }

[JsonProperty("dob")]
public StripeBirthDay BirthDay { get; set; }
public BirthDay BirthDay { get; set; }

[JsonProperty("first_name")]
public string FirstName { get; set; }
Expand All @@ -17,6 +17,6 @@ public class StripeAdditionalOwners : StripeEntity
public string LastName { get; set; }

[JsonProperty("verification")]
public StripeLegalEntityVerification LegalEntityVerification { get; set; }
public LegalEntityVerification LegalEntityVerification { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
using Newtonsoft.Json;

public class StripeAddress : StripeEntity
public class Address : StripeEntity
{
[JsonProperty("city")]
public string City { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class StripeApplePayDomain : StripeEntityWithId
public class ApplePayDomain : StripeEntityWithId
{
[JsonProperty("object")]
public string Object { get; set; }

[JsonProperty("created")]
[JsonConverter(typeof(StripeDateTimeConverter))]
[JsonConverter(typeof(DateTimeConverter))]
public DateTime Created { get; set; }

/// <summary>
/// Whether this object is deleted or not.
/// </summary>
[JsonProperty("deleted")]
public bool Deleted { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
using Newtonsoft.Json;

public class StripeApplication : StripeEntityWithId
public class Application : StripeEntityWithId
{
[JsonProperty("object")]
public string Object { get; set; }
Expand Down
Loading