Class: OnlinePayments::SDK::Domain::MandateCustomer

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/mandate_customer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::SDK::DataObject

new_from_hash

Instance Attribute Details

#bank_account_ibanOnlinePayments::SDK::Domain::BankAccountIban

Returns the current value of bank_account_iban.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/mandate_customer.rb', line 18

def 
  @bank_account_iban
end

#company_nameString

Returns the current value of company_name.

Returns:

  • (String)

    the current value of company_name



18
19
20
# File 'lib/onlinepayments/sdk/domain/mandate_customer.rb', line 18

def company_name
  @company_name
end

#contact_detailsOnlinePayments::SDK::Domain::MandateContactDetails

Returns the current value of contact_details.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/mandate_customer.rb', line 18

def contact_details
  @contact_details
end

#mandate_addressOnlinePayments::SDK::Domain::MandateAddress

Returns the current value of mandate_address.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/mandate_customer.rb', line 18

def mandate_address
  @mandate_address
end

#personal_informationOnlinePayments::SDK::Domain::MandatePersonalInformation

Returns the current value of personal_information.

Returns:



18
19
20
# File 'lib/onlinepayments/sdk/domain/mandate_customer.rb', line 18

def personal_information
  @personal_information
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

def from_hash(hash)
  super
  if hash.key? 'bankAccountIban'
    raise TypeError, "value '%s' is not a Hash" % [hash['bankAccountIban']] unless hash['bankAccountIban'].is_a? Hash
    @bank_account_iban = OnlinePayments::SDK::Domain::BankAccountIban.new_from_hash(hash['bankAccountIban'])
  end
  @company_name = hash['companyName'] if hash.key? 'companyName'
  if hash.key? 'contactDetails'
    raise TypeError, "value '%s' is not a Hash" % [hash['contactDetails']] unless hash['contactDetails'].is_a? Hash
    @contact_details = OnlinePayments::SDK::Domain::MandateContactDetails.new_from_hash(hash['contactDetails'])
  end
  if hash.key? 'mandateAddress'
    raise TypeError, "value '%s' is not a Hash" % [hash['mandateAddress']] unless hash['mandateAddress'].is_a? Hash
    @mandate_address = OnlinePayments::SDK::Domain::MandateAddress.new_from_hash(hash['mandateAddress'])
  end
  if hash.key? 'personalInformation'
    raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash
    @personal_information = OnlinePayments::SDK::Domain::MandatePersonalInformation.new_from_hash(hash['personalInformation'])
  end
end

#to_hHash

Returns:

  • (Hash)


26
27
28
29
30
31
32
33
34
# File 'lib/onlinepayments/sdk/domain/mandate_customer.rb', line 26

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