Class: Ingenico::Connect::SDK::Domain::Payout::PayoutCustomer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#addressIngenico::Connect::SDK::Domain::Definitions::Address



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payout/payout_customer.rb', line 20

def address
  @address
end

#company_informationIngenico::Connect::SDK::Domain::Definitions::CompanyInformation



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payout/payout_customer.rb', line 20

def company_information
  @company_information
end

#contact_detailsIngenico::Connect::SDK::Domain::Definitions::ContactDetailsBase



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payout/payout_customer.rb', line 20

def contact_details
  @contact_details
end

#merchant_customer_idString



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payout/payout_customer.rb', line 20

def merchant_customer_id
  @merchant_customer_id
end

#nameIngenico::Connect::SDK::Domain::Payment::PersonalName



20
21
22
# File 'lib/ingenico/connect/sdk/domain/payout/payout_customer.rb', line 20

def name
  @name
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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 = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['address'])
  end
  if hash.has_key? 'companyInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['companyInformation']] unless hash['companyInformation'].is_a? Hash
    @company_information = Ingenico::Connect::SDK::Domain::Definitions::CompanyInformation.new_from_hash(hash['companyInformation'])
  end
  if hash.has_key? 'contactDetails'
    raise TypeError, "value '%s' is not a Hash" % [hash['contactDetails']] unless hash['contactDetails'].is_a? Hash
    @contact_details = Ingenico::Connect::SDK::Domain::Definitions::ContactDetailsBase.new_from_hash(hash['contactDetails'])
  end
  if hash.has_key? 'merchantCustomerId'
    @merchant_customer_id = hash['merchantCustomerId']
  end
  if hash.has_key? 'name'
    raise TypeError, "value '%s' is not a Hash" % [hash['name']] unless hash['name'].is_a? Hash
    @name = Ingenico::Connect::SDK::Domain::Payment::PersonalName.new_from_hash(hash['name'])
  end
end

#to_hHash



33
34
35
36
37
38
39
40
41
# File 'lib/ingenico/connect/sdk/domain/payout/payout_customer.rb', line 33

def to_h
  hash = super
  hash['address'] = @address.to_h unless @address.nil?
  hash['companyInformation'] = @company_information.to_h unless @company_information.nil?
  hash['contactDetails'] = @contact_details.to_h unless @contact_details.nil?
  hash['merchantCustomerId'] = @merchant_customer_id unless @merchant_customer_id.nil?
  hash['name'] = @name.to_h unless @name.nil?
  hash
end