Class: PrismPay::CreditCard

Inherits:
Object
  • Object
show all
Defined in:
lib/prismpay/prismpay.rb

Overview

BankAccount

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ccinfo = {}) ⇒ CreditCard

Returns a new instance of CreditCard.



562
563
564
565
566
567
568
569
570
571
# File 'lib/prismpay/prismpay.rb', line 562

def initialize(ccinfo = {})
  if ccinfo.respond_to?("has_key?")
    @number = ccinfo[:number] if ccinfo.has_key?(:number)
    @month = ccinfo[:month] if ccinfo.has_key?(:month)
    @year = ccinfo[:year] if ccinfo.has_key?(:year)
    @name = ccinfo[:name] if ccinfo.has_key?(:name)
    @verification_value = ccinfo[:verification_value] if ccinfo.has_key?(:verification_value)
    @type = ccinfo[:type] if ccinfo.has_key?(:type)
  end
end

Instance Attribute Details

#first_nameObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def first_name
  @first_name
end

#last_nameObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def last_name
  @last_name
end

#monthObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def month
  @month
end

#numberObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def number
  @number
end

#typeObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def type
  @type
end

#verification_valueObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def verification_value
  @verification_value
end

#yearObject

credit card information… mimic ActiveMerchant



541
542
543
# File 'lib/prismpay/prismpay.rb', line 541

def year
  @year
end

Instance Method Details

#[](method) ⇒ Object



544
545
546
# File 'lib/prismpay/prismpay.rb', line 544

def [](method)
  eval ("self.#{method}")
end

#[]=(method, rval) ⇒ Object



558
559
560
# File 'lib/prismpay/prismpay.rb', line 558

def []=(method, rval)
  eval ("self.#{method} = rval")
end

#nameObject



548
549
550
# File 'lib/prismpay/prismpay.rb', line 548

def name
  join(@first_name, @last_name)
end

#name=(n) ⇒ Object



552
553
554
555
556
# File 'lib/prismpay/prismpay.rb', line 552

def name=(n)
  names = n.split(' ')
  @first_name = names[0]
  @last_name = names[1]
end