Class: PaysecureApiDocumentationLive::Success51Exception
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- PaysecureApiDocumentationLive::Success51Exception
- Defined in:
- lib/paysecure_api_documentation_live/exceptions/success51_exception.rb
Overview
Success51 class.
Instance Attribute Summary collapse
-
#amount ⇒ Float
TODO: Write general description for this method.
-
#created_on ⇒ Integer
TODO: Write general description for this method.
-
#currency ⇒ String
TODO: Write general description for this method.
-
#purchase_id ⇒ String
TODO: Write general description for this method.
-
#reason ⇒ String
TODO: Write general description for this method.
-
#refund_id ⇒ String
TODO: Write general description for this method.
-
#refund_on ⇒ Integer
TODO: Write general description for this method.
-
#status ⇒ String
TODO: Write general description for this method.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ Success51Exception
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ Success51Exception
The constructor.
47 48 49 50 51 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 47 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#amount ⇒ Float
TODO: Write general description for this method
22 23 24 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 22 def amount @amount end |
#created_on ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 26 def created_on @created_on end |
#currency ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 42 def currency @currency end |
#purchase_id ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 18 def purchase_id @purchase_id end |
#reason ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 38 def reason @reason end |
#refund_id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 14 def refund_id @refund_id end |
#refund_on ⇒ Integer
TODO: Write general description for this method
30 31 32 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 30 def refund_on @refund_on end |
#status ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 34 def status @status end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
78 79 80 81 82 83 84 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 78 def inspect class_name = self.class.name.split('::').last "<#{class_name} refund_id: #{@refund_id.inspect}, purchase_id: #{@purchase_id.inspect},"\ " amount: #{@amount.inspect}, created_on: #{@created_on.inspect}, refund_on:"\ " #{@refund_on.inspect}, status: #{@status.inspect}, reason: #{@reason.inspect}, currency:"\ " #{@currency.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
70 71 72 73 74 75 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 70 def to_s class_name = self.class.name.split('::').last "<#{class_name} refund_id: #{@refund_id}, purchase_id: #{@purchase_id}, amount: #{@amount},"\ " created_on: #{@created_on}, refund_on: #{@refund_on}, status: #{@status}, reason:"\ " #{@reason}, currency: #{@currency}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/paysecure_api_documentation_live/exceptions/success51_exception.rb', line 56 def unbox(hash) return nil unless hash @refund_id = hash.key?('refundId') ? hash['refundId'] : nil @purchase_id = hash.key?('purchaseId') ? hash['purchaseId'] : nil @amount = hash.key?('amount') ? hash['amount'] : nil @created_on = hash.key?('createdOn') ? hash['createdOn'] : nil @refund_on = hash.key?('refundOn') ? hash['refundOn'] : nil @status = hash.key?('status') ? hash['status'] : nil @reason = hash.key?('reason') ? hash['reason'] : nil @currency = hash.key?('currency') ? hash['currency'] : nil end |