Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
+++++++++++++++++++
Expand Down
27 changes: 26 additions & 1 deletion minfraud/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
}
Expand Down
3 changes: 3 additions & 0 deletions tests/data/factors-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
6 changes: 6 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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,
},
Expand Down