minfraud 2.2.0 → 2.4.0

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
  SHA256:
3
- metadata.gz: 0f6c78c29956e0fd0302d07fe250d84bf9d750fb0ef5d713f57afd8bd8ec355d
4
- data.tar.gz: f438db4f7d05466e6074192031900ce47fffdd1f2f6256706b63fa2d49ca4c56
3
+ metadata.gz: 14d6fda0782c4f12ecd3599b4d6f3887be93845fca267490bbc64ad6bf5e3518
4
+ data.tar.gz: 0dbcb74c203b066c41ad1d85b25e236a63c9e2904a87064bece9ce69a60eecc6
5
5
  SHA512:
6
- metadata.gz: 837c85526868ce32e3485da88043dc5d2d5ec1aeda9b66ed7f30dd75f609eb8bdf9a0645aade8a3ae7b7993384559dbe6d6455be1f36cae0cda873d10b4f829d
7
- data.tar.gz: ebb55de945c03a0ba68a78ec6c75f3c71b51533be2a5adaf321f35a64e64c6905fca90ba9c996351d9ed190730a97d7cbbc19fb14147e919b29da7457ab409c4
6
+ metadata.gz: 74a6d172a649d417c89ca8a22a454407e54d70a19cea0583594165a2de23ac9df889478675fadad4becade61a84ac7fb39950ae890cd8d98c80e2dcdb6a2d38d
7
+ data.tar.gz: 7c9c52f1929869e043878b4f74c40d488fa5a44df587b63362a537b14b8f3602a4c78b51abeb18ab2404bf49ba2662b38919a5470de8270f2b53dc1ea2b80071
@@ -5,3 +5,7 @@ updates:
5
5
  schedule:
6
6
  interval: daily
7
7
  open-pull-requests-limit: 10
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: daily
@@ -0,0 +1,28 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ release:
10
+ types:
11
+ - published
12
+
13
+ jobs:
14
+ push:
15
+ if: github.event_name == 'release' && github.event.action == 'published'
16
+ runs-on: ubuntu-latest
17
+ environment: release
18
+ permissions:
19
+ id-token: write
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Ruby
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ bundler-cache: true
26
+ ruby-version: ruby
27
+
28
+ - uses: rubygems/release-gem@v1
@@ -1,12 +1,18 @@
1
1
  name: Run rubocop
2
- on: [push, pull_request]
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ schedule:
7
+ - cron: '4 0 * * SUN'
8
+
3
9
  jobs:
4
10
  rubocop:
5
11
  runs-on: ubuntu-latest
6
12
  steps:
7
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v4
8
14
  - uses: ruby/setup-ruby@v1
9
15
  with:
10
- ruby-version: 3.1
16
+ ruby-version: 3.3
11
17
  - run: bundle install
12
18
  - run: bundle exec rake -t rubocop
@@ -1,5 +1,11 @@
1
1
  name: Run tests
2
- on: [push, pull_request]
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ schedule:
7
+ - cron: '4 1 * * SUN'
8
+
3
9
  jobs:
4
10
  test:
5
11
  runs-on: ${{ matrix.os }}
@@ -9,18 +15,18 @@ jobs:
9
15
  os: [ubuntu-latest, windows-latest, macos-latest]
10
16
  version:
11
17
  [
12
- 2.5,
13
- 2.6,
14
18
  2.7,
15
19
  '3.0',
16
20
  3.1,
21
+ 3.2,
22
+ 3.3,
17
23
  jruby,
18
24
  ]
19
25
  exclude:
20
26
  - os: windows-latest
21
27
  version: jruby
22
28
  steps:
23
- - uses: actions/checkout@v2
29
+ - uses: actions/checkout@v4
24
30
  with:
25
31
  submodules: true
26
32
  - uses: ruby/setup-ruby@v1
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.5
2
+ TargetRubyVersion: 2.7
3
3
  NewCops: enable
4
4
 
5
5
  # Metrics.
@@ -85,3 +85,6 @@ Lint/MissingSuper:
85
85
 
86
86
  Naming/VariableNumber:
87
87
  Enabled: false # Doesn't always make sense.
