Class: OnlinePayments::SDK::Domain::PaymentSummary
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentSummary
- Defined in:
- lib/onlinepayments/sdk/domain/payment_summary.rb
Instance Attribute Summary collapse
-
#id ⇒ String
The current value of id.
-
#payment_output ⇒ OnlinePayments::SDK::Domain::PaymentOutputSummary
The current value of payment_output.
-
#status ⇒ String
The current value of status.
-
#status_output ⇒ OnlinePayments::SDK::Domain::PaymentStatusOutputSummary
The current value of status_output.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#id ⇒ String
Returns the current value of id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_summary.rb', line 15 def id @id end |
#payment_output ⇒ OnlinePayments::SDK::Domain::PaymentOutputSummary
Returns the current value of payment_output.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_summary.rb', line 15 def payment_output @payment_output end |
#status ⇒ String
Returns the current value of status.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_summary.rb', line 15 def status @status end |
#status_output ⇒ OnlinePayments::SDK::Domain::PaymentStatusOutputSummary
Returns the current value of status_output.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_summary.rb', line 15 def status_output @status_output end |
Instance Method Details
#from_hash(hash) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/onlinepayments/sdk/domain/payment_summary.rb', line 35 def from_hash(hash) super if hash.has_key? 'id' @id = hash['id'] end if hash.has_key? 'paymentOutput' raise TypeError, "value '%s' is not a Hash" % [hash['paymentOutput']] unless hash['paymentOutput'].is_a? Hash @payment_output = OnlinePayments::SDK::Domain::PaymentOutputSummary.new_from_hash(hash['paymentOutput']) end if hash.has_key? 'status' @status = hash['status'] end if hash.has_key? 'statusOutput' raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash @status_output = OnlinePayments::SDK::Domain::PaymentStatusOutputSummary.new_from_hash(hash['statusOutput']) end end |
#to_h ⇒ Hash
26 27 28 29 30 31 32 33 |
# File 'lib/onlinepayments/sdk/domain/payment_summary.rb', line 26 def to_h hash = super hash['id'] = @id unless @id.nil? hash['paymentOutput'] = @payment_output.to_h unless @payment_output.nil? hash['status'] = @status unless @status.nil? hash['statusOutput'] = @status_output.to_h unless @status_output.nil? hash end |