-
Notifications
You must be signed in to change notification settings - Fork 573
/
Copy pathCard.cs
276 lines (239 loc) · 10.5 KB
/
Card.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;
public class Card : StripeEntity<Card>, IHasId, IHasMetadata, IHasObject, IExternalAccount, IPaymentSource
{
/// <summary>
/// Unique identifier for the object.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }
#region Expandable Account
/// <summary>
/// (ID of the Account)
/// The account this card belongs to. This attribute will not be in the card object if the
/// card belongs to a customer or recipient instead.
/// </summary>
[JsonIgnore]
public string AccountId
{
get => this.InternalAccount?.Id;
set => this.InternalAccount = SetExpandableFieldId(value, this.InternalAccount);
}
/// <summary>
/// (Expanded)
/// The account this card belongs to. This attribute will not be in the card object if the
/// card belongs to a customer or recipient instead.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Account Account
{
get => this.InternalAccount?.ExpandedObject;
set => this.InternalAccount = SetExpandableFieldObject(value, this.InternalAccount);
}
[JsonProperty("account")]
[JsonConverter(typeof(ExpandableFieldConverter<Account>))]
internal ExpandableField<Account> InternalAccount { get; set; }
#endregion
/// <summary>
/// City/District/Suburb/Town/Village.
/// </summary>
[JsonProperty("address_city")]
public string AddressCity { get; set; }
/// <summary>
/// Billing address country, if provided when creating card.
/// </summary>
[JsonProperty("address_country")]
public string AddressCountry { get; set; }
/// <summary>
/// Address line 1 (Street address/PO Box/Company name).
/// </summary>
[JsonProperty("address_line1")]
public string AddressLine1 { get; set; }
/// <summary>
/// If <c>address_line1</c> was provided, results of the check: <c>pass</c>, <c>fail</c>,
/// <c>unavailable</c>, or <c>unchecked</c>.
/// </summary>
[JsonProperty("address_line1_check")]
public string AddressLine1Check { get; set; }
/// <summary>
/// Address line 2 (Apartment/Suite/Unit/Building).
/// </summary>
[JsonProperty("address_line2")]
public string AddressLine2 { get; set; }
/// <summary>
/// State/County/Province/Region.
/// </summary>
[JsonProperty("address_state")]
public string AddressState { get; set; }
/// <summary>
/// ZIP or postal code.
/// </summary>
[JsonProperty("address_zip")]
public string AddressZip { get; set; }
/// <summary>
/// If <c>address_zip</c> was provided, results of the check: <c>pass</c>, <c>fail</c>,
/// <c>unavailable</c>, or <c>unchecked</c>.
/// </summary>
[JsonProperty("address_zip_check")]
public string AddressZipCheck { get; set; }
/// <summary>
/// A set of available payout methods for this card. Only values from this set should be
/// passed as the <c>method</c> when creating a payout.
/// </summary>
[JsonProperty("available_payout_methods")]
public List<string> AvailablePayoutMethods { get; set; }
/// <summary>
/// Card brand. Can be <c>American Express</c>, <c>Diners Club</c>, <c>Discover</c>,
/// <c>JCB</c>, <c>MasterCard</c>, <c>UnionPay</c>, <c>Visa</c>, or <c>Unknown</c>.
/// </summary>
[JsonProperty("brand")]
public string Brand { get; set; }
/// <summary>
/// Two-letter ISO code representing the country of the card. You could use this attribute
/// to get a sense of the international breakdown of cards you've collected.
/// </summary>
[JsonProperty("country")]
public string Country { get; set; }
/// <summary>
/// Three-letter <a href="https://stripe.com/docs/payouts">ISO code for currency</a>. Only
/// applicable on accounts (not customers or recipients). The card can be used as a transfer
/// destination for funds in this currency.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
#region Expandable Customer
/// <summary>
/// (ID of the Customer)
/// The customer that this card belongs to. This attribute will not be in the card object if
/// the card belongs to an account or recipient instead.
/// </summary>
[JsonIgnore]
public string CustomerId
{
get => this.InternalCustomer?.Id;
set => this.InternalCustomer = SetExpandableFieldId(value, this.InternalCustomer);
}
/// <summary>
/// (Expanded)
/// The customer that this card belongs to. This attribute will not be in the card object if
/// the card belongs to an account or recipient instead.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Customer Customer
{
get => this.InternalCustomer?.ExpandedObject;
set => this.InternalCustomer = SetExpandableFieldObject(value, this.InternalCustomer);
}
[JsonProperty("customer")]
[JsonConverter(typeof(ExpandableFieldConverter<Customer>))]
internal ExpandableField<Customer> InternalCustomer { get; set; }
#endregion
/// <summary>
/// If a CVC was provided, results of the check: <c>pass</c>, <c>fail</c>,
/// <c>unavailable</c>, or <c>unchecked</c>. A result of unchecked indicates that CVC was
/// provided but hasn't been checked yet. Checks are typically performed when attaching a
/// card to a Customer object, or when creating a charge. For more details, see <a
/// href="https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge">Check
/// if a card is valid without a charge</a>.
/// </summary>
[JsonProperty("cvc_check")]
public string CvcCheck { get; set; }
/// <summary>
/// Whether this card is the default external account for its currency.
/// </summary>
[JsonProperty("default_for_currency")]
public bool? DefaultForCurrency { get; set; }
/// <summary>
/// Whether this object is deleted or not.
/// </summary>
[JsonProperty("deleted", NullValueHandling = NullValueHandling.Ignore)]
public bool? Deleted { get; set; }
/// <summary>
/// A high-level description of the type of cards issued in this range. (For internal use
/// only and not typically available in standard API requests.).
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }
/// <summary>
/// (For tokenized numbers only.) The last four digits of the device account number.
/// </summary>
[JsonProperty("dynamic_last4")]
public string DynamicLast4 { get; set; }
/// <summary>
/// Two-digit number representing the card's expiration month.
/// </summary>
[JsonProperty("exp_month")]
public long ExpMonth { get; set; }
/// <summary>
/// Four-digit number representing the card's expiration year.
/// </summary>
[JsonProperty("exp_year")]
public long ExpYear { get; set; }
/// <summary>
/// Uniquely identifies this particular card number. You can use this attribute to check
/// whether two customers who’ve signed up with you are using the same card number, for
/// example. For payment methods that tokenize card information (Apple Pay, Google Pay), the
/// tokenized number might be provided instead of the underlying card number.
///
/// <em>Starting May 1, 2021, card fingerprint in India for Connect will change to allow two
/// fingerprints for the same card --- one for India and one for the rest of the world.</em>.
/// </summary>
[JsonProperty("fingerprint")]
public string Fingerprint { get; set; }
/// <summary>
/// Card funding type. Can be <c>credit</c>, <c>debit</c>, <c>prepaid</c>, or
/// <c>unknown</c>.
/// </summary>
[JsonProperty("funding")]
public string Funding { get; set; }
/// <summary>
/// Issuer identification number of the card. (For internal use only and not typically
/// available in standard API requests.).
/// </summary>
[JsonProperty("iin")]
public string Iin { get; set; }
/// <summary>
/// The name of the card's issuing bank. (For internal use only and not typically available
/// in standard API requests.).
/// </summary>
[JsonProperty("issuer")]
public string Issuer { get; set; }
/// <summary>
/// The last four digits of the card.
/// </summary>
[JsonProperty("last4")]
public string Last4 { get; set; }
/// <summary>
/// Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can
/// attach to an object. This can be useful for storing additional information about the
/// object in a structured format.
/// </summary>
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }
/// <summary>
/// Cardholder name.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// If the card number is tokenized, this is the method that was used. Can be
/// <c>android_pay</c> (includes Google Pay), <c>apple_pay</c>, <c>masterpass</c>,
/// <c>visa_checkout</c>, or null.
/// </summary>
[JsonProperty("tokenization_method")]
public string TokenizationMethod { get; set; }
}
}