sage_pay 0.2.8.1 → 0.2.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ require 'md5'
7
7
  require 'uuid'
8
8
 
9
9
  module SagePay
10
- VERSION = '0.2.8.1'
10
+ VERSION = '0.2.8.2'
11
11
  end
12
12
 
13
13
  require 'validatable-ext'
@@ -26,4 +26,5 @@ require 'sage_pay/server/notification_response'
26
26
  require 'sage_pay/server/release'
27
27
  require 'sage_pay/server/abort'
28
28
  require 'sage_pay/server/refund'
29
+ require 'sage_pay/server/refund_response'
29
30
  require 'sage_pay/server'
@@ -30,6 +30,10 @@ module SagePay
30
30
  @amount = blank?(value) ? nil : BigDecimal.new(value.to_s)
31
31
  end
32
32
 
33
+ def response_from_response_body(response_body)
34
+ RefundResponse.from_response_body(response_body)
35
+ end
36
+
33
37
  def live_service
34
38
  "refund"
35
39
  end
@@ -0,0 +1,26 @@
1
+ module SagePay
2
+ module Server
3
+ class RefundResponse < Response
4
+ self.key_converter = key_converter.merge({
5
+ "VPSTxId" => :vps_tx_id,
6
+ "TxAuthNo" => :tx_auth_no
7
+ })
8
+
9
+ def vps_tx_id
10
+ if ok?
11
+ @vps_tx_id
12
+ else
13
+ raise RuntimeError, "Unable to retrieve the transaction id as the status was not OK."
14
+ end
15
+ end
16
+
17
+ def tx_auth_no
18
+ if ok?
19
+ @tx_auth_no
20
+ else
21
+ raise RuntimeError, "Unable to retrieve the authorisation number as the status was not OK."
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -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.8.1'
10
+ s.version = '0.2.8.2'
11
11
  s.date = '2010-04-25'
12
12
  s.rubyforge_project = 'sage_pay'
13
13
 
@@ -62,6 +62,7 @@ gateway for accepting credit card payments through your web app.
62
62
  lib/sage_pay/server/notification.rb
63
63
  lib/sage_pay/server/notification_response.rb
64
64
  lib/sage_pay/server/refund.rb
65
+ lib/sage_pay/server/refund_response.rb
65
66
  lib/sage_pay/server/registration.rb
66
67
  lib/sage_pay/server/registration_response.rb
67
68
  lib/sage_pay/server/related_transaction.rb
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 2
8
8
  - 8
9
- - 1
10
- version: 0.2.8.1
9
+ - 2
10
+ version: 0.2.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Graeme Mathieson
@@ -84,6 +84,7 @@ files:
84
84
  - lib/sage_pay/server/notification.rb
85
85
  - lib/sage_pay/server/notification_response.rb
86
86
  - lib/sage_pay/server/refund.rb
87
+ - lib/sage_pay/server/refund_response.rb
87
88
  - lib/sage_pay/server/registration.rb
88
89
  - lib/sage_pay/server/registration_response.rb
89
90
  - lib/sage_pay/server/related_transaction.rb