sage_pay 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.4
4
+
5
+ * Generate the appropriate response.
6
+
3
7
  ## 0.2.3
4
8
 
5
9
  * yield for the signature verification details if there's a block given in the
@@ -177,6 +177,14 @@ module SagePay
177
177
  def valid_signature?
178
178
  @calculated_hash == vps_signature
179
179
  end
180
+
181
+ def response(redirect_url)
182
+ if valid_signature?
183
+ SagePay::Server::TransactionNotificationResponse.new(:status => :ok, :redirect_url => redirect_url)
184
+ else
185
+ SagePay::Server::TransactionNotificationResponse.new(:status => :invalid, :redirect_url => redirect_url, :status_detail => "Signature did not match our expectations")
186
+ end.response
187
+ end
180
188
  end
181
189
  end
182
190
  end
data/lib/sage_pay.rb CHANGED
@@ -6,7 +6,7 @@ require 'md5'
6
6
  require 'uuid'
7
7
 
8
8
  module SagePay
9
- VERSION = '0.2.3'
9
+ VERSION = '0.2.4'
10
10
  end
11
11
 
12
12
  require 'validatable-ext'
data/sage_pay.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  ## If your rubyforge_project name is different, then edit it and comment out
8
8
  ## the sub! line in the Rakefile
9
9
  s.name = 'sage_pay'
10
- s.version = '0.2.3'
10
+ s.version = '0.2.4'
11
11
  s.date = '2010-04-25'
12
12
  s.rubyforge_project = 'sage_pay'
13
13
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe SagePay do
4
- it "should be version 0.2.3" do
5
- SagePay::VERSION.should == '0.2.3'
4
+ it "should be version 0.2.4" do
5
+ SagePay::VERSION.should == '0.2.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 3
9
- version: 0.2.3
8
+ - 4
9
+ version: 0.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Graeme Mathieson