Class: OnlinePayments::SDK::Domain::PaymentResponse
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PaymentResponse
- Defined in:
- lib/onlinepayments/sdk/domain/payment_response.rb
Instance Attribute Summary collapse
-
#hosted_checkout_specific_output ⇒ OnlinePayments::SDK::Domain::HostedCheckoutSpecificOutput
The current value of hosted_checkout_specific_output.
-
#id ⇒ String
The current value of id.
-
#payment_output ⇒ OnlinePayments::SDK::Domain::PaymentOutput
The current value of payment_output.
-
#session_details ⇒ OnlinePayments::SDK::Domain::SessionDetails
The current value of session_details.
-
#status ⇒ String
The current value of status.
-
#status_output ⇒ OnlinePayments::SDK::Domain::PaymentStatusOutput
The current value of status_output.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#hosted_checkout_specific_output ⇒ OnlinePayments::SDK::Domain::HostedCheckoutSpecificOutput
Returns the current value of hosted_checkout_specific_output.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 19 def hosted_checkout_specific_output @hosted_checkout_specific_output end |
#id ⇒ String
Returns the current value of id.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 19 def id @id end |
#payment_output ⇒ OnlinePayments::SDK::Domain::PaymentOutput
Returns the current value of payment_output.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 19 def payment_output @payment_output end |
#session_details ⇒ OnlinePayments::SDK::Domain::SessionDetails
Returns the current value of session_details.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 19 def session_details @session_details end |
#status ⇒ String
Returns the current value of status.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 19 def status @status end |
#status_output ⇒ OnlinePayments::SDK::Domain::PaymentStatusOutput
Returns the current value of status_output.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 19 def status_output @status_output end |
Instance Method Details
#from_hash(hash) ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 45 def from_hash(hash) super if hash.has_key? 'hostedCheckoutSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['hostedCheckoutSpecificOutput']] unless hash['hostedCheckoutSpecificOutput'].is_a? Hash @hosted_checkout_specific_output = OnlinePayments::SDK::Domain::HostedCheckoutSpecificOutput.new_from_hash(hash['hostedCheckoutSpecificOutput']) end 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::PaymentOutput.new_from_hash(hash['paymentOutput']) end if hash.has_key? 'sessionDetails' raise TypeError, "value '%s' is not a Hash" % [hash['sessionDetails']] unless hash['sessionDetails'].is_a? Hash @session_details = OnlinePayments::SDK::Domain::SessionDetails.new_from_hash(hash['sessionDetails']) 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::PaymentStatusOutput.new_from_hash(hash['statusOutput']) end end |
#to_h ⇒ Hash
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/onlinepayments/sdk/domain/payment_response.rb', line 34 def to_h hash = super hash['hostedCheckoutSpecificOutput'] = @hosted_checkout_specific_output.to_h unless @hosted_checkout_specific_output.nil? hash['id'] = @id unless @id.nil? hash['paymentOutput'] = @payment_output.to_h unless @payment_output.nil? hash['sessionDetails'] = @session_details.to_h unless @session_details.nil? hash['status'] = @status unless @status.nil? hash['statusOutput'] = @status_output.to_h unless @status_output.nil? hash end |