Class: Stripe::ErrorObject
- Inherits:
 - 
      StripeObject
      
        
- Object
 - StripeObject
 - Stripe::ErrorObject
 
 
- Defined in:
 - lib/stripe/error_object.rb
 
Overview
Represents an error object as returned by the API.
Constant Summary
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary
Attributes inherited from StripeObject
Instance Method Summary collapse
- 
  
    
      #charge  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
For card errors, the ID of the failed charge.
 - 
  
    
      #code  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
For some errors that could be handled programmatically, a short string indicating the error code reported.
 - 
  
    
      #decline_code  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
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.
 - 
  
    
      #doc_url  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
A URL to more information about the error code reported.
 - 
  
    
      #message  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
A human-readable message providing more details about the error.
 - 
  
    
      #param  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
If the error is parameter-specific, the parameter related to the error.
 - 
  
    
      #payment_intent  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The PaymentIntent object for errors returned on a request involving a PaymentIntent.
 - 
  
    
      #payment_method  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The PaymentMethod object for errors returned on a request involving a PaymentMethod.
 - 
  
    
      #setup_intent  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The SetupIntent object for errors returned on a request involving a SetupIntent.
 - 
  
    
      #source  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The source object for errors returned on a request involving a source.
 - 
  
    
      #type  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
The type of error returned.
 
Methods inherited from StripeObject
#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Method Details
#charge ⇒ Object
For card errors, the ID of the failed charge.
      15 16 17  | 
    
      # File 'lib/stripe/error_object.rb', line 15 def charge @values[:charge] end  | 
  
#code ⇒ Object
For some errors that could be handled programmatically, a short string indicating the error code reported.
      21 22 23  | 
    
      # File 'lib/stripe/error_object.rb', line 21 def code @values[:code] end  | 
  
#decline_code ⇒ Object
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.
      27 28 29  | 
    
      # File 'lib/stripe/error_object.rb', line 27 def decline_code @values[:decline_code] end  | 
  
#doc_url ⇒ Object
A URL to more information about the error code reported.
      32 33 34  | 
    
      # File 'lib/stripe/error_object.rb', line 32 def doc_url @values[:doc_url] end  | 
  
#message ⇒ Object
A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
      38 39 40  | 
    
      # File 'lib/stripe/error_object.rb', line 38 def @values[:message] end  | 
  
#param ⇒ Object
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 46 47  | 
    
      # File 'lib/stripe/error_object.rb', line 45 def param @values[:param] end  | 
  
#payment_intent ⇒ Object
The PaymentIntent object for errors returned on a request involving a PaymentIntent.
      51 52 53  | 
    
      # File 'lib/stripe/error_object.rb', line 51 def payment_intent @values[:payment_intent] end  | 
  
#payment_method ⇒ Object
The PaymentMethod object for errors returned on a request involving a PaymentMethod.
      57 58 59  | 
    
      # File 'lib/stripe/error_object.rb', line 57 def payment_method @values[:payment_method] end  | 
  
#setup_intent ⇒ Object
The SetupIntent object for errors returned on a request involving a SetupIntent.
      63 64 65  | 
    
      # File 'lib/stripe/error_object.rb', line 63 def setup_intent @values[:setup_intent] end  | 
  
#source ⇒ Object
The source object for errors returned on a request involving a source.
      68 69 70  | 
    
      # File 'lib/stripe/error_object.rb', line 68 def source @values[:source] end  | 
  
#type ⇒ Object
The type of error returned. One of ‘api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`.
      74 75 76  | 
    
      # File 'lib/stripe/error_object.rb', line 74 def type @values[:type] end  |