Class: OnlinePayments::SDK::Domain::SubMerchant

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#addressOnlinePayments::SDK::Domain::Address?

Returns the current value of address.

Returns:



16
17
18
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 16

def address
  @address
end

#company_identification_numberString?

Returns the current value of company_identification_number.

Returns:

  • (String, nil)

    the current value of company_identification_number



16
17
18
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 16

def company_identification_number
  @company_identification_number
end

#company_nameString?

Returns the current value of company_name.

Returns:

  • (String, nil)

    the current value of company_name



16
17
18
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 16

def company_name
  @company_name
end

#merchant_category_codeString?

Returns the current value of merchant_category_code.

Returns:

  • (String, nil)

    the current value of merchant_category_code



16
17
18
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 16

def merchant_category_code
  @merchant_category_code
end

#merchant_idString?

Returns the current value of merchant_id.

Returns:

  • (String, nil)

    the current value of merchant_id



16
17
18
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 16

def merchant_id
  @merchant_id
end

#websiteString?

Returns the current value of website.

Returns:

  • (String, nil)

    the current value of website



16
17
18
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 16

def website
  @website
end

Instance Method Details

#from_hash(hash) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 42

def from_hash(hash)
  super
  if hash.has_key? 'address'
    raise TypeError, "value '%s' is not a Hash" % [hash['address']] unless hash['address'].is_a? Hash
    @address = OnlinePayments::SDK::Domain::Address.new_from_hash(hash['address'])
  end
  if hash.has_key? 'companyIdentificationNumber'
    @company_identification_number = hash['companyIdentificationNumber']
  end
  if hash.has_key? 'companyName'
    @company_name = hash['companyName']
  end
  if hash.has_key? 'merchantCategoryCode'
    @merchant_category_code = hash['merchantCategoryCode']
  end
  if hash.has_key? 'merchantId'
    @merchant_id = hash['merchantId']
  end
  if hash.has_key? 'website'
    @website = hash['website']
  end
end

#to_hHash

Returns:

  • (Hash)


31
32
33
34
35
36
37
38
39
40
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 31

def to_h
  hash = super
  hash['address'] = @address.to_h unless @address.nil?
  hash['companyIdentificationNumber'] = @company_identification_number unless @company_identification_number.nil?
  hash['companyName'] = @company_name unless @company_name.nil?
  hash['merchantCategoryCode'] = @merchant_category_code unless @merchant_category_code.nil?
  hash['merchantId'] = @merchant_id unless @merchant_id.nil?
  hash['website'] = @website unless @website.nil?
  hash
end