You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/stripe/error_object.rb
+43-19Lines changed: 43 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -11,69 +11,93 @@ class ErrorObject < StripeObject
11
11
# methods would cause users to run into `NoMethodError` exceptions and
12
12
# get in the way of generic error handling.
13
13
14
+
# errorFields: The beginning of the section generated from our OpenAPI spec
15
+
# For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one.
16
+
defadvice_code
17
+
@values[:advice_code]
18
+
end
19
+
14
20
# For card errors, the ID of the failed charge.
15
21
defcharge
16
22
@values[:charge]
17
23
end
18
24
19
-
# For some errors that could be handled programmatically, a short string
20
-
# indicating the error code reported.
25
+
# For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.
21
26
defcode
22
27
@values[:code]
23
28
end
24
29
25
-
# For card errors resulting from a card issuer decline, a short string
26
-
# indicating the card issuer's reason for the decline if they provide one.
30
+
# For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://docs.stripe.com/declines#issuer-declines) if they provide one.
27
31
defdecline_code
28
32
@values[:decline_code]
29
33
end
30
34
31
-
# A URL to more information about the error code reported.
35
+
# A URL to more information about the [error code](https://docs.stripe.com/error-codes) reported.
32
36
defdoc_url
33
37
@values[:doc_url]
34
38
end
35
39
36
-
# A human-readable message providing more details about the error. For card
37
-
# errors, these messages can be shown to your users.
40
+
# A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
38
41
defmessage
39
42
@values[:message]
40
43
end
41
44
42
-
# If the error is parameter-specific, the parameter related to the error.
43
-
# For example, you can use this to display a message near the correct form
44
-
# field.
45
+
# For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
46
+
defnetwork_advice_code
47
+
@values[:network_advice_code]
48
+
end
49
+
50
+
# For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
51
+
defnetwork_decline_code
52
+
@values[:network_decline_code]
53
+
end
54
+
55
+
# 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.
45
56
defparam
46
57
@values[:param]
47
58
end
48
59
49
-
# The PaymentIntent object for errors returned on a request involving a
50
-
# PaymentIntent.
60
+
# The PaymentIntent object for errors returned on a request involving a PaymentIntent.
51
61
defpayment_intent
52
62
@values[:payment_intent]
53
63
end
54
64
55
-
# The PaymentMethod object for errors returned on a request involving a
56
-
# PaymentMethod.
65
+
# The PaymentMethod object for errors returned on a request involving a PaymentMethod.
57
66
defpayment_method
58
67
@values[:payment_method]
59
68
end
60
69
61
-
# The SetupIntent object for errors returned on a request involving a
62
-
# SetupIntent.
70
+
# 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.
71
+
defpayment_method_type
72
+
@values[:payment_method_type]
73
+
end
74
+
75
+
# A URL to the request log entry in your dashboard.
76
+
defrequest_log_url
77
+
@values[:request_log_url]
78
+
end
79
+
80
+
# The SetupIntent object for errors returned on a request involving a SetupIntent.
63
81
defsetup_intent
64
82
@values[:setup_intent]
65
83
end
66
84
67
-
# The source object for errors returned on a request involving a source.
85
+
# The PaymentSource object for errors returned on a request involving a PaymentSource.
68
86
defsource
69
87
@values[:source]
70
88
end
71
89
72
-
# The type of error returned. One of `api_error`, `card_error`,
73
-
# `idempotency_error`, or `invalid_request_error`.
90
+
# The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
74
91
deftype
75
92
@values[:type]
76
93
end
94
+
95
+
# The user message associated with the error.
96
+
defuser_message
97
+
@values[:user_message]
98
+
end
99
+
100
+
# errorFields: The end of the section generated from our OpenAPI spec
77
101
end
78
102
79
103
# Represents on OAuth error returned by the OAuth API.
0 commit comments