Class: AuthorizeNet::Customer

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/authorize_net/customer.rb

Overview

Models a customer.

Direct Known Subclasses

AuthorizeNet::CIM::CustomerProfile

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#initialize, #to_a

Instance Attribute Details

#addressObject

Returns the value of attribute address.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def address
  @address
end

#descriptionObject

Returns the value of attribute description.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def description
  @description
end

#emailObject

Returns the value of attribute email.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def email
  @email
end

#faxObject

Returns the value of attribute fax.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def fax
  @fax
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def id
  @id
end

#ipObject

Returns the value of attribute ip.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def ip
  @ip
end

#phoneObject

Returns the value of attribute phone.



8
9
10
# File 'lib/authorize_net/customer.rb', line 8

def phone
  @phone
end

Instance Method Details

#to_hashObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/authorize_net/customer.rb', line 10

def to_hash
  hash = {
    :phone => @phone,
    :fax => @fax,
    :email => @email,
    :cust_id => @id,
    :customer_ip => @ip,
    :description => @description,
    :customer_profile_id => @customer_profile_id
  }
  hash.delete_if {|k, v| v.nil?}
  hash.merge!(@address.to_hash) unless @address.nil?
  hash
end