88
+
89
+ Gemspec/DevelopmentDependencies:
90
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.4.0 (2024-01-12)
4
+
5
+ * Ruby 2.7+ is now required. If you're using Ruby 2.5 or 2.6, please use
6
+ version 2.3.0 of this gem.
7
+ * Added the processors `:pxp_financial` and `:trustpay` to
8
+ `Minfraud::Components::Payment`.
9
+
10
+ ## v2.3.0 (2023-12-04)
11
+
12
+ * Added the processor `:shopify_payments` to `Minfraud::Components::Payment`.
13
+ * Added the processor `:google_pay` to `Minfraud::Components::Payment`.
14
+ * Added the processor `:placetopay` to `Minfraud::Components::Payment`.
15
+ * In addition to the minfraud gem version, the User-Agent now includes the
16
+ version of Ruby and the version of the HTTP client in all HTTP requests.
17
+ * Updated `maxmind-geoip2` to version that includes the `anycast?` method
18
+ on `MaxMind::GeoIP2::Record::Traits`. This returns `true` if the IP
19
+ address belongs to an [anycast
20
+ network](https://en.wikipedia.org/wiki/Anycast). This is available in
21
+ minFraud Insights and Factors.
22
+
3
23
  ## v2.2.0 (2022-03-28)
4
24
 
5
25
  * Added the input `/credit_card/country`. This is the country where the
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2016-2020 kushnir.yb
4
- Copyright (c) 2020-2022 MaxMind, Inc.
4
+ Copyright (c) 2020-2024 MaxMind, Inc.
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -50,6 +50,16 @@ Minfraud.configure do |c|
50
50
  end
51
51
  ````
52
52
 
53
+ To use the Sandbox web service instead of the production web service, you can provide the host:
54
+
55
+ ```ruby
56
+ Minfraud.configure do |c|
57
+ c.account_id = 12345
58
+ c.license_key = 'your_license_key'
59
+ c.host = 'sandbox.maxmind.com'
60
+ end
61
+ ```
62
+
53
63
  ### Making a minFraud Score, Insights, or Factors Request
54
64
 
55
65
  To use the minFraud API, create a `Minfraud::Assessments` object. The
@@ -265,7 +275,7 @@ to the client API, please see
265
275
 
266
276
  ## Requirements
267
277
 
268
- This gem works with Ruby 2.5 and above.
278
+ This gem works with Ruby 2.7 and above.
269
279
 
270
280
  ## Contributing
271
281
 
@@ -283,7 +293,7 @@ This API uses [Semantic Versioning](https://semver.org/).
283
293
 
284
294
  Copyright (c) 2016-2020 kushnir.yb.
285
295
 
286
- Copyright (c) 2020-2022 MaxMind, Inc.
296
+ Copyright (c) 2020-2024 MaxMind, Inc.
287
297
 
288
298
  The gem is available as open source under the terms of the [MIT
289
299
  License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,59 @@
1
+ #!/bin/bash
2
+
3
+ set -eu -o pipefail
4
+
5
+ changelog=$(cat CHANGELOG.md)
6
+
7
+ regex='
8
+ ## v([0-9]+\.[0-9]+\.[0-9]+) \(([0-9]{4}-[0-9]{2}-[0-9]{2})\)
9
+
10
+ ((.|
11
+ )*)
12
+ '
13
+
14
+ if [[ ! $changelog =~ $regex ]]; then
15
+ echo "Could not find date line in change log!"
16
+ exit 1
17
+ fi
18
+
19
+ version="${BASH_REMATCH[1]}"
20
+ date="${BASH_REMATCH[2]}"
21
+ notes="$(echo "${BASH_REMATCH[3]}" | sed -n -E '/^## v[0-9]+\.[0-9]+\.[0-9]+/,$!p')"
22
+
23
+ echo "$notes"
24
+ if [[ "$date" != "$(date +"%Y-%m-%d")" ]]; then
25
+ echo "$date is not today!"
26
+ exit 1
27
+ fi
28
+
29
+ tag="v$version"
30
+
31
+ if [ -n "$(git status --porcelain)" ]; then
32
+ echo ". is not clean." >&2
33
+ exit 1
34
+ fi
35
+
36
+ perl -pi -e "s/(?<=VERSION = \').+?(?=\')/$version/g" lib/minfraud/version.rb
37
+
38
+ echo $"Test results:"
39
+
40
+ rake
41
+
42
+ echo $'\nDiff:'
43
+ git diff
44
+
45
+ echo $'\nRelease notes:'
46
+ echo "$notes"
47
+
48
+ read -e -p "Commit changes and push to origin? " should_push
49
+
50
+ if [ "$should_push" != "y" ]; then
51
+ echo "Aborting"
52
+ exit 1
53
+ fi
54
+
55
+ git commit -m "Update for $tag" -a
56
+
57
+ git push
58
+
59
+ gh release create --target "$(git branch --show-current)" -t "$version" -n "$notes" "$tag"
@@ -78,6 +78,7 @@ module Minfraud
78
78
  g2a_pay
79
79
  global_payments
80
80
  gocardless
81
+ google_pay
81
82
  heartland
82
83
  hipay
83
84
  ingenico
@@ -129,9 +130,11 @@ module Minfraud
129
130
  payway
130
131
  payza
131
132
  pinpayments
133
+ placetopay
132
134
  posconnect
133
135
  princeton_payment_solutions
134
136
  psigate
137
+ pxp_financial
135
138
  qiwi
136
139
  quickpay
137
140
  raberil
@@ -142,6 +145,7 @@ module Minfraud
142
145
  safecharge
143
146
  sagepay
144
147
  securetrading
148
+ shopify_payments
145
149
  simplify_commerce
146
150
  skrill
147
151
  smartcoin
@@ -155,6 +159,7 @@ module Minfraud
155
159
  towah
156
160
  transact_pro
157
161
  trustly
162
+ trustpay
158
163
  tsys
159
164
  usa_epay
160
165
  vantiv
@@ -19,10 +19,7 @@ module Minfraud
19
19
  attr_reader :confidence
20
20
 
21
21
  # A UUID that MaxMind uses for the device associated with this IP
22
- # address. Note that many devices cannot be uniquely identified because
23
- # they are too common (for example, all iPhones of a given model and OS
24
- # release). In these cases, the minFraud service will simply not return a
25
- # UUID for that device.
22
+ # address.
26
23
  #
27
24
  # @return [String, nil]
28
25
  attr_reader :id
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Minfraud
4
4
  # The Gem version.
5
- VERSION = '2.2.0'
5
+ VERSION = '2.4.0'
6
6
  end
data/lib/minfraud.rb CHANGED
@@ -43,6 +43,11 @@ module Minfraud
43
43
  attr_accessor :enable_validation
44
44
 
45
45
  # The host to use when connecting to the web service.
46
+ # By default, the client connects to the production host. However,
47
+ # during testing and development, you can set this option to
48
+ # 'sandbox.maxmind.com' to use the Sandbox environment's host. The
49
+ # sandbox allows you to experiment with the API without affecting your
50
+ # production data.
46
51
  #
47
52
  # @return [String, nil]
48
53
  attr_accessor :host
@@ -76,7 +81,7 @@ module Minfraud
76
81
  pass: @license_key,
77
82
  ).headers(
78
83
  accept: 'application/json',
79
- user_agent: "minfraud-api-ruby/#{Minfraud::VERSION}",
84
+ user_agent: "minfraud-api-ruby/#{Minfraud::VERSION} ruby/#{RUBY_VERSION} http/#{HTTP::VERSION}",
80
85
  )
81
86
  end
82
87
  end
data/minfraud.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://github.com/maxmind/minfraud-api-ruby'
16
16
  spec.license = 'MIT'
17
17
 
18
- spec.required_ruby_version = '>= 2.5.0'
18
+ spec.required_ruby_version = '>= 2.7.0'
19
19
 
20
20
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
21
  spec.bindir = 'exe'
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_runtime_dependency 'connection_pool', '~> 2.2'
26
26
  spec.add_runtime_dependency 'http', '>= 4.3', '< 6.0'
27
- spec.add_runtime_dependency 'maxmind-geoip2', '~> 1.1'
27
+ spec.add_runtime_dependency 'maxmind-geoip2', '~> 1.2'
28
28
  spec.add_runtime_dependency 'simpleidn', '~> 0.1', '>= 0.1.1'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '~> 2.2'
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfraud
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kushnir.yb
8
8
  - William Storey
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-03-28 00:00:00.000000000 Z
12
+ date: 2024-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: connection_pool
@@ -51,14 +51,14 @@ dependencies:
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.1'
54
+ version: '1.2'
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.1'
61
+ version: '1.2'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: simpleidn
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -149,7 +149,7 @@ dependencies:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
151
  version: '3.14'
152
- description:
152
+ description:
153
153
  email:
154
154
  - support@maxmind.com
155
155
  executables: []
@@ -157,6 +157,7 @@ extensions: []
157
157
  extra_rdoc_files: []
158
158
  files:
159
159
  - ".github/dependabot.yml"
160
+ - ".github/workflows/release.yml"
160
161
  - ".github/workflows/rubocop.yml"
161
162
  - ".github/workflows/test.yml"
162
163
  - ".gitignore"
@@ -171,6 +172,7 @@ files:
171
172
  - Rakefile
172
173
  - bin/console
173
174
  - bin/setup
175
+ - dev-bin/release.sh
174
176
  - lib/minfraud.rb
175
177
  - lib/minfraud/assessments.rb
176
178
  - lib/minfraud/components/account.rb
@@ -222,7 +224,7 @@ licenses:
222
224
  - MIT
223
225
  metadata:
224
226
  rubygems_mfa_required: 'true'
225
- post_install_message:
227
+ post_install_message:
226
228
  rdoc_options: []
227
229
  require_paths:
228
230
  - lib
@@ -230,15 +232,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
230
232
  requirements:
231
233
  - - ">="
232
234
  - !ruby/object:Gem::Version
233
- version: 2.5.0
235
+ version: 2.7.0
234
236
  required_rubygems_version: !ruby/object:Gem::Requirement
235
237
  requirements:
236
238
  - - ">="
237
239
  - !ruby/object:Gem::Version
238
240
  version: '0'
239
241
  requirements: []
240
- rubygems_version: 3.3.3
241
- signing_key:
242
+ rubygems_version: 3.5.3
243
+ signing_key:
242
244
  specification_version: 4
243
245
  summary: Ruby API for the minFraud Score, Insights, Factors, and Report Transactions
244
246
  services