minfraud 1.0.4 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +5 -5
  2. data/.github/dependabot.yml +11 -0
  3. data/.github/workflows/release.yml +28 -0
  4. data/.github/workflows/rubocop.yml +18 -0
  5. data/.github/workflows/test.yml +36 -0
  6. data/.gitignore +2 -0
  7. data/.rubocop.yml +90 -0
  8. data/CHANGELOG.md +197 -4
  9. data/CODE_OF_CONDUCT.md +4 -4
  10. data/Gemfile +2 -2
  11. data/LICENSE.txt +2 -1
  12. data/README.dev.md +4 -0
  13. data/README.md +255 -58
  14. data/Rakefile +9 -3
  15. data/bin/console +4 -3
  16. data/dev-bin/release.sh +59 -0
  17. data/lib/minfraud/assessments.rb +127 -53
  18. data/lib/minfraud/components/account.rb +31 -9
  19. data/lib/minfraud/components/addressable.rb +73 -26
  20. data/lib/minfraud/components/base.rb +26 -14
  21. data/lib/minfraud/components/billing.rb +5 -0
  22. data/lib/minfraud/components/credit_card.rb +117 -29
  23. data/lib/minfraud/components/custom_inputs.rb +25 -0
  24. data/lib/minfraud/components/device.rb +51 -10
  25. data/lib/minfraud/components/email.rb +120 -9
  26. data/lib/minfraud/components/event.rb +60 -13
  27. data/lib/minfraud/components/order.rb +59 -22
  28. data/lib/minfraud/components/payment.rb +192 -22
  29. data/lib/minfraud/components/report/transaction.rb +80 -0
  30. data/lib/minfraud/components/shipping.rb +15 -6
  31. data/lib/minfraud/components/shopping_cart.rb +19 -12
  32. data/lib/minfraud/components/shopping_cart_item.rb +42 -13
  33. data/lib/minfraud/enum.rb +22 -8
  34. data/lib/minfraud/error_handler.rb +45 -18
  35. data/lib/minfraud/errors.rb +22 -2
  36. data/lib/minfraud/http_service/response.rb +61 -17
  37. data/lib/minfraud/model/abstract.rb +20 -0
  38. data/lib/minfraud/model/address.rb +52 -0
  39. data/lib/minfraud/model/billing_address.rb +11 -0
  40. data/lib/minfraud/model/credit_card.rb +75 -0
  41. data/lib/minfraud/model/device.rb +51 -0
  42. data/lib/minfraud/model/disposition.rb +42 -0
  43. data/lib/minfraud/model/email.rb +54 -0
  44. data/lib/minfraud/model/email_domain.rb +24 -0
  45. data/lib/minfraud/model/error.rb +28 -0
  46. data/lib/minfraud/model/factors.rb +24 -0
  47. data/lib/minfraud/model/geoip2_location.rb +25 -0
  48. data/lib/minfraud/model/insights.rb +68 -0
  49. data/lib/minfraud/model/ip_address.rb +58 -0
  50. data/lib/minfraud/model/ip_risk_reason.rb +48 -0
  51. data/lib/minfraud/model/issuer.rb +49 -0
  52. data/lib/minfraud/model/score.rb +76 -0
  53. data/lib/minfraud/model/score_ip_address.rb +23 -0
  54. data/lib/minfraud/model/shipping_address.rb +30 -0
  55. data/lib/minfraud/model/subscores.rb +156 -0
  56. data/lib/minfraud/model/warning.rb +63 -0
  57. data/lib/minfraud/report.rb +66 -0
  58. data/lib/minfraud/resolver.rb +25 -16
  59. data/lib/minfraud/validates.rb +187 -0
  60. data/lib/minfraud/version.rb +4 -1
  61. data/lib/minfraud.rb +55 -16
  62. data/minfraud.gemspec +27 -18
  63. metadata +107 -36
  64. data/.travis.yml +0 -5
  65. data/lib/minfraud/http_service/request.rb +0 -37
  66. data/lib/minfraud/http_service.rb +0 -31
metadata CHANGED
@@ -1,97 +1,112 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfraud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kushnir.yb
8
+ - William Storey
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2016-12-23 00:00:00.000000000 Z
12
+ date: 2024-01-12 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
- name: faraday
15
+ name: connection_pool
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
18
  - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: '0.9'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.9.1
20
+ version: '2.2'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - "~>"
28
26
  - !ruby/object:Gem::Version
29
- version: '0.9'
27
+ version: '2.2'
28
+ - !ruby/object:Gem::Dependency
29
+ name: http
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '4.3'
35
+ - - "<"
36
+ - !ruby/object:Gem::Version
37
+ version: '6.0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
30
42
  - - ">="
31
43
  - !ruby/object:Gem::Version
32
- version: 0.9.1
44
+ version: '4.3'
45
+ - - "<"
46
+ - !ruby/object:Gem::Version
47
+ version: '6.0'
33
48
  - !ruby/object:Gem::Dependency
