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.



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

def address
  @address
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#faxObject

Returns the value of attribute fax.



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

def fax
  @fax
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#ipObject

Returns the value of attribute ip.



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

def ip
  @ip
end

#phoneObject

Returns the value of attribute phone.



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

def phone
  @phone
end

Instance Method Details

#to_hashObject



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

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