class MaxipagoApi::CustomerModel

Attributes

address1[RW]
address2[RW]
birth_date[RW]
city[RW]
country[RW]
customer_id_ext[RW]
document[RW]
email[RW]
first_name[RW]
id[RW]
last_name[RW]
phone[RW]
response_error[RW]
sex[RW]
state[RW]
zipcode[RW]

Public Class Methods

find(id) click to toggle source
# File lib/maxipago_api/models/customer_model.rb, line 31
def self.find(id)
  MaxipagoApi::CustomerRequest.find(id)
end
new(options = {}) click to toggle source
# File lib/maxipago_api/models/customer_model.rb, line 8
def initialize(options = {})
  self.customer_id_ext = options[:customer_id_ext]
  self.first_name = options[:first_name]
  self.last_name = options[:last_name]
  self.zipcode = options[:zipcode]
  self.email = options[:email]
  self.birth_date = options[:birth_date]
  self.document = options[:document]
  self.sex = options[:sex]
  self.address1 = options[:address1]
  self.address2 = options[:address2]
  self.city = options[:city]
  self.state = options[:state]
  self.zipcode = options[:zipcode]
  self.country = options[:country]
  self.phone = options[:phone]
  self.email = options[:email]
end

Public Instance Methods

save() click to toggle source
# File lib/maxipago_api/models/customer_model.rb, line 27
def save
  MaxipagoApi::CustomerRequest.create(self)
end
to_object() click to toggle source
# File lib/maxipago_api/models/customer_model.rb, line 35
def to_object
  {
    customerIdExt: self.customer_id_ext,
    firstName: self.first_name,
    lastName: self.last_name,
    zip: self.zipcode,
    email: self.email,
    dob: self.sex,
    ssn: self.document,
    sex: self.sex
}.select{|k,v| v.present?}
end