34
- name: faraday_middleware
49
+ name: maxmind-geoip2
35
50
  requirement: !ruby/object:Gem::Requirement
36
51
  requirements:
37
52
  - - "~>"
38
53
  - !ruby/object:Gem::Version
39
- version: '0.9'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.9.1
54
+ version: '1.2'
43
55
  type: :runtime
44
56
  prerelease: false
45
57
  version_requirements: !ruby/object:Gem::Requirement
46
58
  requirements:
47
59
  - - "~>"
48
60
  - !ruby/object:Gem::Version
49
- version: '0.9'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.9.1
61
+ version: '1.2'
53
62
  - !ruby/object:Gem::Dependency
54
- name: hashie
63
+ name: simpleidn
55
64
  requirement: !ruby/object:Gem::Requirement
56
65
  requirements:
57
66
  - - "~>"
58
67
  - !ruby/object:Gem::Version
59
- version: '3.0'
68
+ version: '0.1'
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 0.1.1
60
72
  type: :runtime
61
73
  prerelease: false
62
74
  version_requirements: !ruby/object:Gem::Requirement
63
75
  requirements:
64
76
  - - "~>"
65
77
  - !ruby/object:Gem::Version
66
- version: '3.0'
78
+ version: '0.1'
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 0.1.1
67
82
  - !ruby/object:Gem::Dependency
68
83
  name: bundler
69
84
  requirement: !ruby/object:Gem::Requirement
70
85
  requirements:
71
86
  - - "~>"
72
87
  - !ruby/object:Gem::Version
73
- version: '1.12'
88
+ version: '2.2'
74
89
  type: :development
75
90
  prerelease: false
76
91
  version_requirements: !ruby/object:Gem::Requirement
77
92
  requirements:
78
93
  - - "~>"
79
94
  - !ruby/object:Gem::Version
80
- version: '1.12'
95
+ version: '2.2'
81
96
  - !ruby/object:Gem::Dependency
82
97
  name: rake
83
98
  requirement: !ruby/object:Gem::Requirement
84
99
  requirements:
85
100
  - - "~>"
86
101
  - !ruby/object:Gem::Version
87
- version: '10.0'
102
+ version: '13.0'
88
103
  type: :development
89
104
  prerelease: false
90
105
  version_requirements: !ruby/object:Gem::Requirement
91
106
  requirements:
92
107
  - - "~>"
93
108
  - !ruby/object:Gem::Version
94
- version: '10.0'
109
+ version: '13.0'
95
110
  - !ruby/object:Gem::Dependency
96
111
  name: rspec
97
112
  requirement: !ruby/object:Gem::Requirement
@@ -106,24 +121,58 @@ dependencies:
106
121
  - - "~>"
107
122
  - !ruby/object:Gem::Version
108
123
  version: '3.0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rubocop
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1.23'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1.23'
138
+ - !ruby/object:Gem::Dependency
139
+ name: webmock
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '3.14'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '3.14'
109
152
  description:
110
153
  email:
111
- - kushnir.yb@gmail.com
154
+ - support@maxmind.com
112
155
  executables: []
113
156
  extensions: []
114
157
  extra_rdoc_files: []
115
158
  files:
159
+ - ".github/dependabot.yml"
160
+ - ".github/workflows/release.yml"
161
+ - ".github/workflows/rubocop.yml"
162
+ - ".github/workflows/test.yml"
116
163
  - ".gitignore"
117
164
  - ".rspec"
118
- - ".travis.yml"
165
+ - ".rubocop.yml"
119
166
  - CHANGELOG.md
120
167
  - CODE_OF_CONDUCT.md
121
168
  - Gemfile
122
169
  - LICENSE.txt
170
+ - README.dev.md
123
171
  - README.md
124
172
  - Rakefile
125
173
  - bin/console
126
174
  - bin/setup
175
+ - dev-bin/release.sh
127
176
  - lib/minfraud.rb
128
177
  - lib/minfraud/assessments.rb
129
178
  - lib/minfraud/components/account.rb
@@ -131,27 +180,50 @@ files:
131
180
  - lib/minfraud/components/base.rb
132
181
  - lib/minfraud/components/billing.rb
133
182
  - lib/minfraud/components/credit_card.rb
183
+ - lib/minfraud/components/custom_inputs.rb
134
184
  - lib/minfraud/components/device.rb
135
185
  - lib/minfraud/components/email.rb
136
186
  - lib/minfraud/components/event.rb
137
187
  - lib/minfraud/components/order.rb
138
188
  - lib/minfraud/components/payment.rb
189
+ - lib/minfraud/components/report/transaction.rb
139
190
  - lib/minfraud/components/shipping.rb
140
191
  - lib/minfraud/components/shopping_cart.rb
141
192
  - lib/minfraud/components/shopping_cart_item.rb
142
193
  - lib/minfraud/enum.rb
143
194
  - lib/minfraud/error_handler.rb
144
195
  - lib/minfraud/errors.rb
