Repository navigation
STF-2488: Fix README examples #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| 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 | ||
|
|
@@ -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, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR changes the guidance for the verification inputs, but
There are two more reasons to add an entry here:
Suggestion: add a 🤖 Comment by Claude Opus 5.5.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this PR removes the time from the
The tests pass because the client does not check the pairing. But readers copy request shapes from tests. Suggest removing the time from the The same comment is on the Java, .NET, PHP, Ruby, and Node PRs. 🤖 Comment by Claude Opus 5.5. |
||
| >>> 'delivery_speed': 'same_day', | ||
| >>> }, | ||
|
|
@@ -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, | ||
|
|
@@ -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: | ||
|
|
||
|
|
@@ -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()) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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()andreport()raisePermissionRequiredErrorwhen the service returnsPERMISSION_REQUIRED(_exception_for_web_service_errorinsrc/minfraud/webservice.py). The list does not name it. Also,src/minfraud/__init__.pydoes not export it, sominfraud.PermissionRequiredErrorraisesAttributeError, and onlyminfraud.errors.PermissionRequiredErrorworks. 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
PermissionRequiredErrorfromminfraud/__init__.pyand add a bullet forminfraud.PermissionRequiredErrorhere and in the:raises:lines. If you do not want to change the exports in a docs PR, add a bullet forminfraud.errors.PermissionRequiredError.🤖 Comment by Claude Opus 5.5.