Skip to content

Commit 2fc9a75

Browse files
oschwaldclaude
andcommitted
Add clear to the valid values for the tag parameter
Part of STF-190. The `clear` tag retracts a previously reported fraud report tag on a transaction, restoring its label to "unknown" (distinct from the positive `not_fraud` signal). The backend support was added in STF-15; this exposes the new value through the client library. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 929a3c7 commit 2fc9a75

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ History
1212
linking.
1313
* Added ``banquest``, ``fat_zebra``, ``summit_payments``, and ``yaadpay`` to
1414
the ``/payment/processor`` validation.
15+
* Added ``clear`` to the valid values for the ``tag`` parameter on the
16+
Report Transaction API.
1517
* The version is now retrieved from package metadata at runtime using
1618
``importlib.metadata``. This reduces the chance of version inconsistencies
1719
during releases.

src/minfraud/validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def _maxmind_id(s: str | None) -> str:
408408
raise ValueError
409409

410410

411-
_tag = In(["chargeback", "not_fraud", "spam_or_abuse", "suspected_fraud"])
411+
_tag = In(["chargeback", "clear", "not_fraud", "spam_or_abuse", "suspected_fraud"])
412412

413413

414414
def _uuid(s: str) -> str:

tests/test_validation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,13 @@ def test_strings(self) -> None:
470470
self.check_report_str_type(key)
471471

472472
def test_tag(self) -> None:
473-
for good in ("chargeback", "not_fraud", "spam_or_abuse", "suspected_fraud"):
473+
for good in (
474+
"chargeback",
475+
"clear",
476+
"not_fraud",
477+
"spam_or_abuse",
478+
"suspected_fraud",
479+
):
474480
self.check_report({"tag": good})
475481
for bad in ("risky_business", "", None):
476482
self.check_invalid_report({"tag": bad})

0 commit comments

Comments
 (0)