|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +require 'minfraud/model/abstract' |
| 4 | + |
| 5 | +module Minfraud |
| 6 | + module Model |
| 7 | + # The risk score reason for the multiplier. |
| 8 | + # |
| 9 | + # This class provides both a machine-readable code and a human-readable |
| 10 | + # explanation of the reason for the risk score, see |
| 11 | + # https://dev.maxmind.com/minfraud/api-documentation/responses/schema--response--risk-score-reason--multiplier-reason. |
| 12 | + # Although more codes may be added in the future, the current codes are: |
| 13 | + # |
| 14 | + # * BROWSER_LANGUAGE - Riskiness of the browser user-agent and |
| 15 | + # language associated with the request. |
| 16 | + # * BUSINESS_ACTIVITY - Riskiness of business activity |
| 17 | + # associated with the request. |
| 18 | + # * COUNTRY - Riskiness of the country associated with the request. |
| 19 | + # * CUSTOMER_ID - Riskiness of a customer's activity. |
| 20 | + # * EMAIL_DOMAIN - Riskiness of email domain. |
| 21 | + # * EMAIL_DOMAIN_NEW - Riskiness of newly-sighted email domain. |
| 22 | + # * EMAIL_ADDRESS_NEW - Riskiness of newly-sighted email address. |
| 23 | + # * EMAIL_LOCAL_PART - Riskiness of the local part of the email address. |
| 24 | + # * EMAIL_VELOCITY - Velocity on email - many requests on same email |
| 25 | + # over short period of time. |
| 26 | + # * ISSUER_ID_NUMBER_COUNTRY_MISMATCH - Riskiness of the country mismatch |
| 27 | + # between IP, billing, shipping and IIN country. |
| 28 | + # * ISSUER_ID_NUMBER_ON_SHOP_ID - Risk of Issuer ID Number for the shop ID. |
| 29 | + # * ISSUER_ID_NUMBER_LAST_DIGITS_ACTIVITY - Riskiness of many recent requests |
| 30 | + # and previous high-risk requests on the IIN and last digits of the credit card. |
| 31 | + # * ISSUER_ID_NUMBER_SHOP_ID_VELOCITY - Risk of recent Issuer ID Number activity |
| 32 | + # for the shop ID. |
| 33 | + # * INTRACOUNTRY_DISTANCE - Risk of distance between IP, billing, |
| 34 | + # and shipping location. |
| 35 | + # * ANONYMOUS_IP - Risk due to IP being an Anonymous IP. |
| 36 | + # * IP_BILLING_POSTAL_VELOCITY - Velocity of distinct billing postal code |
| 37 | + # on IP address. |
| 38 | + # * IP_EMAIL_VELOCITY - Velocity of distinct email address on IP address. |
| 39 | + # * IP_HIGH_RISK_DEVICE - High-risk device sighted on IP address. |
| 40 | + # * IP_ISSUER_ID_NUMBER_VELOCITY - Velocity of distinct IIN on IP address. |
| 41 | + # * IP_ACTIVITY - Riskiness of IP based on minFraud network activity. |
| 42 | + # * LANGUAGE - Riskiness of browser language. |
| 43 | + # * MAX_RECENT_EMAIL - Riskiness of email address |
| 44 | + # based on past minFraud risk scores on email. |
| 45 | + # * MAX_RECENT_PHONE - Riskiness of phone number |
| 46 | + # based on past minFraud risk scores on phone. |
| 47 | + # * MAX_RECENT_SHIP - Riskiness of email address |
| 48 | + # based on past minFraud risk scores on ship address. |
| 49 | + # * MULTIPLE_CUSTOMER_ID_ON_EMAIL - Riskiness of email address |
| 50 | + # having many customer IDs. |
| 51 | + # * ORDER_AMOUNT - Riskiness of the order amount. |
| 52 | + # * ORG_DISTANCE_RISK - Risk of ISP and distance between |
| 53 | + # billing address and IP location. |
| 54 | + # * PHONE - Riskiness of the phone number or related numbers. |
| 55 | + # * CART - Riskiness of shopping cart contents. |
| 56 | + # * TIME_OF_DAY - Risk due to local time of day. |
| 57 | + # * TRANSACTION_REPORT_EMAIL - Risk due to transaction reports |
| 58 | + # on the email address. |
| 59 | + # * TRANSACTION_REPORT_IP - Risk due to transaction reports on the IP address. |
| 60 | + # * TRANSACTION_REPORT_PHONE - Risk due to transaction reports |
| 61 | + # on the phone number. |
| 62 | + # * TRANSACTION_REPORT_SHIP - Risk due to transaction reports |
| 63 | + # on the shipping address. |
| 64 | + # * EMAIL_ACTIVITY - Riskiness of the email address |
| 65 | + # based on minFraud network activity. |
| 66 | + # * PHONE_ACTIVITY - Riskiness of the phone number |
| 67 | + # based on minFraud network activity. |
| 68 | + # * SHIP_ACTIVITY - Riskiness of ship address based on minFraud network activity. |
| 69 | + class Reason < Abstract |
| 70 | + # This value is a machine-readable code identifying the reason. |
| 71 | + # |
| 72 | + # @return [String] |
| 73 | + attr_reader :code |
| 74 | + |
| 75 | + # This property provides a human-readable explanation of the reason. The |
| 76 | + # description may change at any time and should not be matched against. |
| 77 | + # |
| 78 | + # @return [String] |
| 79 | + attr_reader :reason |
| 80 | + |
| 81 | + # @!visibility private |
| 82 | + def initialize(record) |
| 83 | + super |
| 84 | + |
| 85 | + @code = get('code') |
| 86 | + @reason = get('reason') |
| 87 | + end |
| 88 | + end |
| 89 | + end |
| 90 | +end |
0 commit comments