sage_pay 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +13 -0
- data/lib/sage_pay.rb +2 -1
- data/lib/sage_pay/uri_fixups.rb +42 -0
- data/sage_pay.gemspec +4 -2
- metadata +5 -3
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
# 0.2.1
|
4
|
+
|
5
|
+
* [FIX] SagePay think it's OK to have curly braces in a URL query string.
|
6
|
+
Ruby's URI library thinks otherwise. No matter who's right, one of these is
|
7
|
+
easier to change than the other.
|
8
|
+
|
9
|
+
# 0.2.0
|
10
|
+
|
11
|
+
* Initial release. This should support the full workflow for making payments,
|
12
|
+
but the notification side hasn't been tested again SagePay in the wild so
|
13
|
+
you mileage probably will vary.
|
data/lib/sage_pay.rb
CHANGED
@@ -6,11 +6,12 @@ require 'md5'
|
|
6
6
|
require 'uuid'
|
7
7
|
|
8
8
|
module SagePay
|
9
|
-
VERSION = '0.2.
|
9
|
+
VERSION = '0.2.1'
|
10
10
|
end
|
11
11
|
|
12
12
|
require 'validatable-ext'
|
13
13
|
|
14
|
+
require 'sage_pay/uri_fixups'
|
14
15
|
require 'sage_pay/server/address'
|
15
16
|
require 'sage_pay/server/transaction_code'
|
16
17
|
require 'sage_pay/server/signature_verification_details'
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module URI
|
2
|
+
module REGEXP
|
3
|
+
module PATTERN
|
4
|
+
|
5
|
+
# FIXME: SagePay insists that curly brackets in URLs is OK, so we have
|
6
|
+
# to convince the URI parser that's the case. First we have to update
|
7
|
+
# the constant in question.
|
8
|
+
remove_const :UNRESERVED
|
9
|
+
UNRESERVED = "-_.!~*'()#{ALNUM}\{\}"
|
10
|
+
|
11
|
+
# FIXME: Then we have to update all the dependent constants we care
|
12
|
+
# about.
|
13
|
+
remove_const :URIC
|
14
|
+
remove_const :QUERY
|
15
|
+
remove_const :X_ABS_URI
|
16
|
+
URIC = "(?:[#{UNRESERVED}#{RESERVED}]|#{ESCAPED})"
|
17
|
+
QUERY = "#{URIC}*"
|
18
|
+
X_ABS_URI = "
|
19
|
+
(#{PATTERN::SCHEME}): (?# 1: scheme)
|
20
|
+
(?:
|
21
|
+
(#{PATTERN::OPAQUE_PART}) (?# 2: opaque)
|
22
|
+
|
|
23
|
+
(?:(?:
|
24
|
+
//(?:
|
25
|
+
(?:(?:(#{PATTERN::USERINFO})@)? (?# 3: userinfo)
|
26
|
+
(?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 4: host, 5: port)
|
27
|
+
|
|
28
|
+
(#{PATTERN::REG_NAME}) (?# 6: registry)
|
29
|
+
)
|
30
|
+
|
|
31
|
+
(?!//)) (?# XXX: '//' is the mark for hostport)
|
32
|
+
(#{PATTERN::ABS_PATH})? (?# 7: path)
|
33
|
+
)(?:\\?(#{PATTERN::QUERY}))? (?# 8: query)
|
34
|
+
)
|
35
|
+
(?:\\#(#{PATTERN::FRAGMENT}))? (?# 9: fragment)
|
36
|
+
"
|
37
|
+
end
|
38
|
+
remove_const :ABS_URI
|
39
|
+
ABS_URI = Regexp.new('^' + PATTERN::X_ABS_URI + '$', #'
|
40
|
+
Regexp::EXTENDED, 'N').freeze
|
41
|
+
end
|
42
|
+
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.1'
|
11
|
+
s.date = '2010-04-14'
|
12
12
|
s.rubyforge_project = 'sage_pay'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
@@ -49,6 +49,7 @@ gateway for accepting credit card payments through your web app.
|
|
49
49
|
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
50
50
|
# = MANIFEST =
|
51
51
|
s.files = %w[
|
52
|
+
CHANGELOG.md
|
52
53
|
LICENSE
|
53
54
|
README.md
|
54
55
|
Rakefile
|
@@ -61,6 +62,7 @@ gateway for accepting credit card payments through your web app.
|
|
61
62
|
lib/sage_pay/server/transaction_notification_response.rb
|
62
63
|
lib/sage_pay/server/transaction_registration.rb
|
63
64
|
lib/sage_pay/server/transaction_registration_response.rb
|
65
|
+
lib/sage_pay/uri_fixups.rb
|
64
66
|
lib/validatable-ext.rb
|
65
67
|
lib/validations/validates_inclusion_of.rb
|
66
68
|
sage_pay.gemspec
|
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
|
+
- 1
|
9
|
+
version: 0.2.1
|
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-14 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -70,6 +70,7 @@ extra_rdoc_files:
|
|
70
70
|
- README.md
|
71
71
|
- LICENSE
|
72
72
|
files:
|
73
|
+
- CHANGELOG.md
|
73
74
|
- LICENSE
|
74
75
|
- README.md
|
75
76
|
- Rakefile
|
@@ -82,6 +83,7 @@ files:
|
|
82
83
|
- lib/sage_pay/server/transaction_notification_response.rb
|
83
84
|
- lib/sage_pay/server/transaction_registration.rb
|
84
85
|
- lib/sage_pay/server/transaction_registration_response.rb
|
86
|
+
- lib/sage_pay/uri_fixups.rb
|
85
87
|
- lib/validatable-ext.rb
|
86
88
|
- lib/validations/validates_inclusion_of.rb
|
87
89
|
- sage_pay.gemspec
|