sage_pay 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/Rakefile +1 -1
- data/lib/sage_pay.rb +2 -1
- data/lib/sage_pay/server.rb +7 -0
- data/lib/sage_pay/server/cancel.rb +29 -0
- data/sage_pay.gemspec +3 -2
- data/spec/sage_pay_spec.rb +2 -2
- metadata +4 -3
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/lib/sage_pay.rb
CHANGED
@@ -7,7 +7,7 @@ require 'md5'
|
|
7
7
|
require 'uuid'
|
8
8
|
|
9
9
|
module SagePay
|
10
|
-
VERSION = '0.2.
|
10
|
+
VERSION = '0.2.11'
|
11
11
|
end
|
12
12
|
|
13
13
|
require 'validatable-ext'
|
@@ -30,4 +30,5 @@ require 'sage_pay/server/refund_response'
|
|
30
30
|
require 'sage_pay/server/repeat'
|
31
31
|
require 'sage_pay/server/repeat_response'
|
32
32
|
require 'sage_pay/server/authorise'
|
33
|
+
require 'sage_pay/server/cancel'
|
33
34
|
require 'sage_pay/server'
|
data/lib/sage_pay/server.rb
CHANGED
@@ -76,6 +76,13 @@ module SagePay
|
|
76
76
|
SagePay::Server::Authorise.new(defaults.merge(attributes))
|
77
77
|
end
|
78
78
|
|
79
|
+
def self.cancel(attributes = {})
|
80
|
+
defaults = {
|
81
|
+
}.merge(default_options)
|
82
|
+
|
83
|
+
SagePay::Server::Cancel.new(defaults.merge(attributes))
|
84
|
+
end
|
85
|
+
|
79
86
|
def self.repeat(attributes = {})
|
80
87
|
defaults = {
|
81
88
|
:vendor_tx_code => TransactionCode.random,
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module SagePay
|
2
|
+
module Server
|
3
|
+
class Cancel < Command
|
4
|
+
self.tx_type = :cancel
|
5
|
+
|
6
|
+
attr_accessor :vps_tx_id, :security_key
|
7
|
+
|
8
|
+
validates_presence_of :vps_tx_id, :security_key
|
9
|
+
|
10
|
+
validates_length_of :vps_tx_id, :is => 38
|
11
|
+
validates_length_of :security_key, :is => 10
|
12
|
+
|
13
|
+
def post_params
|
14
|
+
super.merge({
|
15
|
+
"VPSTxId" => vps_tx_id,
|
16
|
+
"SecurityKey" => security_key
|
17
|
+
})
|
18
|
+
end
|
19
|
+
|
20
|
+
def live_service
|
21
|
+
"cancel"
|
22
|
+
end
|
23
|
+
|
24
|
+
def simulator_service
|
25
|
+
"VendorCancelTx"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/sage_pay.gemspec
CHANGED
@@ -7,8 +7,8 @@ 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.
|
11
|
-
s.date = '2010-04-
|
10
|
+
s.version = '0.2.11'
|
11
|
+
s.date = '2010-04-28'
|
12
12
|
s.rubyforge_project = 'sage_pay'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
@@ -59,6 +59,7 @@ gateway for accepting credit card payments through your web app.
|
|
59
59
|
lib/sage_pay/server/abort.rb
|
60
60
|
lib/sage_pay/server/address.rb
|
61
61
|
lib/sage_pay/server/authorise.rb
|
62
|
+
lib/sage_pay/server/cancel.rb
|
62
63
|
lib/sage_pay/server/command.rb
|
63
64
|
lib/sage_pay/server/notification.rb
|
64
65
|
lib/sage_pay/server/notification_response.rb
|
data/spec/sage_pay_spec.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 11
|
9
|
+
version: 0.2.11
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Graeme Mathieson
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-28 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/sage_pay/server/abort.rb
|
81
81
|
- lib/sage_pay/server/address.rb
|
82
82
|
- lib/sage_pay/server/authorise.rb
|
83
|
+
- lib/sage_pay/server/cancel.rb
|
83
84
|
- lib/sage_pay/server/command.rb
|
84
85
|
- lib/sage_pay/server/notification.rb
|
85
86
|
- lib/sage_pay/server/notification_response.rb
|