minfraud 2.1.0 → 2.3.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: e2805f5d3d40b2d325926a4a5614b86248bba07f905ffb37ec7dfa9589e97103
4
- data.tar.gz: 6d70e15b76a295c376232e6bf277e619ed783c23e46460e89e527458813b44ec
3
+ metadata.gz: 7f182ec6ff9542ff7b8ece4510f041f4781ea6f6866dac5abef6de9f3444f615
4
+ data.tar.gz: c3ab3c050bd54c5b48afef905ddc1233f27137d32bf33679a0853df568b5bdde
5
5
  SHA512:
6
- metadata.gz: 7a4e77f3d92e6173426e5151b234badc9fbe2503e41178d104eeda51c016835c6459308eaaa810063666030369e89828f1919731add25be6b51e0bf50821704a
7
- data.tar.gz: a07520d278d5191c2ac5dc9684d9d52ca670a494b088b56b4f8b920a0198ad53469e473d8114e9d33a891e4daa3f5ffa3573cf2190284dfb993b7e57742f9ca3
6
+ metadata.gz: 134ffce329ee439af6850e9ab57e7f66ca68c25578fa4d204973ecc7528ae3e7fd1d7f5548422baad3b421ca06459c6b731dcc10edd958642479015abd1df412
7
+ data.tar.gz: 55f507d7d54bbf7f4798027d8ea53a27464f0af26a8b53b80fcf5d56c15fb308bb921eca23f17ac6fffffddc94427ca946fee5ef6c75589d966c536815cf9448
@@ -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
@@ -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.2
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 }}
@@ -14,13 +20,14 @@ jobs:
14
20
  2.7,
15
21
  '3.0',
16
22
  3.1,
23
+ 3.2,
17
24
  jruby,
18
25
  ]
19
26
  exclude:
20
27
  - os: windows-latest
21
28
  version: jruby
22
29
  steps:
23
- - uses: actions/checkout@v2
30
+ - uses: actions/checkout@v4
24
31
  with:
25
32
  submodules: true
26
33
  - uses: ruby/setup-ruby@v1
data/.rubocop.yml CHANGED
@@ -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,27 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.3.0 (2023-12-04)
4
+
5
+ * Added the processor `:shopify_payments` to `Minfraud::Components::Payment`.
6
+ * Added the processor `:google_pay` to `Minfraud::Components::Payment`.
7
+ * Added the processor `:placetopay` to `Minfraud::Components::Payment`.
8
+ * In addition to the minfraud gem version, the User-Agent now includes the
9
+ version of Ruby and the version of the HTTP client in all HTTP requests.
10
+ * Updated `maxmind-geoip2` to version that includes the `anycast?` method
11
+ on `MaxMind::GeoIP2::Record::Traits`. This returns `true` if the IP
12
+ address belongs to an [anycast
13
+ network](https://en.wikipedia.org/wiki/Anycast). This is available in
14
+ minFraud Insights and Factors.
15
+
16
+ ## v2.2.0 (2022-03-28)
17
+
18
+ * Added the input `/credit_card/country`. This is the country where the
19
+ issuer of the card is located. This may be passed instead of the
20
+ `/credit_card/issuer_id_number` if you do not wish to pass partial
21
+ account numbers or if your payment processor does not provide them. You
22
+ may provide this using the `country` attribute on
23
+ `Minfraud::Components::CreditCard`.
24
+
3
25
  ## v2.1.0 (2022-01-25)
4
26
 
5
27
  * Adds the following new processor to `Minfraud::Components::Payment`:
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-2023 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
@@ -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-2023 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).
@@ -41,6 +41,16 @@ module Minfraud
41
41
  # @return [String, nil]
42
42
  attr_accessor :bank_phone_number
43
43
 
44
+ # The two character ISO 3166-1 alpha-2 country code where the issuer of
45
+ # the card is located. This may be passed instead of {::issuer_id_number}
46
+ # if you do not wish to pass partial account numbers, or if your payment
47
+ # processor does not provide them.
48
+ #
49
+ # @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
50
+ #
51
+ # @return [String, nil]
52
+ attr_accessor :country
53
+
44
54
  # A token uniquely identifying the card. The token should consist of
45
55
  # non-space printable ASCII characters. If the token is all digits, it
46
56
  # must be more than 19 characters long. The token must not be a primary
@@ -96,6 +106,7 @@ module Minfraud
96
106
  # correspond to one of the available attributes.
97
107
  def initialize(params = {})
98
108
  @bank_phone_country_code = params[:bank_phone_country_code]
109
+ @country = params[:country]
99
110
  @issuer_id_number = params[:issuer_id_number]
100
111
  @last_digits = params[:last_digits] || params[:last_4_digits]
101
112
  @bank_name = params[:bank_name]
@@ -114,6 +125,7 @@ module Minfraud
114
125
  return if !Minfraud.enable_validation
115
126
 
116
127
  validate_telephone_country_code('bank_phone_country_code', @bank_phone_country_code)
128
+ validate_country_code('country', @country)
117
129
  validate_regex('issuer_id_number', /\A(?:[0-9]{6}|[0-9]{8})\z/, @issuer_id_number)
118
130
  validate_regex('last_digits', /\A(?:[0-9]{2}|[0-9]{4})\z/, @last_digits)
119
131
  validate_string('bank_name', 255, @bank_name)
@@ -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,6 +130,7 @@ module Minfraud
129
130
  payway
130
131
  payza
131
132
  pinpayments
133
+ placetopay
132
134
  posconnect
133
135
  princeton_payment_solutions
134
136
  psigate
@@ -142,6 +144,7 @@ module Minfraud
142
144
  safecharge
143
145
  sagepay
144
146
  securetrading
147
+ shopify_payments
145
148
  simplify_commerce
146
149
  skrill
147
150
  smartcoin
@@ -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.1.0'
5
+ VERSION = '2.3.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
@@ -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.1.0
4
+ version: 2.3.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-01-25 00:00:00.000000000 Z
12
+ date: 2023-12-04 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: []
@@ -222,7 +222,7 @@ licenses:
222
222
  - MIT
223
223
  metadata:
224
224
  rubygems_mfa_required: 'true'
225
- post_install_message:
225
+ post_install_message:
226
226
  rdoc_options: []
227
227
  require_paths:
228
228
  - lib
@@ -237,8 +237,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
239
  requirements: []
240
- rubygems_version: 3.2.22
241
- signing_key:
240
+ rubygems_version: 3.4.18
241
+ signing_key:
242
242
  specification_version: 4
243
243
  summary: Ruby API for the minFraud Score, Insights, Factors, and Report Transactions
244
244
  services