Class: OnlinePayments::SDK::Domain::SurchargeRate

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/surcharge_rate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#ad_valorem_rateFloat

Returns the current value of ad_valorem_rate.

Returns:

  • (Float)

    the current value of ad_valorem_rate



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def ad_valorem_rate
  @ad_valorem_rate
end

#specific_rateInteger

Returns the current value of specific_rate.

Returns:

  • (Integer)

    the current value of specific_rate



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def specific_rate
  @specific_rate
end

#surcharge_product_type_idString

Returns the current value of surcharge_product_type_id.

Returns:

  • (String)

    the current value of surcharge_product_type_id



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def surcharge_product_type_id
  @surcharge_product_type_id
end

#surcharge_product_type_versionString

Returns the current value of surcharge_product_type_version.

Returns:

  • (String)

    the current value of surcharge_product_type_version



13
14
15
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 13

def surcharge_product_type_version
  @surcharge_product_type_version
end

Instance Method Details

#from_hash(hash) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 29

def from_hash(hash)
  super
  @ad_valorem_rate = hash['adValoremRate'] if hash.key? 'adValoremRate'
  @specific_rate = hash['specificRate'] if hash.key? 'specificRate'
  @surcharge_product_type_id = hash['surchargeProductTypeId'] if hash.key? 'surchargeProductTypeId'
  @surcharge_product_type_version = hash['surchargeProductTypeVersion'] if hash.key? 'surchargeProductTypeVersion'
end

#to_hHash

Returns:

  • (Hash)


20
21
22
23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/surcharge_rate.rb', line 20

def to_h
  hash = super
  hash['adValoremRate'] = @ad_valorem_rate unless @ad_valorem_rate.nil?
  hash['specificRate'] = @specific_rate unless @specific_rate.nil?
  hash['surchargeProductTypeId'] = @surcharge_product_type_id unless @surcharge_product_type_id.nil?
  hash['surchargeProductTypeVersion'] = @surcharge_product_type_version unless @surcharge_product_type_version.nil?
  hash
end