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:



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

def address
  @address
end

#company_identification_numberString

Returns the current value of company_identification_number.

Returns:

  • (String)

    the current value of company_identification_number



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

def company_identification_number
  @company_identification_number
end

#company_nameString

Returns the current value of company_name.

Returns:

  • (String)

    the current value of company_name



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

def company_name
  @company_name
end

#merchant_category_codeString

Returns the current value of merchant_category_code.

Returns:

  • (String)

    the current value of merchant_category_code



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

def merchant_category_code
  @merchant_category_code
end

#merchant_idString

Returns the current value of merchant_id.

Returns:

  • (String)

    the current value of merchant_id



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

def merchant_id
  @merchant_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/onlinepayments/sdk/domain/sub_merchant.rb', line 38

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
end

#to_hHash

Returns:

  • (Hash)


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

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
end