diff --git a/HISTORY.rst b/HISTORY.rst index 2fbfea6..dd802e2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,10 @@ History * ``paytm`` * ``razorpay`` * ``systempay`` +* Added support for the following new subscores in Factors responses: + * ``device``: the risk associated with the device + * ``email_local_part``: the risk associated with the email address local part + * ``shipping_address``: the risk associated with the shipping address 1.12.1 (2020-06-17) +++++++++++++++++++ diff --git a/minfraud/models.py b/minfraud/models.py index 39e8a69..0cd129f 100644 --- a/minfraud/models.py +++ b/minfraud/models.py @@ -727,7 +727,7 @@ class Subscores(object): The risk associated with the combination of IP country, card issuer country, billing country, and shipping country. If present, this is a - value in the range 0.01 to 99. + value in the range 0.01 to 99. :type: float | None @@ -738,6 +738,13 @@ class Subscores(object): :type: float | None + .. attribute:: device + + The risk associated with the device. If present, this is a value in the + range 0.01 to 99. + + :type: float | None + .. attribute:: email_address The risk associated with the particular email address. If present, this @@ -752,6 +759,14 @@ class Subscores(object): :type: float | None + .. attribute:: email_local_part + + The risk associated with the email address local part (the part of the + email address before the @ symbol). If present, this is a value in the + range 0.01 to 99. + + :type: float | None + .. attribute:: email_tenure The risk associated with the issuer ID number on the email domain. If @@ -804,6 +819,13 @@ class Subscores(object): :type: float | None + .. attribute:: shipping_address + + The risk associated with the shipping address. If present, this is a + value in the range 0.01 to 99. + + :type: float | None + .. attribute:: shipping_address_distance_to_ip_location The risk associated with the distance between the shipping address and @@ -831,13 +853,16 @@ class Subscores(object): "country": None, "country_mismatch": None, "cvv_result": None, + "device": None, "email_address": None, "email_domain": None, + "email_local_part": None, "email_tenure": None, "ip_tenure": None, "issuer_id_number": None, "order_amount": None, "phone_number": None, + "shipping_address": None, "shipping_address_distance_to_ip_location": None, "time_of_day": None, } diff --git a/tests/data/factors-response.json b/tests/data/factors-response.json index c512b65..2e5197f 100644 --- a/tests/data/factors-response.json +++ b/tests/data/factors-response.json @@ -154,13 +154,16 @@ "country": 0.06, "country_mismatch": 0.07, "cvv_result": 0.08, + "device": 0.18, "email_address": 0.09, "email_domain": 0.1, + "email_local_part": 0.19, "email_tenure": 0.11, "ip_tenure": 0.12, "issuer_id_number": 0.13, "order_amount": 0.14, "phone_number": 0.15, + "shipping_address": 0.2, "shipping_address_distance_to_ip_location": 0.16, "time_of_day": 0.17 }, diff --git a/tests/test_models.py b/tests/test_models.py index 14754c1..7329292 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -265,13 +265,16 @@ def test_factors(self): self.assertEqual(0.06, factors.subscores.country) self.assertEqual(0.07, factors.subscores.country_mismatch) self.assertEqual(0.08, factors.subscores.cvv_result) + self.assertEqual(0.18, factors.subscores.device) self.assertEqual(0.09, factors.subscores.email_address) self.assertEqual(0.10, factors.subscores.email_domain) + self.assertEqual(0.19, factors.subscores.email_local_part) self.assertEqual(0.11, factors.subscores.email_tenure) self.assertEqual(0.12, factors.subscores.ip_tenure) self.assertEqual(0.13, factors.subscores.issuer_id_number) self.assertEqual(0.14, factors.subscores.order_amount) self.assertEqual(0.15, factors.subscores.phone_number) + self.assertEqual(0.2, factors.subscores.shipping_address) self.assertEqual( 0.16, factors.subscores.shipping_address_distance_to_ip_location ) @@ -304,13 +307,16 @@ def factors_response(self): "country": 0.06, "country_mismatch": 0.07, "cvv_result": 0.08, + "device": 0.18, "email_address": 0.09, "email_domain": 0.10, + "email_local_part": 0.19, "email_tenure": 0.11, "ip_tenure": 0.12, "issuer_id_number": 0.13, "order_amount": 0.14, "phone_number": 0.15, + "shipping_address": 0.2, "shipping_address_distance_to_ip_location": 0.16, "time_of_day": 0.17, },