Class: Ingenico::Connect::SDK::Domain::Definitions::CustomerBase

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/definitions/customer_base.rb

Direct Known Subclasses

Payment::Customer, Token::CustomerToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#company_informationObject



15
16
17
# File 'lib/ingenico/connect/sdk/domain/definitions/customer_base.rb', line 15

def company_information
  @company_information
end

#merchant_customer_idObject

String



18
19
20
# File 'lib/ingenico/connect/sdk/domain/definitions/customer_base.rb', line 18

def merchant_customer_id
  @merchant_customer_id
end

#vat_numberObject

String



21
22
23
# File 'lib/ingenico/connect/sdk/domain/definitions/customer_base.rb', line 21

def vat_number
  @vat_number
end

Instance Method Details

#from_hash(hash) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ingenico/connect/sdk/domain/definitions/customer_base.rb', line 31

def from_hash(hash)
  super
  if hash.has_key?('companyInformation')
    if !(hash['companyInformation'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['companyInformation']]
    end
    @company_information = Ingenico::Connect::SDK::Domain::Definitions::CompanyInformation.new_from_hash(hash['companyInformation'])
  end
  if hash.has_key?('merchantCustomerId')
    @merchant_customer_id = hash['merchantCustomerId']
  end
  if hash.has_key?('vatNumber')
    @vat_number = hash['vatNumber']
  end
end

#to_hObject



23
24
25
26
27
28
29
# File 'lib/ingenico/connect/sdk/domain/definitions/customer_base.rb', line 23

def to_h
  hash = super
  add_to_hash(hash, 'companyInformation', @company_information)
  add_to_hash(hash, 'merchantCustomerId', @merchant_customer_id)
  add_to_hash(hash, 'vatNumber', @vat_number)
  hash
end