class Stripe::ErrorObject
Represents an error object as returned by the API.
Public Instance Methods
For card errors, the ID of the failed charge.
# File lib/stripe/error_object.rb, line 15 def charge @values[:charge] end
For some errors that could be handled programmatically, a short string indicating the error code reported.
# File lib/stripe/error_object.rb, line 21 def code @values[:code] end
For card errors resulting from a card issuer decline, a short string indicating the card issuer's reason for the decline if they provide one.
# File lib/stripe/error_object.rb, line 27 def decline_code @values[:decline_code] end
A URL to more information about the error code reported.
# File lib/stripe/error_object.rb, line 32 def doc_url @values[:doc_url] end
A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
# File lib/stripe/error_object.rb, line 38 def message @values[:message] end
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.
# File lib/stripe/error_object.rb, line 45 def param @values[:param] end
The PaymentIntent
object for errors returned on a request involving a PaymentIntent
.
# File lib/stripe/error_object.rb, line 51 def payment_intent @values[:payment_intent] end
The PaymentMethod
object for errors returned on a request involving a PaymentMethod
.
# File lib/stripe/error_object.rb, line 57 def payment_method @values[:payment_method] end
The SetupIntent
object for errors returned on a request involving a SetupIntent
.
# File lib/stripe/error_object.rb, line 63 def setup_intent @values[:setup_intent] end
The source object for errors returned on a request involving a source.
# File lib/stripe/error_object.rb, line 68 def source @values[:source] end
The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`.
# File lib/stripe/error_object.rb, line 74 def type @values[:type] end