Class: Braspag::CreditCard

Inherits:
Object
  • Object
show all
Includes:
ActiveAttr::Model
Defined in:
lib/cbraspag/payment/credit_card.rb

Defined Under Namespace

Classes: ExpiratorValidator

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#aliasObject

Returns the value of attribute alias.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def alias
  @alias
end

#holder_nameObject

Returns the value of attribute holder_name.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def holder_name
  @holder_name
end

#idObject

Returns the value of attribute id.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def id
  @id
end

#monthObject

Returns the value of attribute month.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def month
  @month
end

#numberObject

Returns the value of attribute number.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def number
  @number
end

#verification_valueObject

Returns the value of attribute verification_value.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def verification_value
  @verification_value
end

#yearObject

Returns the value of attribute year.



148
149
150
# File 'lib/cbraspag/payment/credit_card.rb', line 148

def year
  @year
end

Instance Method Details

#convert_to(method) ⇒ Object



185
186
187
# File 'lib/cbraspag/payment/credit_card.rb', line 185

def convert_to(method)
  self.send("to_#{method}")
end

#populate!(method, response) ⇒ Object



199
200
201
# File 'lib/cbraspag/payment/credit_card.rb', line 199

def populate!(method, response)
  
end

#to_authorizeObject



189
190
191
192
193
194
195
196
197
# File 'lib/cbraspag/payment/credit_card.rb', line 189

def to_authorize
  year_normalize = year.to_s[-2, 2]
  {
    :holder          => self.holder_name.to_s,
    :card_number     => self.number.to_s,
    :expiration      => "#{self.month}/#{year_normalize}",
    :security_code   => self.verification_value.to_s,
  }
end