Class: OnlinePayments::SDK::Domain::ShippingDetail

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/shipping_detail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#shipping_costInteger

Returns the current value of shipping_cost.

Returns:

  • (Integer)

    the current value of shipping_cost



11
12
13
# File 'lib/onlinepayments/sdk/domain/shipping_detail.rb', line 11

def shipping_cost
  @shipping_cost
end

#shipping_cost_taxInteger

Returns the current value of shipping_cost_tax.

Returns:

  • (Integer)

    the current value of shipping_cost_tax



11
12
13
# File 'lib/onlinepayments/sdk/domain/shipping_detail.rb', line 11

def shipping_cost_tax
  @shipping_cost_tax
end

Instance Method Details

#from_hash(hash) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/shipping_detail.rb', line 25

def from_hash(hash)
  super
  if hash.has_key? 'shippingCost'
    @shipping_cost = hash['shippingCost']
  end
  if hash.has_key? 'shippingCostTax'
    @shipping_cost_tax = hash['shippingCostTax']
  end
end

#to_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
# File 'lib/onlinepayments/sdk/domain/shipping_detail.rb', line 18

def to_h
  hash = super
  hash['shippingCost'] = @shipping_cost unless @shipping_cost.nil?
  hash['shippingCostTax'] = @shipping_cost_tax unless @shipping_cost_tax.nil?
  hash
end