-
Notifications
You must be signed in to change notification settings - Fork 570
/
StripeError.cs
110 lines (93 loc) · 3.92 KB
/
StripeError.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
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;
public class StripeError : StripeEntity<StripeError>
{
/*
* For regular API errors:
*/
/// <summary>For card errors, the ID of the failed charge.</summary>
[JsonProperty("charge")]
public string Charge { get; set; }
/// <summary>
/// For some errors that could be handled programmatically, a short string indicating the
/// <a href="https://stripe.com/docs/error-codes">error code</a> reported.
/// </summary>
[JsonProperty("code")]
public string Code { get; set; }
/// <summary>
/// For card errors resulting from a card issuer decline, a short string indicating the
/// <a href="https://stripe.com//docs/declines#issuer-declines">card issuer's reason for the
/// decline</a>.
/// </summary>
[JsonProperty("decline_code")]
public string DeclineCode { get; set; }
/// <summary>
/// A URL to more information about the <a href="https://stripe.com/docs/error-codes">error
/// code</a> reported.
/// </summary>
[JsonProperty("doc_url")]
public string DocUrl { get; set; }
/// <summary>
/// A human-readable message providing more details about the error. For card errors, these
/// messages can be shown to your users.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
/// <summary>
/// If the error is parameter-specific, the parameter related to the error. For example,
/// you can use this to display a message near the correct form field.
/// </summary>
[JsonProperty("param")]
public string Param { get; set; }
/// <summary>
/// The <see cref="Stripe.PaymentIntent"/> object for errors returned on a request
/// involving a <see cref="Stripe.PaymentIntent"/>.
/// </summary>
[JsonProperty("payment_intent")]
public PaymentIntent PaymentIntent { get; set; }
/// <summary>
/// The <see cref="Stripe.PaymentMethod"/> object for errors returned on a request
/// involving a <see cref="Stripe.PaymentMethod"/>.
/// </summary>
[JsonProperty("payment_method")]
public PaymentMethod PaymentMethod { get; set; }
/// <summary>
/// If the error is specific to the type of payment method, the payment method type that had
/// a problem. This field is only populated for invoice-related errors.
/// </summary>
[JsonProperty("payment_method_type")]
public string PaymentMethodType { get; set; }
/// <summary>
/// A URL to the request log entry in your dashboard.
/// </summary>
[JsonProperty("request_log_url")]
public string RequestLogUrl { get; set; }
/// <summary>
/// The <see cref="Stripe.SetupIntent"/> object for errors returned on a request
/// involving a <see cref="Stripe.SetupIntent"/>.
/// </summary>
[JsonProperty("setup_intent")]
public SetupIntent SetupIntent { get; set; }
/// <summary>
/// The source object for errors returned on a request involving a source.
/// </summary>
[JsonProperty("source")]
[JsonConverter(typeof(StripeObjectConverter))]
public IPaymentSource Source { get; set; }
/// <summary>
/// The type of error returned. One of <c>api_error</c>, <c>card_error</c>,
/// <c>idempotency_error</c>, or <c>invalid_request_error</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
/*
* For OAuth Errors:
*/
[JsonProperty("error")]
public string Error { get; set; }
[JsonProperty("error_description")]
public string ErrorDescription { get; set; }
}
}