Class: Ingenico::Direct::SDK::Domain::Order
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::Order
- Defined in:
- lib/ingenico/direct/sdk/domain/order.rb
Instance Attribute Summary collapse
-
#additional_input ⇒ Ingenico::Direct::SDK::Domain::AdditionalOrderInput
The current value of additional_input.
-
#amount_of_money ⇒ Ingenico::Direct::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#customer ⇒ Ingenico::Direct::SDK::Domain::Customer
The current value of customer.
-
#references ⇒ Ingenico::Direct::SDK::Domain::OrderReferences
The current value of references.
-
#shipping ⇒ Ingenico::Direct::SDK::Domain::Shipping
The current value of shipping.
-
#shopping_cart ⇒ Ingenico::Direct::SDK::Domain::ShoppingCart
The current value of shopping_cart.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#additional_input ⇒ Ingenico::Direct::SDK::Domain::AdditionalOrderInput
Returns the current value of additional_input.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 22 def additional_input @additional_input end |
#amount_of_money ⇒ Ingenico::Direct::SDK::Domain::AmountOfMoney
Returns the current value of amount_of_money.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 22 def amount_of_money @amount_of_money end |
#customer ⇒ Ingenico::Direct::SDK::Domain::Customer
Returns the current value of customer.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 22 def customer @customer end |
#references ⇒ Ingenico::Direct::SDK::Domain::OrderReferences
Returns the current value of references.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 22 def references @references end |
#shipping ⇒ Ingenico::Direct::SDK::Domain::Shipping
Returns the current value of shipping.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 22 def shipping @shipping end |
#shopping_cart ⇒ Ingenico::Direct::SDK::Domain::ShoppingCart
Returns the current value of shopping_cart.
22 23 24 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 22 def shopping_cart @shopping_cart end |
Instance Method Details
#from_hash(hash) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 42 def from_hash(hash) super if hash.key? 'additionalInput' raise TypeError, "value '%s' is not a Hash" % [hash['additionalInput']] unless hash['additionalInput'].is_a? Hash @additional_input = Ingenico::Direct::SDK::Domain::AdditionalOrderInput.new_from_hash(hash['additionalInput']) end if hash.key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.key? 'customer' raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash @customer = Ingenico::Direct::SDK::Domain::Customer.new_from_hash(hash['customer']) end if hash.key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = Ingenico::Direct::SDK::Domain::OrderReferences.new_from_hash(hash['references']) end if hash.key? 'shipping' raise TypeError, "value '%s' is not a Hash" % [hash['shipping']] unless hash['shipping'].is_a? Hash @shipping = Ingenico::Direct::SDK::Domain::Shipping.new_from_hash(hash['shipping']) end if hash.key? 'shoppingCart' raise TypeError, "value '%s' is not a Hash" % [hash['shoppingCart']] unless hash['shoppingCart'].is_a? Hash @shopping_cart = Ingenico::Direct::SDK::Domain::ShoppingCart.new_from_hash(hash['shoppingCart']) end end |
#to_h ⇒ Hash
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ingenico/direct/sdk/domain/order.rb', line 31 def to_h hash = super hash['additionalInput'] = @additional_input.to_h if @additional_input hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money hash['customer'] = @customer.to_h if @customer hash['references'] = @references.to_h if @references hash['shipping'] = @shipping.to_h if @shipping hash['shoppingCart'] = @shopping_cart.to_h if @shopping_cart hash end |