credit_officer 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{credit_officer}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dan Pickett"]
12
- s.date = %q{2010-12-22}
12
+ s.date = %q{2011-01-06}
13
13
  s.description = %q{An upgrade/port of ActiveMerchant's credit card class}
14
14
  s.email = %q{dpickett@enlightsolutions.com}
15
15
  s.extra_rdoc_files = [
@@ -77,6 +77,8 @@ module CreditOfficer
77
77
  attr_accessor :issue_number
78
78
 
79
79
  alias_method :brand, :provider_name
80
+ alias_method :cvv, :verification_value
81
+ alias_method :cvv=, :verification_value=
80
82
 
81
83
  validates_presence_of :number
82
84
  validates_presence_of :name_on_card
@@ -38,7 +38,7 @@ module CreditOfficer
38
38
 
39
39
  #@return [Boolean] whether the last minute of the month is within the bound of {RECENT_FUTURE_YEAR_LIMIT}
40
40
  def exceeds_recent_future?
41
- end_of_month <= Time.now.utc.advance(:years => RECENT_FUTURE_YEAR_LIMIT)
41
+ end_of_month >= Time.now.utc.advance(:years => RECENT_FUTURE_YEAR_LIMIT)
42
42
  end
43
43
 
44
44
  #@return [Time, nil] the first minute of the month in UTC or nil if an invalid pair was specified
@@ -13,13 +13,13 @@ describe CreditOfficer::CreditCard do
13
13
  should_validate_presence_of :expiration_year
14
14
 
15
15
  it "validates that the expiration year is on or after this year" do
16
- subject.expiration_year = Time.now.year - 1
16
+ subject.expiration_year = Time.now.utc.year - 1
17
17
  subject.should_not be_valid
18
18
  subject.errors[:expiration_year].should_not be_blank
19
19
  end
20
20
 
21
21
  it "validates that the expiration year is within 20 years from now" do
22
- subject.expiration_year = Time.now.utc.year + 20
22
+ subject.expiration_year = Time.now.utc.year + 21
23
23
  subject.should_not be_valid
24
24
  subject.errors[:expiration_year].should_not be_blank
25
25
  end
@@ -1,7 +1,7 @@
1
1
  Factory.define :credit_card, :class => CreditOfficer::CreditCard do |c|
2
2
  c.number "4111111111111111"
3
3
  c.expiration_month 1
4
- c.expiration_year { Time.now.advance(:year => 1) }
4
+ c.expiration_year { Time.now.utc.advance(:year => 1).year }
5
5
  c.name_on_card "John Smith"
6
6
  c.verification_value "1434"
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credit_officer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Pickett
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-22 00:00:00 -05:00
18
+ date: 2011-01-06 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency