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 CHANGED
@@ -8,6 +8,7 @@ Encryption in Ruby to interface with SagePay's payment gateway protocol v3.
8
8
 
9
9
  * Supports multiple Ruby versions: Ruby 1.9.3, 2.0.0, 2.1.3 (see
10
10
  Travis build status).
11
+ * Rails 3.2.13 is a dependency.
11
12
 
12
13
  ## Installation
13
14
 
@@ -1,3 +1,3 @@
1
1
  module SagepayProtocol3
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -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 "rspec"
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
@@ -1,5 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'sagepay_protocol3'
3
+ require 'rails/all'
4
+ require 'rspec/rails'
3
5
  require 'mocha/api'
4
6
  require 'pry'
5
7
 
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
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: rspec
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: 53668763055406161
187
+ hash: -1429361801717589252
172
188
  requirements: []
173
189
  rubyforge_project:
174
190
  rubygems_version: 1.8.23.2