Class: Ingenico::Connect::SDK::Domain::Payment::AccountFundingRecipient

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#account_numberString



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

def 
  @account_number
end

#account_number_typeString



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

def 
  @account_number_type
end

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



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

def address
  @address
end

#date_of_birthString



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

def date_of_birth
  @date_of_birth
end

#nameIngenico::Connect::SDK::Domain::Payment::AfrName



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

def name
  @name
end

#partial_panString



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

def partial_pan
  @partial_pan
end

Instance Method Details

#from_hash(hash) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/ingenico/connect/sdk/domain/payment/account_funding_recipient.rb', line 46

def from_hash(hash)
  super
  if hash.has_key? 'accountNumber'
    @account_number = hash['accountNumber']
  end
  if hash.has_key? 'accountNumberType'
    @account_number_type = hash['accountNumberType']
  end
  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? 'dateOfBirth'
    @date_of_birth = hash['dateOfBirth']
  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::AfrName.new_from_hash(hash['name'])
  end
  if hash.has_key? 'partialPan'
    @partial_pan = hash['partialPan']
  end
end

#to_hHash



35
36
37
38
39
40
41
42
43
44
# File 'lib/ingenico/connect/sdk/domain/payment/account_funding_recipient.rb', line 35

def to_h
  hash = super
  hash['accountNumber'] = @account_number unless @account_number.nil?
  hash['accountNumberType'] = @account_number_type unless @account_number_type.nil?
  hash['address'] = @address.to_h unless @address.nil?
  hash['dateOfBirth'] = @date_of_birth unless @date_of_birth.nil?
  hash['name'] = @name.to_h unless @name.nil?
  hash['partialPan'] = @partial_pan unless @partial_pan.nil?
  hash
end