Class: Worldline::Connect::SDK::V1::Domain::CustomerBase

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

Direct Known Subclasses

Customer, CustomerToken

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#company_informationWorldline::Connect::SDK::V1::Domain::CompanyInformation

Returns the current value of company_information.

Returns:



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

def company_information
  @company_information
end

#merchant_customer_idString

Returns the current value of merchant_customer_id.

Returns:

  • (String)

    the current value of merchant_customer_id



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

def merchant_customer_id
  @merchant_customer_id
end

#vat_numberObject

Deprecated.

Use companyInformation.vatNumber instead



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

def vat_number
  @vat_number
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.has_key? 'companyInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['companyInformation']] unless hash['companyInformation'].is_a? Hash
    @company_information = Worldline::Connect::SDK::V1::Domain::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_hHash

Returns:

  • (Hash)


26
27
28
29
30
31
32
# File 'lib/worldline/connect/sdk/v1/domain/customer_base.rb', line 26

def to_h
  hash = super
  hash['companyInformation'] = @company_information.to_h unless @company_information.nil?
  hash['merchantCustomerId'] = @merchant_customer_id unless @merchant_customer_id.nil?
  hash['vatNumber'] = @vat_number unless @vat_number.nil?
  hash
end