Class: OnlinePayments::SDK::Domain::Order
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::Order
- Defined in:
- lib/onlinepayments/sdk/domain/order.rb
Instance Attribute Summary collapse
-
#additional_input ⇒ OnlinePayments::SDK::Domain::AdditionalOrderInput
The current value of additional_input.
-
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#customer ⇒ OnlinePayments::SDK::Domain::Customer
The current value of customer.
-
#discount ⇒ OnlinePayments::SDK::Domain::Discount
The current value of discount.
-
#references ⇒ OnlinePayments::SDK::Domain::OrderReferences
The current value of references.
-
#shipping ⇒ OnlinePayments::SDK::Domain::Shipping
The current value of shipping.
-
#shopping_cart ⇒ OnlinePayments::SDK::Domain::ShoppingCart
The current value of shopping_cart.
-
#surcharge_specific_input ⇒ OnlinePayments::SDK::Domain::SurchargeSpecificInput
The current value of surcharge_specific_input.
-
#tax_percentage ⇒ float
The current value of tax_percentage.
-
#total_tax_amount ⇒ Integer
The current value of total_tax_amount.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#additional_input ⇒ OnlinePayments::SDK::Domain::AdditionalOrderInput
Returns the current value of additional_input.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def additional_input @additional_input end |
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of amount_of_money.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def amount_of_money @amount_of_money end |
#customer ⇒ OnlinePayments::SDK::Domain::Customer
Returns the current value of customer.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def customer @customer end |
#discount ⇒ OnlinePayments::SDK::Domain::Discount
Returns the current value of discount.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def discount @discount end |
#references ⇒ OnlinePayments::SDK::Domain::OrderReferences
Returns the current value of references.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def references @references end |
#shipping ⇒ OnlinePayments::SDK::Domain::Shipping
Returns the current value of shipping.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def shipping @shipping end |
#shopping_cart ⇒ OnlinePayments::SDK::Domain::ShoppingCart
Returns the current value of shopping_cart.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def shopping_cart @shopping_cart end |
#surcharge_specific_input ⇒ OnlinePayments::SDK::Domain::SurchargeSpecificInput
Returns the current value of surcharge_specific_input.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def surcharge_specific_input @surcharge_specific_input end |
#tax_percentage ⇒ float
Returns the current value of tax_percentage.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def tax_percentage @tax_percentage end |
#total_tax_amount ⇒ Integer
Returns the current value of total_tax_amount.
27 28 29 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 27 def total_tax_amount @total_tax_amount end |
Instance Method Details
#from_hash(hash) ⇒ Object
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 102 103 104 105 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 65 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 = OnlinePayments::SDK::Domain::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 = OnlinePayments::SDK::Domain::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 = OnlinePayments::SDK::Domain::Customer.new_from_hash(hash['customer']) end if hash.has_key? 'discount' raise TypeError, "value '%s' is not a Hash" % [hash['discount']] unless hash['discount'].is_a? Hash @discount = OnlinePayments::SDK::Domain::Discount.new_from_hash(hash['discount']) end if hash.has_key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = OnlinePayments::SDK::Domain::OrderReferences.new_from_hash(hash['references']) end if hash.has_key? 'shipping' raise TypeError, "value '%s' is not a Hash" % [hash['shipping']] unless hash['shipping'].is_a? Hash @shipping = OnlinePayments::SDK::Domain::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 = OnlinePayments::SDK::Domain::ShoppingCart.new_from_hash(hash['shoppingCart']) end if hash.has_key? 'surchargeSpecificInput' raise TypeError, "value '%s' is not a Hash" % [hash['surchargeSpecificInput']] unless hash['surchargeSpecificInput'].is_a? Hash @surcharge_specific_input = OnlinePayments::SDK::Domain::SurchargeSpecificInput.new_from_hash(hash['surchargeSpecificInput']) end if hash.has_key? 'taxPercentage' @tax_percentage = hash['taxPercentage'] end if hash.has_key? 'totalTaxAmount' @total_tax_amount = hash['totalTaxAmount'] end end |
#to_h ⇒ Hash
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/onlinepayments/sdk/domain/order.rb', line 50 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['discount'] = @discount.to_h unless @discount.nil? hash['references'] = @references.to_h unless @references.nil? hash['shipping'] = @shipping.to_h unless @shipping.nil? hash['shoppingCart'] = @shopping_cart.to_h unless @shopping_cart.nil? hash['surchargeSpecificInput'] = @surcharge_specific_input.to_h unless @surcharge_specific_input.nil? hash['taxPercentage'] = @tax_percentage unless @tax_percentage.nil? hash['totalTaxAmount'] = @total_tax_amount unless @total_tax_amount.nil? hash end |