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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70984ef59b83860d9aa8683045bf0f7d38b2dfbb
4
- data.tar.gz: a51d52744dbd3c64531d086812014a1d9baeeb6b
3
+ metadata.gz: 3fc780f5307862be2c0515ec053d763068e6fc12
4
+ data.tar.gz: f58d1c34eb9cde0786a4f9ace065418cfa2b3040
5
5
  SHA512:
6
- metadata.gz: 50015aca3d50f32f23fe9a422c65c5ecc6625846076e00197030a174f87ff391ef694d100d2ea1c8ad9d02943cc544f8e066e759966936dbd99337b1307f8d31
7
- data.tar.gz: 5a1ecf78b729dccef28f2e69d10d8e6496a7399575c6cfbe44f20d57ca3baef4c6f88242cbee84edb1f585caa0db04aac903341c2a64c31f1534c544a4a52696
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 < ArgumentError; end
55
+ class ResponseError < StandardError; end
56
56
  ```
57
57
 
58
58
  ### Transaction fields
@@ -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 < ArgumentError; end
10
+ class ResponseError < StandardError; end
11
11
 
12
12
  # May be used to configure using common block style:
13
13
  #
@@ -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.get_response(uri)
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
@@ -1,3 +1,3 @@
1
1
  module Minfraud
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -31,10 +31,12 @@ describe Minfraud::Request do
31
31
  'country' => '5',
32
32
  'license_key' => '6'
33
33
  }
34
- expect(Net::HTTP).to receive(:get_response) do |uri|
35
- expect(uri.to_s).to include(Minfraud.uri.to_s)
36
- expect(uri.query).to include(URI.encode_www_form(request_body))
37
- end
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.0
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-17 00:00:00.000000000 Z
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