145
- - lib/minfraud/http_service.rb
146
- - lib/minfraud/http_service/request.rb
147
196
  - lib/minfraud/http_service/response.rb
197
+ - lib/minfraud/model/abstract.rb
198
+ - lib/minfraud/model/address.rb
199
+ - lib/minfraud/model/billing_address.rb
200
+ - lib/minfraud/model/credit_card.rb
201
+ - lib/minfraud/model/device.rb
202
+ - lib/minfraud/model/disposition.rb
203
+ - lib/minfraud/model/email.rb
204
+ - lib/minfraud/model/email_domain.rb
205
+ - lib/minfraud/model/error.rb
206
+ - lib/minfraud/model/factors.rb
207
+ - lib/minfraud/model/geoip2_location.rb
208
+ - lib/minfraud/model/insights.rb
209
+ - lib/minfraud/model/ip_address.rb
210
+ - lib/minfraud/model/ip_risk_reason.rb
211
+ - lib/minfraud/model/issuer.rb
212
+ - lib/minfraud/model/score.rb
213
+ - lib/minfraud/model/score_ip_address.rb
214
+ - lib/minfraud/model/shipping_address.rb
215
+ - lib/minfraud/model/subscores.rb
216
+ - lib/minfraud/model/warning.rb
217
+ - lib/minfraud/report.rb
148
218
  - lib/minfraud/resolver.rb
219
+ - lib/minfraud/validates.rb
149
220
  - lib/minfraud/version.rb
150
221
  - minfraud.gemspec
151
- homepage: https://github.com/kushniryb/minfraud-api-v2
222
+ homepage: https://github.com/maxmind/minfraud-api-ruby
152
223
  licenses:
153
224
  - MIT
154
- metadata: {}
225
+ metadata:
226
+ rubygems_mfa_required: 'true'
155
227
  post_install_message:
156
228
  rdoc_options: []
157
229
  require_paths:
@@ -160,17 +232,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
232
  requirements:
161
233
  - - ">="
162
234
  - !ruby/object:Gem::Version
163
- version: '1.9'
235
+ version: 2.7.0
164
236
  required_rubygems_version: !ruby/object:Gem::Requirement
165
237
  requirements:
166
238
  - - ">="
167
239
  - !ruby/object:Gem::Version
168
240
  version: '0'
169
241
  requirements: []
170
- rubyforge_project:
171
- rubygems_version: 2.6.6
242
+ rubygems_version: 3.5.3
172
243
  signing_key:
173
244
  specification_version: 4
174
- summary: Ruby interface to the MaxMind minFraud v2.0 API services
245
+ summary: Ruby API for the minFraud Score, Insights, Factors, and Report Transactions
246
+ services
175
247
  test_files: []
176
- has_rdoc:
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.12.5
@@ -1,37 +0,0 @@
1
- require 'faraday'
2
-
3
- module Minfraud
4
- module HTTPService
5
- class Request
6
- # @attribute middleware
7
- # @return [Proc] A proc containing Faraday configuration
8
- attr_reader :middleware
9
-
10
- # @attribute server
11
- # @return [String] an API endpoint
12
- attr_reader :server
13
-
14
- # Creates Minfraud::HTTPService::Request instance
15
- # @param [Hash] params hash of parameters
16
- # @return [Minfraud::HTTPService::Request] Request instance
17
- def initialize(params = {})
18
- @middleware = params[:middleware]
19
- @server = params[:server]
20
- end
21
-
22
- # Performs an HTTP request to the specified endpoint with given body
23
- # @param [Hash] params hash of parameters.
24
- # @return [Farday::Response] Faraday::Response instance
25
- def perform(params)
26
- adapter.send(*params.values_at(:verb, :endpoint, :body))
27
- end
28
-
29
- private
30
- # Creates memoized Faraday::Connection instance
31
- # @return [Faraday::Connection] Faraday::Connection instance
32
- def adapter
33
- @adapter ||= Faraday.new(server, {}, &middleware)
34
- end
35
- end
36
- end
37
- end
@@ -1,31 +0,0 @@
1
- require 'faraday'
2
- require 'faraday_middleware'
3
-
4
- module Minfraud
5
- module HTTPService
6
- class << self
7
- # @return [Hash] default HTTPService configuration
8
- def configuration
9
- {
10
- middleware: DEFAULT_MIDDLEWARE,
11
- server: DEFAULT_SERVER
12
- }
13
- end
14
- end
15
-
16
- # Minfraud default middleware stack
17
- DEFAULT_MIDDLEWARE = Proc.new do |builder|
18
- builder.request :json
19
-
20
- builder.basic_auth *::Minfraud.configuration.values
21
-
22
- builder.response :mashify
23
- builder.response :json, content_type: /\bjson$/
24
-
25
- builder.adapter Faraday.default_adapter
26
- end
27
-
28
- # Minfraud default server
29
- DEFAULT_SERVER = 'https://minfraud.maxmind.com/minfraud/v2.0'.freeze
30
- end
31
- end