Class: Stripe::ErrorObject

Inherits:
StripeObject show all
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

#last_response

Instance Method Summary collapse

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, field_remappings, #hash, #initialize, inner_class_types, #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

#advice_codeObject

errorFields: The beginning of the section generated from our OpenAPI spec For card errors resulting from a card issuer decline, a short string indicating how to proceed with an error if they provide one.



16
17
18
# File 'lib/stripe/error_object.rb', line 16

def advice_code
  @values[:advice_code]
end

#chargeObject

For card errors, the ID of the failed charge.



21
22
23
# File 'lib/stripe/error_object.rb', line 21

def charge
  @values[:charge]
end

#codeObject

For some errors that could be handled programmatically, a short string indicating the error code reported.



26
27
28
# File 'lib/stripe/error_object.rb', line 26

def code
  @values[:code]
end

#decline_codeObject

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.



31
32
33
# File 'lib/stripe/error_object.rb', line 31

def decline_code
  @values[:decline_code]
end

#doc_urlObject

A URL to more information about the error code reported.



36
37
38
# File 'lib/stripe/error_object.rb', line 36

def doc_url
  @values[:doc_url]
end

#messageObject

A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.



41
42
43
# File 'lib/stripe/error_object.rb', line 41

def message
  @values[:message]
end

#network_advice_codeObject

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
47
48
# File 'lib/stripe/error_object.rb', line 46

def network_advice_code
  @values[:network_advice_code]
end

#network_decline_codeObject

For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.



51
52
53
# File 'lib/stripe/error_object.rb', line 51

def network_decline_code
  @values[:network_decline_code]
end

#paramObject

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.



56
57
58
# File 'lib/stripe/error_object.rb', line 56

def param
  @values[:param]
end

#payment_intentObject

The PaymentIntent object for errors returned on a request involving a PaymentIntent.



61
62
63
# File 'lib/stripe/error_object.rb', line 61

def payment_intent
  @values[:payment_intent]
end

#payment_methodObject

The PaymentMethod object for errors returned on a request involving a PaymentMethod.



66
67
68
# File 'lib/stripe/error_object.rb', line 66

def payment_method
  @values[:payment_method]
end

#payment_method_typeObject

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
72
73
# File 'lib/stripe/error_object.rb', line 71

def payment_method_type
  @values[:payment_method_type]
end

#request_log_urlObject

A URL to the request log entry in your dashboard.



76
77
78
# File 'lib/stripe/error_object.rb', line 76

def request_log_url
  @values[:request_log_url]
end

#setup_intentObject

The SetupIntent object for errors returned on a request involving a SetupIntent.



81
82
83
# File 'lib/stripe/error_object.rb', line 81

def setup_intent
  @values[:setup_intent]
end

#sourceObject

The PaymentSource object for errors returned on a request involving a PaymentSource.



86
87
88
# File 'lib/stripe/error_object.rb', line 86

def source
  @values[:source]
end

#typeObject

The type of error returned. One of api_error, card_error, idempotency_error, or invalid_request_error



91
92
93
# File 'lib/stripe/error_object.rb', line 91

def type
  @values[:type]
end

#user_messageObject

The user message associated with the error.



96
97
98
# File 'lib/stripe/error_object.rb', line 96

def user_message
  @values[:user_message]
end