Class: Ingenico::Connect::SDK::Domain::Payment::Order
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Payment::Order
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/order.rb
Instance Attribute Summary collapse
-
#additional_input ⇒ Ingenico::Connect::SDK::Domain::Payment::AdditionalOrderInput
The current value of additional_input.
-
#amount_of_money ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
The current value of amount_of_money.
-
#customer ⇒ Ingenico::Connect::SDK::Domain::Payment::Customer
The current value of customer.
-
#items ⇒ Object
deprecated
Deprecated.
Use shoppingCart.items instead
-
#references ⇒ Ingenico::Connect::SDK::Domain::Payment::OrderReferences
The current value of references.
-
#seller ⇒ Object
deprecated
Deprecated.
Use Merchant.seller instead
-
#shipping ⇒ Ingenico::Connect::SDK::Domain::Payment::Shipping
The current value of shipping.
-
#shopping_cart ⇒ Ingenico::Connect::SDK::Domain::Payment::ShoppingCart
The current value of shopping_cart.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#additional_input ⇒ Ingenico::Connect::SDK::Domain::Payment::AdditionalOrderInput
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def additional_input @additional_input end |
#amount_of_money ⇒ Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def amount_of_money @amount_of_money end |
#customer ⇒ Ingenico::Connect::SDK::Domain::Payment::Customer
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def customer @customer end |
#items ⇒ Object
Deprecated.
Use shoppingCart.items instead
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def items @items end |
#references ⇒ Ingenico::Connect::SDK::Domain::Payment::OrderReferences
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def references @references end |
#seller ⇒ Object
Deprecated.
Use Merchant.seller instead
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def seller @seller end |
#shipping ⇒ Ingenico::Connect::SDK::Domain::Payment::Shipping
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def shipping @shipping end |
#shopping_cart ⇒ Ingenico::Connect::SDK::Domain::Payment::ShoppingCart
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 28 def shopping_cart @shopping_cart end |
Instance Method Details
#from_hash(hash) ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 64 def from_hash(hash) super if hash.has_key? 'additionalInput' raise TypeError, "value '%s' is not a Hash" % [hash['additionalInput']] unless hash['additionalInput'].is_a? Hash @additional_input = Ingenico::Connect::SDK::Domain::Payment::AdditionalOrderInput.new_from_hash(hash['additionalInput']) end if hash.has_key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = Ingenico::Connect::SDK::Domain::Definitions::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.has_key? 'customer' raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash @customer = Ingenico::Connect::SDK::Domain::Payment::Customer.new_from_hash(hash['customer']) end if hash.has_key? 'items' raise TypeError, "value '%s' is not an Array" % [hash['items']] unless hash['items'].is_a? Array @items = [] hash['items'].each do |e| @items << Ingenico::Connect::SDK::Domain::Payment::LineItem.new_from_hash(e) end end if hash.has_key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = Ingenico::Connect::SDK::Domain::Payment::OrderReferences.new_from_hash(hash['references']) end if hash.has_key? 'seller' raise TypeError, "value '%s' is not a Hash" % [hash['seller']] unless hash['seller'].is_a? Hash @seller = Ingenico::Connect::SDK::Domain::Payment::Seller.new_from_hash(hash['seller']) end if hash.has_key? 'shipping' raise TypeError, "value '%s' is not a Hash" % [hash['shipping']] unless hash['shipping'].is_a? Hash @shipping = Ingenico::Connect::SDK::Domain::Payment::Shipping.new_from_hash(hash['shipping']) end if hash.has_key? 'shoppingCart' raise TypeError, "value '%s' is not a Hash" % [hash['shoppingCart']] unless hash['shoppingCart'].is_a? Hash @shopping_cart = Ingenico::Connect::SDK::Domain::Payment::ShoppingCart.new_from_hash(hash['shoppingCart']) end end |
#to_h ⇒ Hash
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ingenico/connect/sdk/domain/payment/order.rb', line 51 def to_h hash = super hash['additionalInput'] = @additional_input.to_h unless @additional_input.nil? hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['customer'] = @customer.to_h unless @customer.nil? hash['items'] = @items.collect{|val| val.to_h} unless @items.nil? hash['references'] = @references.to_h unless @references.nil? hash['seller'] = @seller.to_h unless @seller.nil? hash['shipping'] = @shipping.to_h unless @shipping.nil? hash['shoppingCart'] = @shopping_cart.to_h unless @shopping_cart.nil? hash end |