Skip to content
Merged
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
17 changes: 8 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The possible errors are:
rejects the request as invalid for another reason, such as a reserved IP
address. It is also raised if validation of the request before it is sent to
the server fails.
* ``minfraud.HttpError`` - This will be raised when an unexpected HTTP
* ``minfraud.HTTPError`` - This will be raised when an unexpected HTTP

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is still incomplete. score(), insights(), factors() and report() raise PermissionRequiredError when the service returns PERMISSION_REQUIRED (_exception_for_web_service_error in src/minfraud/webservice.py). The list does not name it. Also, src/minfraud/__init__.py does not export it, so minfraud.PermissionRequiredError raises AttributeError, and only minfraud.errors.PermissionRequiredError works. The :raises: lines in the client method docstrings leave it out too.

This problem is older than this PR, but the PR already fixes one error name in this list.

Suggestion: export PermissionRequiredError from minfraud/__init__.py and add a bullet for minfraud.PermissionRequiredError here and in the :raises: lines. If you do not want to change the exports in a docs PR, add a bullet for minfraud.errors.PermissionRequiredError.

🤖 Comment by Claude Opus 5.5.

error occurs such as a firewall interfering with the request to the server.
* ``minfraud.MinFraudError`` - This will be raised when some other error
occurs such as unexpected content from the server. This also serves as the
Expand Down Expand Up @@ -202,7 +202,6 @@ Score, Insights and Factors Example
>>> 'phone_country_code': '1',
>>> 'phone_number': '123-456-0000',
>>> 'phone_verification_method': 'network',
>>> 'phone_verification_time': '2026-10-01T14:35:00Z',
>>> 'phone_was_verification_successful': False,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR changes the guidance for the verification inputs, but HISTORY.rst has no entry for it. The sibling STF-2488 PRs for Java, .NET, PHP, Node and Ruby each add a changelog entry that states the new rules:

  • Send true if your system considers the email address or phone number verified as of the time of the event.
  • Send false if it is not verified, for example if its only verification is pending or failed.
  • Send nothing if your system does not track verification.
  • Send a verification time only with true.

There are two more reasons to add an entry here:

  • The 3.4.0 entry says these inputs "describe the most recent verification". The new rule is different: an earlier completed verification stays true when a newer attempt is pending or failed. Only a newer entry corrects that statement.
  • README.rst is the PyPI long description. PyPI shows the old example, which sends a time with false, until the next release.

Suggestion: add a 3.4.1 entry that matches the siblings, with was_verification_successful and phone_was_verification_successful as the field names, and "There are no code changes."

🤖 Comment by Claude Opus 5.5.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this PR removes the time from the false shipping example. The tests still send a verification time with a false result, which the new reference text tells callers not to do:

  • tests/data/full-transaction-request.json lines 47-49 (shipping: network, a time, and false). The README example mirrors this fixture.
  • tests/test_request.py lines 71-72 and 79-80 (email time with false)
  • tests/test_webservice.py lines 284-285 and 300-301 (email time with false)

The tests pass because the client does not check the pairing. But readers copy request shapes from tests. Suggest removing the time from the false cases, or changing those cases to true, so that the fixture matches the README again.

The same comment is on the Java, .NET, PHP, Ruby, and Node PRs.

🤖 Comment by Claude Opus 5.5.

>>> 'delivery_speed': 'same_day',
>>> },
Expand Down Expand Up @@ -243,7 +242,7 @@ Score, Insights and Factors Example
>>> 'amount': 323.21,
>>> 'is_gift': True,
>>> 'has_gift_message': True
>>> },
>>> },
>>> 'custom_inputs': {
>>> 'section': 'news',
>>> 'num_of_previous_purchases': 19,
Expand Down Expand Up @@ -292,13 +291,13 @@ For synchronous reporting:

>>> from minfraud import Client
>>>
>>> with Client(42, 'licensekey') as client
>>> with Client(42, 'licensekey') as client:
>>> transaction_report = {
>>> 'ip_address': '152.216.7.110',
>>> 'tag': 'chargeback',
>>> 'minfraud_id': '2c69df73-01c0-45a5-b218-ed85f40b17aa',
>>> }
>>> client.report(transaction_report)
>>> }
>>> client.report(transaction_report)

For asynchronous reporting:

Expand All @@ -308,13 +307,13 @@ For asynchronous reporting:
>>> from minfraud import AsyncClient
>>>
>>> async def report():
>>> async with AsyncClient(42, 'licensekey') as client
>>> async with AsyncClient(42, 'licensekey') as client:
>>> transaction_report = {
>>> 'ip_address': '152.216.7.110',
>>> 'tag': 'chargeback',
>>> 'minfraud_id': '2c69df73-01c0-45a5-b218-ed85f40b17aa',
>>> }
>>> await async_client.report(transaction_report)
>>> }
>>> await client.report(transaction_report)
>>>
>>> asyncio.run(report())

Expand Down
Loading