Class: Ingenico::Connect::SDK::Domain::Mandates::MandateCustomer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#bank_account_ibanIngenico::Connect::SDK::Domain::Definitions::BankAccountIban

Returns the current value of bank_account_iban.

Returns:



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

def 
  
end

#company_nameString

Returns the current value of company_name.

Returns:

  • (String)

    the current value of company_name



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

def company_name
  @company_name
end

#contact_detailsIngenico::Connect::SDK::Domain::Mandates::MandateContactDetails

Returns the current value of contact_details.

Returns:



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

def contact_details
  @contact_details
end

#mandate_addressIngenico::Connect::SDK::Domain::Mandates::MandateAddress

Returns the current value of mandate_address.

Returns:



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

def mandate_address
  @mandate_address
end

#personal_informationIngenico::Connect::SDK::Domain::Mandates::MandatePersonalInformation

Returns the current value of personal_information.

Returns:



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

def personal_information
  @personal_information
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/mandates/mandate_customer.rb', line 43

def from_hash(hash)
  super
  if hash.has_key? 'bankAccountIban'
    raise TypeError, "value '%s' is not a Hash" % [hash['bankAccountIban']] unless hash['bankAccountIban'].is_a? Hash
     = Ingenico::Connect::SDK::Domain::Definitions::BankAccountIban.new_from_hash(hash['bankAccountIban'])
  end
  if hash.has_key? 'companyName'
    @company_name = hash['companyName']
  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::Mandates::MandateContactDetails.new_from_hash(hash['contactDetails'])
  end
  if hash.has_key? 'mandateAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['mandateAddress']] unless hash['mandateAddress'].is_a? Hash
    @mandate_address = Ingenico::Connect::SDK::Domain::Mandates::MandateAddress.new_from_hash(hash['mandateAddress'])
  end
  if hash.has_key? 'personalInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash
    @personal_information = Ingenico::Connect::SDK::Domain::Mandates::MandatePersonalInformation.new_from_hash(hash['personalInformation'])
  end
end

#to_hHash

Returns:

  • (Hash)


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

def to_h
  hash = super
  hash['bankAccountIban'] = .to_h unless .nil?
  hash['companyName'] = @company_name unless @company_name.nil?
  hash['contactDetails'] = @contact_details.to_h unless @contact_details.nil?
  hash['mandateAddress'] = @mandate_address.to_h unless @mandate_address.nil?
  hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil?
  hash
end