minfraud-ruby 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/minfraud/minfraud.rb +1 -1
- data/lib/minfraud/request.rb +6 -1
- data/lib/minfraud/version.rb +1 -1
- data/spec/minfraud/request_spec.rb +6 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fc780f5307862be2c0515ec053d763068e6fc12
|
4
|
+
data.tar.gz: f58d1c34eb9cde0786a4f9ace065418cfa2b3040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ceeb29d98e0890b30004a9fda94630d21edf66cce30d8fdf1a39b1a67cd525061bda87fe069133a4c83df12af5705e3e3202422581d2404ad7cfea2421218c3
|
7
|
+
data.tar.gz: a7c3ff3cf18e50b5065e28f88267847228fa54690e84e67e1495534ee634c5dec7d246c368e9de5ff7d9999e1698186b18ff5d45a157dd8e6a36e53974fd817a
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.1.1 (2014-04-25)
|
4
|
+
|
5
|
+
- Change Minfraud::ResponseError to inherit from StandardError rather than ArgumentError (8952b46)
|
6
|
+
- Require SSL with get request (a230f6e)
|
7
|
+
- Update readme to reflect changes to exception inheritance (d315902)
|
8
|
+
- Add changelog (e67805a)
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ class ConfigurationError < ArgumentError; end
|
|
52
52
|
class TransactionError < ArgumentError; end
|
53
53
|
|
54
54
|
# Raised if minFraud returns an error, or if there is an HTTP error
|
55
|
-
class ResponseError <
|
55
|
+
class ResponseError < StandardError; end
|
56
56
|
```
|
57
57
|
|
58
58
|
### Transaction fields
|
data/lib/minfraud/minfraud.rb
CHANGED
@@ -7,7 +7,7 @@ module Minfraud
|
|
7
7
|
class TransactionError < ArgumentError; end
|
8
8
|
|
9
9
|
# Raised if minFraud returns an error, or if there is an HTTP error
|
10
|
-
class ResponseError <
|
10
|
+
class ResponseError < StandardError; end
|
11
11
|
|
12
12
|
# May be used to configure using common block style:
|
13
13
|
#
|
data/lib/minfraud/request.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'openssl'
|
2
3
|
|
3
4
|
module Minfraud
|
4
5
|
|
@@ -62,7 +63,11 @@ module Minfraud
|
|
62
63
|
def send_get_request
|
63
64
|
uri = Minfraud.uri
|
64
65
|
uri.query = URI.encode_www_form(encoded_query)
|
65
|
-
Net::HTTP.
|
66
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
67
|
+
http.use_ssl = true
|
68
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
69
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
70
|
+
http.request(request)
|
66
71
|
end
|
67
72
|
|
68
73
|
end
|
data/lib/minfraud/version.rb
CHANGED
@@ -31,10 +31,12 @@ describe Minfraud::Request do
|
|
31
31
|
'country' => '5',
|
32
32
|
'license_key' => '6'
|
33
33
|
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
http = double(:http)
|
35
|
+
expect(Net::HTTP).to receive(:new).and_return(http)
|
36
|
+
expect(http).to receive(:use_ssl=).with(true)
|
37
|
+
expect(http).to receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_NONE)
|
38
|
+
expect(Net::HTTP::Get).to receive(:new)
|
39
|
+
expect(http).to receive(:request).and_return(double())
|
38
40
|
Minfraud::Request.new(trans).get
|
39
41
|
end
|
40
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minfraud-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robbie Pitts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- ".travis.yml"
|
92
|
+
- CHANGELOG.md
|
92
93
|
- Gemfile
|
93
94
|
- LICENSE.txt
|
94
95
|
- README.md
|