tres_delta 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c26e3ee095b7862bc852e53230559f3791b900d
4
- data.tar.gz: 65df9b9ad5b9a8422d92ad7a7f18d8ff63e56bca
3
+ metadata.gz: 9a8cba69bcd03c493bd51a55e71f1b1f95e609cd
4
+ data.tar.gz: f3c2080d9dd0c5ed27688da4d23a0c0cdbad25d5
5
5
  SHA512:
6
- metadata.gz: f054f0522ea8fc7b7c79ba7f65d46f6913e0cbba42e790c94abf0a8e9a032df884f08b1191c3de2d725f23a01d7d140ff52fdcbb893fa560b232dcc4b402f0c9
7
- data.tar.gz: c439e65b3fa0e6ae07f957e0085287427a27b88cb9fa39b232533292969308ae81bd17ad62f533bf9fd4ad722ff5c1d36aec8bea790c033e1b8562b985fd60fe
6
+ metadata.gz: 1dee1eda2289c8454d0bb799f437ef39addee7ce414bf7ebf4d830dad4b95e062e392fba13524f76a5029042f511c378681538e328b43a61b97130155e9265e5
7
+ data.tar.gz: ddab2cbe28dc3189f55a0e8a29be244d41b6214e949b2cbb02f97847f7a1ccf5e61f9e76a81732e9c3f79e83bb0ab79d962a48532b40f036428d4495ad4f81f5
@@ -25,6 +25,10 @@ module TresDelta
25
25
  end
26
26
  end
27
27
 
28
+ def has_security_code?
29
+ security_code.to_s.strip.size > 0
30
+ end
31
+
28
32
  class << self
29
33
  def create(customer, params = {})
30
34
  CreditCard.new(params).tap do |credit_card|
@@ -53,7 +53,7 @@ module TresDelta
53
53
  'cc:ExpirationYear' => credit_card.expiration_year,
54
54
  'NameOnCard' => credit_card.name,
55
55
  'CardSecurityCode' => credit_card.security_code,
56
- 'CardSecurityCodeIndicator' => credit_card.security_code.nil? ? 'None' : 'Provided'
56
+ 'CardSecurityCodeIndicator' => credit_card.has_security_code? ? 'Provided' : 'None'
57
57
  }
58
58
  end
59
59
 
@@ -1,3 +1,3 @@
1
1
  module TresDelta
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -112,4 +112,29 @@ describe TresDelta::CreditCard do
112
112
  end
113
113
  end
114
114
  end
115
+
116
+ describe ".has_security_code" do
117
+ let(:credit_card) { TresDelta::CreditCard.new(security_code: security_code) }
118
+ subject { credit_card.has_security_code? }
119
+
120
+ context "code is nil" do
121
+ let(:security_code) { nil }
122
+ it { should be_false }
123
+ end
124
+
125
+ context "code is empty string" do
126
+ let(:security_code) { "" }
127
+ it { should be_false }
128
+ end
129
+
130
+ context "code is blank string" do
131
+ let(:security_code) { " " }
132
+ it { should be_false }
133
+ end
134
+
135
+ context "code is set" do
136
+ let(:security_code) { "123" }
137
+ it { should be_true }
138
+ end
139
+ end
115
140
  end
@@ -54,6 +54,15 @@ describe TresDelta::Gateway do
54
54
  it { should eq('None') }
55
55
  end
56
56
 
57
+ context "security code is empty string" do
58
+ let(:security_code) { "" }
59
+
60
+ it { should eq('None') }
61
+ it "should respond true", :wip => true do
62
+ expect(response.success?).to be_true
63
+ end
64
+ end
65
+
57
66
  context "security code provided" do
58
67
  context "invalid security code" do
59
68
  let(:security_code) { 123 } # fails in development mode
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tres_delta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 1000Bulbs