From 84a23e35ba5dc9c9647d3bb926dc10a7ff50ead0 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Wed, 22 Nov 2023 00:09:36 -0600 Subject: [PATCH] add minfraud --- Gemfile | 1 + Gemfile.lock | 10 ++++++++++ config.yml.ci | 4 +++- config.yml.template | 6 +++++- environment.rb | 6 ++++++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 6bec7d7d..ebcf6234 100644 --- a/Gemfile +++ b/Gemfile @@ -62,6 +62,7 @@ gem 'adequate_crypto_address' gem 'twilio-ruby' gem 'phonelib' gem 'dnsbl-client' +gem 'minfraud' group :development, :test do gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock index d60848b8..804439d3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -164,10 +164,19 @@ GEM mini_mime (>= 0.1.1) matrix (0.4.2) maxmind-db (1.1.1) + maxmind-geoip2 (1.1.0) + connection_pool (~> 2.2) + http (>= 4.3, < 6.0) + maxmind-db (~> 1.1) method_source (1.0.0) mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) + minfraud (2.2.0) + connection_pool (~> 2.2) + http (>= 4.3, < 6.0) + maxmind-geoip2 (~> 1.1) + simpleidn (~> 0.1, >= 0.1.1) mini_mime (1.1.2) minitest (5.16.3) minitest-reporters (1.5.0) @@ -360,6 +369,7 @@ DEPENDENCIES magic mail maxmind-db + minfraud minitest minitest-reporters mocha diff --git a/config.yml.ci b/config.yml.ci index 7587484e..1df18a6f 100644 --- a/config.yml.ci +++ b/config.yml.ci @@ -23,4 +23,6 @@ hcaptcha_site_key: "10000000-ffff-ffff-ffff-000000000001" hcaptcha_secret_key: "0x0000000000000000000000000000000000000000" twilio_account_sid: ACEDERPDERP twilio_auth_token: derpderpderp -twilio_service_sid: VADERPDERPDERP \ No newline at end of file +twilio_service_sid: VADERPDERPDERP +minfraud_account_id: 696969420 +minfraud_license_key: DERPDERPDERP \ No newline at end of file diff --git a/config.yml.template b/config.yml.template index 1fc968fc..260c0397 100644 --- a/config.yml.template +++ b/config.yml.template @@ -18,6 +18,8 @@ development: paypal_api_signature: tonz letsencrypt_key: ./tests/files/letsencrypt.key letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/ + minfraud_account_id: 696969420 + minfraud_license_key: DERPDERPDERP proxy_ips: - 10.0.0.1 - 10.0.0.2 @@ -57,4 +59,6 @@ test: - 4.5.6.7 twilio_account_sid: ACEDERPDERP twilio_auth_token: derpderpderp - twilio_service_sid: VADERPDERPDERP \ No newline at end of file + twilio_service_sid: VADERPDERPDERP + minfraud_account_id: 696969420 + minfraud_license_key: DERPDERPDERP \ No newline at end of file diff --git a/environment.rb b/environment.rb index cbcba539..35a4b743 100644 --- a/environment.rb +++ b/environment.rb @@ -179,3 +179,9 @@ Money.default_currency = Money::Currency.new("USD") Money.rounding_mode = BigDecimal::ROUND_HALF_UP $twilio = Twilio::REST::Client.new $config['twilio_account_sid'], $config['twilio_auth_token'] + +Minfraud.configure do |c| + c.account_id = $config['minfraud_account_id'] + c.license_key = $config['minfraud_license_key'] + c.enable_validation = true +end