Class: Ingenico::Connect::SDK::Domain::Payment::CreatePaymentResult
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Payment::CreatePaymentResult
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb
Overview
Class CreatePaymentResult
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#creation_output ⇒ Object
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb', line 18 def creation_output @creation_output end |
#merchant_action ⇒ Object
21 22 23 |
# File 'lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb', line 21 def merchant_action @merchant_action end |
#payment ⇒ Object
24 25 26 |
# File 'lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb', line 24 def payment @payment end |
Instance Method Details
#from_hash(hash) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb', line 34 def from_hash(hash) super if hash.has_key?('creationOutput') if !(hash['creationOutput'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['creationOutput']] end @creation_output = Ingenico::Connect::SDK::Domain::Payment::PaymentCreationOutput.new_from_hash(hash['creationOutput']) end if hash.has_key?('merchantAction') if !(hash['merchantAction'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['merchantAction']] end @merchant_action = Ingenico::Connect::SDK::Domain::Payment::MerchantAction.new_from_hash(hash['merchantAction']) end if hash.has_key?('payment') if !(hash['payment'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['payment']] end @payment = Ingenico::Connect::SDK::Domain::Payment::Payment.new_from_hash(hash['payment']) end end |
#to_h ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/ingenico/connect/sdk/domain/payment/create_payment_result.rb', line 26 def to_h hash = super add_to_hash(hash, 'creationOutput', @creation_output) add_to_hash(hash, 'merchantAction', @merchant_action) add_to_hash(hash, 'payment', @payment) hash end |