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 +4 -4
- data/lib/tres_delta/credit_card.rb +4 -0
- data/lib/tres_delta/gateway.rb +1 -1
- data/lib/tres_delta/version.rb +1 -1
- data/spec/tres_delta/credit_card_spec.rb +25 -0
- data/spec/tres_delta/gateway_spec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a8cba69bcd03c493bd51a55e71f1b1f95e609cd
|
4
|
+
data.tar.gz: f3c2080d9dd0c5ed27688da4d23a0c0cdbad25d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dee1eda2289c8454d0bb799f437ef39addee7ce414bf7ebf4d830dad4b95e062e392fba13524f76a5029042f511c378681538e328b43a61b97130155e9265e5
|
7
|
+
data.tar.gz: ddab2cbe28dc3189f55a0e8a29be244d41b6214e949b2cbb02f97847f7a1ccf5e61f9e76a81732e9c3f79e83bb0ab79d962a48532b40f036428d4495ad4f81f5
|
data/lib/tres_delta/gateway.rb
CHANGED
@@ -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.
|
56
|
+
'CardSecurityCodeIndicator' => credit_card.has_security_code? ? 'Provided' : 'None'
|
57
57
|
}
|
58
58
|
end
|
59
59
|
|
data/lib/tres_delta/version.rb
CHANGED
@@ -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
|