From d8d85e5ceb2a2ab187eae4b3a1b32dbac8977db9 Mon Sep 17 00:00:00 2001 From: Julia Park Date: Thu, 17 Jul 2025 18:57:03 -0400 Subject: [PATCH] Update access for attributes for AuthorizationRequestDeclinedEvent --- unit/models/event.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unit/models/event.py b/unit/models/event.py index 17d421f..a683947 100644 --- a/unit/models/event.py +++ b/unit/models/event.py @@ -151,8 +151,8 @@ def from_json_api(_id, _type, attributes, relationships): class AuthorizationRequestDeclinedEvent(BaseEvent): - def __init__(self, id: str, created_at: datetime, amount: str, status: str, decline_reason: str, - partial_approval_allowed: str, merchant: Dict[str, str], recurring: str, + def __init__(self, id: str, created_at: datetime, amount: str, status: Optional[str], decline_reason: str, + partial_approval_allowed: str, merchant: Optional[Dict[str, str]], recurring: Optional[str], tags: Optional[Dict[str, str]], relationships: Optional[Dict[str, Relationship]]): BaseEvent.__init__(self, id, created_at, tags, relationships) self.type = 'authorizationRequest.declined' @@ -167,9 +167,9 @@ def __init__(self, id: str, created_at: datetime, amount: str, status: str, decl @staticmethod def from_json_api(_id, _type, attributes, relationships): return AuthorizationRequestDeclinedEvent(_id, date_utils.to_datetime(attributes["createdAt"]), - attributes["amount"], attributes["status"], + attributes["amount"], attributes.get("status"), attributes["declineReason"], attributes["partialApprovalAllowed"], - attributes["merchant"], attributes["recurring"], + attributes.get("merchant"), attributes.get("recurring"), attributes.get("tags"), relationships)