Skip to content

Commit bd39334

Browse files
committed
Revamp interfaces on Stripe model classes
1 parent c619901 commit bd39334

File tree

142 files changed

+355
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+355
-183
lines changed

src/Stripe.net/Entities/Accounts/Account.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ namespace Stripe
66
using Newtonsoft.Json;
77
using Stripe.Infrastructure;
88

9-
public class Account : StripeEntityWithId, ISupportMetadata
9+
public class Account : StripeEntity, IHasId, IHasObject
1010
{
11+
[JsonProperty("id")]
12+
public string Id { get; set; }
13+
1114
[JsonProperty("object")]
1215
public string Object { get; set; }
1316

src/Stripe.net/Entities/Accounts/AdditionalOwners.cs src/Stripe.net/Entities/Accounts/AdditionalOwner.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Stripe
22
{
33
using Newtonsoft.Json;
44

5-
public class AdditionalOwners : StripeEntity
5+
public class AdditionalOwner : StripeEntity
66
{
77
[JsonProperty("address")]
88
public Address Address { get; set; }

src/Stripe.net/Entities/Accounts/LegalEntity.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Stripe
66
public class LegalEntity : StripeEntity
77
{
88
[JsonProperty("additional_owners")]
9-
public List<AdditionalOwners> AdditionalOwners { get; set; }
9+
public List<AdditionalOwner> AdditionalOwners { get; set; }
1010

1111
[JsonProperty("address")]
1212
public Address Address { get; set; }

src/Stripe.net/Entities/ApplePayDomains/ApplePayDomain.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ namespace Stripe
44
using Newtonsoft.Json;
55
using Stripe.Infrastructure;
66

7-
public class ApplePayDomain : StripeEntityWithId
7+
public class ApplePayDomain : StripeEntity, IHasId, IHasObject
88
{
9+
[JsonProperty("id")]
10+
public string Id { get; set; }
11+
912
[JsonProperty("object")]
1013
public string Object { get; set; }
1114

src/Stripe.net/Entities/ApplicationFeeRefunds/ApplicationFeeRefund.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class ApplicationFeeRefund : StripeEntityWithId, ISupportMetadata
8+
public class ApplicationFeeRefund : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/ApplicationFees/ApplicationFee.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ namespace Stripe
44
using Newtonsoft.Json;
55
using Stripe.Infrastructure;
66

7-
public class ApplicationFee : StripeEntityWithId
7+
public class ApplicationFee : StripeEntity, IHasId, IHasObject
88
{
9+
[JsonProperty("id")]
10+
public string Id { get; set; }
11+
912
[JsonProperty("object")]
1013
public string Object { get; set; }
1114

src/Stripe.net/Entities/Balance/Balance.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Stripe
33
using System.Collections.Generic;
44
using Newtonsoft.Json;
55

6-
public class Balance : StripeEntity
6+
public class Balance : StripeEntity, IHasObject
77
{
88
[JsonProperty("object")]
99
public string Object { get; set; }

src/Stripe.net/Entities/BalanceTransactions/BalanceTransaction.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class BalanceTransaction : StripeEntityWithId
8+
public class BalanceTransaction : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/BalanceTransactions/BalanceTransactionSource.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ public enum BalanceTransactionSourceType
1919
}
2020

2121
[JsonConverter(typeof(BalanceTransactionSourceConverter))]
22-
public class BalanceTransactionSource : StripeEntityWithId
22+
public class BalanceTransactionSource : StripeEntity, IHasId
2323
{
24+
[JsonProperty("id")]
25+
public string Id { get; set; }
26+
2427
public BalanceTransactionSourceType Type { get; set; }
2528

2629
public ApplicationFee ApplicationFee { get; set; }

src/Stripe.net/Entities/BankAccounts/BankAccount.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class BankAccount : StripeEntityWithId, ISupportMetadata
8+
public class BankAccount : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/Cards/Card.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ namespace Stripe
44
using Newtonsoft.Json;
55
using Stripe.Infrastructure;
66

7-
public class Card : StripeEntityWithId, ISupportMetadata
7+
public class Card : StripeEntity, IHasId, IHasObject
88
{
9+
[JsonProperty("id")]
10+
public string Id { get; set; }
11+
912
[JsonProperty("object")]
1013
public string Object { get; set; }
1114

src/Stripe.net/Entities/Charges/Charge.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class Charge : StripeEntityWithId, ISupportMetadata
8+
public class Charge : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/Charges/Outcome.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Stripe
33
using Newtonsoft.Json;
44
using Stripe.Infrastructure;
55

6-
public class Outcome : StripeEntityWithId
6+
public class Outcome : StripeEntity
77
{
88
/// <summary>
99
/// Possible values are approved_by_network, declined_by_network, not_sent_to_network, and reversed_after_approval. The value reversed_after_approval indicates the payment was blocked by Stripe after bank authorization, and may temporarily appear as “pending” on a cardholder’s statement.

src/Stripe.net/Entities/Charges/OutcomeRule.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ namespace Stripe
22
{
33
using Newtonsoft.Json;
44

5-
public class OutcomeRule : StripeEntityWithId
5+
public class OutcomeRule : StripeEntity, IHasId
66
{
7+
[JsonProperty("id")]
8+
public string Id { get; set; }
9+
710
[JsonProperty("action")]
811
public string Action { get; set; }
912

src/Stripe.net/Entities/Common/Application.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ namespace Stripe
22
{
33
using Newtonsoft.Json;
44

5-
public class Application : StripeEntityWithId
5+
public class Application : StripeEntity, IHasId, IHasObject
66
{
7+
[JsonProperty("id")]
8+
public string Id { get; set; }
9+
710
[JsonProperty("object")]
811
public string Object { get; set; }
912

src/Stripe.net/Entities/Common/PaymentSource.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ public enum PaymentSourceType
1212
}
1313

1414
[JsonConverter(typeof(PaymentSourceConverter))]
15-
public class PaymentSource : StripeEntityWithId
15+
public class PaymentSource : StripeEntity, IHasId
1616
{
17+
[JsonProperty("id")]
18+
public string Id { get; set; }
19+
1720
public PaymentSourceType Type { get; set; }
1821

1922
public Account Account { get; set; }

src/Stripe.net/Entities/Common/Review.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ namespace Stripe
44
using Newtonsoft.Json;
55
using Stripe.Infrastructure;
66

7-
public class Review : StripeEntityWithId
7+
public class Review : StripeEntity, IHasId, IHasObject
88
{
9+
[JsonProperty("id")]
10+
public string Id { get; set; }
11+
912
[JsonProperty("object")]
1013
public string Object { get; set; }
1114

src/Stripe.net/Entities/CountrySpecs/CountrySpec.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ namespace Stripe
33
using System.Collections.Generic;
44
using Newtonsoft.Json;
55

6-
public class CountrySpec : StripeEntityWithId
6+
public class CountrySpec : StripeEntity, IHasId, IHasObject
77
{
8+
[JsonProperty("id")]
9+
public string Id { get; set; }
10+
811
[JsonProperty("object")]
912
public string Object { get; set; }
1013

src/Stripe.net/Entities/Coupons/Coupon.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class Coupon : StripeEntityWithId, ISupportMetadata
8+
public class Coupon : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/Customers/Customer.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class Customer : StripeEntityWithId, ISupportMetadata
8+
public class Customer : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/Discounts/Discount.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Stripe
44
using Newtonsoft.Json;
55
using Stripe.Infrastructure;
66

7-
public class Discount : StripeEntityWithId
7+
public class Discount : StripeEntity, IHasObject
88
{
99
[JsonProperty("object")]
1010
public string Object { get; set; }

src/Stripe.net/Entities/Disputes/Dispute.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class Dispute : StripeEntityWithId, ISupportMetadata
8+
public class Dispute : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/EphemeralKeys/EphemeralKey.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class EphemeralKey : StripeEntityWithId
8+
public class EphemeralKey : StripeEntity, IHasId, IHasObject
99
{
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1013
[JsonProperty("object")]
1114
public string Object { get; set; }
1215

src/Stripe.net/Entities/EphemeralKeys/EphemeralkeyAssociatedObject.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ namespace Stripe
22
{
33
using Newtonsoft.Json;
44

5-
public class EphemeralKeyAssociatedObject : StripeEntityWithId
5+
public class EphemeralKeyAssociatedObject : StripeEntity
66
{
7+
[JsonProperty("id")]
8+
public string Id { get; set; }
9+
710
[JsonProperty("type")]
811
public string Type { get; set; }
912
}

src/Stripe.net/Entities/Events/Event.cs

+5-21
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ namespace Stripe
44
using Newtonsoft.Json;
55
using Stripe.Infrastructure;
66

7-
public class Event : StripeEntityWithId
7+
public class Event : StripeEntity, IHasId, IHasObject
88
{
9+
[JsonProperty("id")]
10+
public string Id { get; set; }
11+
912
[JsonProperty("object")]
1013
public string Object { get; set; }
1114

@@ -27,27 +30,8 @@ public class Event : StripeEntityWithId
2730
[JsonProperty("pending_webhooks")]
2831
public int PendingWebhooks { get; set; }
2932

30-
#region Request
31-
32-
/*
33-
* This works like expandable properties. it's used for the event having just a string for the request id or
34-
* the Request object for requests after the 2017-05-25 api release
35-
*/
36-
37-
public string RequestId { get; set; }
38-
39-
[JsonIgnore]
40-
public EventRequest Request { get; set; }
41-
4233
[JsonProperty("request")]
43-
internal object InternalRequest
44-
{
45-
set
46-
{
47-
StringOrObject<EventRequest>.Map(value, s => this.RequestId = s, o => this.Request = o);
48-
}
49-
}
50-
#endregion
34+
public EventRequest Request { get; set; }
5135

5236
[JsonProperty("type")]
5337
public string Type { get; set; }

src/Stripe.net/Entities/Events/EventRequest.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ namespace Stripe
22
{
33
using Newtonsoft.Json;
44

5-
public class EventRequest : StripeEntityWithId
5+
public class EventRequest : StripeEntity
66
{
7+
[JsonProperty("id")]
8+
public string Id { get; set; }
9+
710
[JsonProperty("idempotency_key")]
811
public string IdempotencyKey { get; set; }
912
}

src/Stripe.net/Entities/ExchangeRates/ExchangeRate.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ namespace Stripe
33
using System.Collections.Generic;
44
using Newtonsoft.Json;
55

6-
public class ExchangeRate : StripeEntityWithId
6+
public class ExchangeRate : StripeEntity, IHasId, IHasObject
77
{
8+
[JsonProperty("id")]
9+
public string Id { get; set; }
10+
811
[JsonProperty("object")]
912
public string Object { get; set; }
1013

src/Stripe.net/Entities/ExternalAccounts/ExternalAccount.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ public enum ExternalAccountType
1010
}
1111

1212
[JsonConverter(typeof(ExternalAccountConverter))]
13-
public class ExternalAccount : StripeEntityWithId
13+
public class ExternalAccount : StripeEntity, IHasId
1414
{
15+
[JsonProperty("id")]
16+
public string Id { get; set; }
17+
1518
public ExternalAccountType Type { get; set; }
1619

1720
public Card Card { get; set; }

src/Stripe.net/Entities/FileLinks/FileLink.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace Stripe
55
using Newtonsoft.Json;
66
using Stripe.Infrastructure;
77

8-
public class FileLink : StripeEntityWithId, ISupportMetadata
8+
public class FileLink : StripeEntity, IHasId, IHasObject
99
{
10-
/// <summary>
11-
/// String representing the object’s type. Objects of the same type share the same value.
12-
/// </summary>
10+
[JsonProperty("id")]
11+
public string Id { get; set; }
12+
1313
[JsonProperty("object")]
1414
public string Object { get; set; }
1515

0 commit comments

Comments
 (0)