class Stripe::ErrorObject

Represents an error object as returned by the API.

@see stripe.com/docs/api/errors

Public Instance Methods

charge() click to toggle source

For card errors, the ID of the failed charge.

# File lib/stripe/error_object.rb, line 15
def charge
  @values[:charge]
end
code() click to toggle source

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
decline_code() click to toggle source

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
doc_url() click to toggle source

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
message() click to toggle source

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
param() click to toggle source

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
payment_intent() click to toggle source

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
payment_method() click to toggle source

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
setup_intent() click to toggle source

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
source() click to toggle source

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
type() click to toggle source

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