Class: Upay::People::Payer

Inherits:
Person
  • Object
show all
Defined in:
lib/upay/people/payer.rb

Instance Method Summary collapse

Methods inherited from Person

#contactPhone, #contactPhone=, #emailAddress, #emailAddress=, #fullName, #fullName=, #initialize

Constructor Details

This class inherits a constructor from Upay::People::Person

Instance Method Details

#billingAddressObject



11
# File 'lib/upay/people/payer.rb', line 11

def billingAddress; @billingAddress end

#billingAddress=(billingAddress = nil) ⇒ Object



12
# File 'lib/upay/people/payer.rb', line 12

def billingAddress=(billingAddress = nil) @billingAddress = billingAddress; end

#idObject



5
# File 'lib/upay/people/payer.rb', line 5

def id; @id end

#id=(id = nil) ⇒ Object



6
# File 'lib/upay/people/payer.rb', line 6

def id=(id = nil) @id = id; end

#merchantPayerIdObject



8
# File 'lib/upay/people/payer.rb', line 8

def merchantPayerId; @merchantPayerId || @id end

#merchantPayerId=(merchantPayerId = nil) ⇒ Object



9
# File 'lib/upay/people/payer.rb', line 9

def merchantPayerId=(merchantPayerId = nil) @merchantPayerId = merchantPayerId; end

#to_hashObject



19
20
21
22
23
# File 'lib/upay/people/payer.rb', line 19

def to_hash
  person_hash = self.instance_variables.each_with_object({}) { |var,hash| hash[var.to_s.delete("@").to_sym] = self.instance_variable_get(var)}
  person_hash[:billingAddress] = self.billingAddress.to_hash if self.billingAddress
  person_hash
end

#valid?Boolean

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/upay/people/payer.rb', line 14

def valid?
  validator = PayerValidator.new
  validator.valid?(self)
end