sagepay_protocol3 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -0
- data/lib/sagepay_protocol3/version.rb +1 -1
- data/sagepay_protocol3.gemspec +2 -1
- data/spec/plugin/encryption_spec.rb +20 -0
- data/spec/spec_helper.rb +2 -0
- metadata +19 -3
data/README.md
CHANGED
data/sagepay_protocol3.gemspec
CHANGED
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
24
|
spec.add_development_dependency "rake"
|
25
|
-
spec.add_development_dependency "
|
25
|
+
spec.add_development_dependency "rails", "~> 3.2.13"
|
26
|
+
spec.add_development_dependency "rspec-rails"
|
26
27
|
spec.add_development_dependency "pry"
|
27
28
|
spec.add_development_dependency "mocha"
|
28
29
|
#spec.add_development_dependency "guard-rspec"
|
@@ -79,7 +79,27 @@ module SagepayProtocol3
|
|
79
79
|
}
|
80
80
|
)
|
81
81
|
end
|
82
|
+
|
83
|
+
context "given a delimited decrypted payload string" do
|
84
|
+
|
85
|
+
let(:result) do
|
86
|
+
"VendorTxCode=R045302057&VPSTxId={B2BA07A8-13F0-56B2-8A67-C54A691149EA}&Status=OK&StatusDetail=0000 : The Authorisation was Successful.&TxAuthNo=1326452541&AVSCV2=SECURITY CODE MATCH ONLY&AddressResult=NOTMATCHED&PostCodeResult=NOTMATCHED&CV2Result=MATCHED&GiftAid=0&3DSecureStatus=OK&CAVV=AAACAYQDOAAAACgHgwM4AAAAAAA=&CardType=VISA&Last4Digits=8125&DeclineCode=00&Amount=10.24&BankAuthCode=094233\x04\x04\x04\x04"
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should return the data as a Hash" do
|
90
|
+
expect(SagepayProtocol3::Encryption.to_h(result)).to eq(
|
91
|
+
{"VendorTxCode"=>"R045302057", "VPSTxId"=>"{B2BA07A8-13F0-56B2-8A67-C54A691149EA}", "Status"=>"OK", "StatusDetail"=>"0000 : The Authorisation was Successful.", "TxAuthNo"=>"1326452541", "AVSCV2"=>"SECURITY CODE MATCH ONLY", "AddressResult"=>"NOTMATCHED", "PostCodeResult"=>"NOTMATCHED", "CV2Result"=>"MATCHED", "GiftAid"=>"0", "3DSecureStatus"=>"OK", "CAVV"=>"AAACAYQDOAAAACgHgwM4AAAAAAA", "CardType"=>"VISA", "Last4Digits"=>"8125", "DeclineCode"=>"00", "Amount"=>"10.24", "BankAuthCode"=>"094233\x04\x04\x04\x04"}
|
92
|
+
)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
82
96
|
end
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
83
103
|
end
|
84
104
|
|
85
105
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sagepay_protocol3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -44,7 +44,23 @@ dependencies:
|
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
47
|
+
name: rails
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 3.2.13
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 3.2.13
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec-rails
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
49
65
|
none: false
|
50
66
|
requirements:
|
@@ -168,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
184
|
version: '0'
|
169
185
|
segments:
|
170
186
|
- 0
|
171
|
-
hash:
|
187
|
+
hash: -1429361801717589252
|
172
188
|
requirements: []
|
173
189
|
rubyforge_project:
|
174
190
|
rubygems_version: 1.8.23.2
|