Class: Worldline::Connect::SDK::V1::Domain::Level3SummaryData Deprecated

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/level3_summary_data.rb

Overview

Deprecated.

Use ShoppingCart.amountBreakdown instead

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#discount_amountObject

Deprecated.

Use ShoppingCart.amountBreakdown with type DISCOUNT instead



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/level3_summary_data.rb', line 16

def discount_amount
  @discount_amount
end

#duty_amountObject

Deprecated.

Use ShoppingCart.amountBreakdown with type DUTY instead



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/level3_summary_data.rb', line 16

def duty_amount
  @duty_amount
end

#shipping_amountObject

Deprecated.

Use ShoppingCart.amountBreakdown with type SHIPPING instead



16
17
18
# File 'lib/worldline/connect/sdk/v1/domain/level3_summary_data.rb', line 16

def shipping_amount
  @shipping_amount
end

Instance Method Details

#from_hash(hash) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/worldline/connect/sdk/v1/domain/level3_summary_data.rb', line 36

def from_hash(hash)
  super
  if hash.has_key? 'discountAmount'
    @discount_amount = hash['discountAmount']
  end
  if hash.has_key? 'dutyAmount'
    @duty_amount = hash['dutyAmount']
  end
  if hash.has_key? 'shippingAmount'
    @shipping_amount = hash['shippingAmount']
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
# File 'lib/worldline/connect/sdk/v1/domain/level3_summary_data.rb', line 28

def to_h
  hash = super
  hash['discountAmount'] = @discount_amount unless @discount_amount.nil?
  hash['dutyAmount'] = @duty_amount unless @duty_amount.nil?
  hash['shippingAmount'] = @shipping_amount unless @shipping_amount.nil?
  hash
end