Exception: Google4R::Checkout::GoogleCheckoutError
- Inherits:
-
Exception
- Object
- Exception
- Google4R::Checkout::GoogleCheckoutError
- Defined in:
- lib/google4r/checkout/shared.rb
Overview
This exception is thrown by Command#send_to_google_checkout when an error occured.
Instance Attribute Summary collapse
-
#response_code ⇒ Object
readonly
The HTTP response code of Google’s response.
-
#serial_number ⇒ Object
readonly
The serial number of the error returned by Google.
Instance Method Summary collapse
-
#initialize(hash) ⇒ GoogleCheckoutError
constructor
The parameter is a hash with the entries :serial_number, :message and :response_code.
-
#to_s ⇒ Object
Returns a human readable representation of the Exception with the message, HTTP response code and serial number as returned by Google checkout.
Constructor Details
#initialize(hash) ⇒ GoogleCheckoutError
The parameter is a hash with the entries :serial_number, :message and :response_code. The attributes serial_number, message and response_code are set to the values in the Hash.
48 49 50 51 52 |
# File 'lib/google4r/checkout/shared.rb', line 48 def initialize(hash) @response_code = hash[:response_code] @message = hash[:message] @serial_number = hash[:serial_number] end |
Instance Attribute Details
#response_code ⇒ Object (readonly)
The HTTP response code of Google’s response.
43 44 45 |
# File 'lib/google4r/checkout/shared.rb', line 43 def response_code @response_code end |
#serial_number ⇒ Object (readonly)
The serial number of the error returned by Google.
40 41 42 |
# File 'lib/google4r/checkout/shared.rb', line 40 def serial_number @serial_number end |
Instance Method Details
#to_s ⇒ Object
Returns a human readable representation of the Exception with the message, HTTP response code and serial number as returned by Google checkout.
56 57 58 |
# File 'lib/google4r/checkout/shared.rb', line 56 def to_s "GoogleCheckoutError: message = '#{@message}', response code = '#{@response_code}', serial number = '#{@serial_number}'." end |