diff --git a/src/qbirr/__init__.py b/src/qbirr/__init__.py index 55fa30f..0f44346 100644 --- a/src/qbirr/__init__.py +++ b/src/qbirr/__init__.py @@ -64,6 +64,9 @@ class VerifyResult: #: a ``verified=True`` with ``"none"`` means the reference exists and the #: amount matches, but says nothing about who received the money. receiver_source: Optional[str] = None + #: The same failure written for the CUSTOMER. Show this to the payer; ``error`` + #: is the merchant-facing version and may name your own accounts. + payer_error: Optional[str] = None #: True only on sandbox (``TEST-...``) responses. sandbox: bool = False @@ -81,6 +84,7 @@ class VerifyResult: retryable=bool(data.get("retryable")), code=data.get("code") or None, receiver_source=data.get("receiver_source") or None, + payer_error=data.get("payer_error") or None, sandbox=bool(data.get("sandbox")), ) @@ -124,6 +128,8 @@ class Qbirr: amount: float, receiver_name: str, receiver_account: Optional[str] = None, + tolerance: Optional[str] = None, + max_age_hours: Optional[int] = None, ) -> VerifyResult: """ Verify a single transaction. @@ -142,6 +148,10 @@ class Qbirr: } if receiver_account: body["receiver_account"] = receiver_account + if tolerance: + body["tolerance"] = tolerance + if max_age_hours is not None: + body["max_age_hours"] = int(max_age_hours) data = self._request("POST", "/api/v1/verify", json=body) return VerifyResult.from_payload(data) @@ -155,6 +165,8 @@ class Qbirr: filename: str = "upload.pdf", content_type: str = "application/pdf", receiver_account: Optional[str] = None, + tolerance: Optional[str] = None, + max_age_hours: Optional[int] = None, ) -> VerifyResult: """ Verify by uploading a receipt file (PDF, PNG, or JPEG).