Skip to content

Commit f4ae236

Browse files
julia-trussJulia Park
andauthored
Update access for attributes for AuthorizationRequestDeclinedEvent (#47)
Co-authored-by: Julia Park <[email protected]>
1 parent d6993ce commit f4ae236

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

unit/models/event.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ def from_json_api(_id, _type, attributes, relationships):
151151

152152

153153
class AuthorizationRequestDeclinedEvent(BaseEvent):
154-
def __init__(self, id: str, created_at: datetime, amount: str, status: str, decline_reason: str,
155-
partial_approval_allowed: str, merchant: Dict[str, str], recurring: str,
154+
def __init__(self, id: str, created_at: datetime, amount: str, status: Optional[str], decline_reason: str,
155+
partial_approval_allowed: str, merchant: Optional[Dict[str, str]], recurring: Optional[str],
156156
tags: Optional[Dict[str, str]], relationships: Optional[Dict[str, Relationship]]):
157157
BaseEvent.__init__(self, id, created_at, tags, relationships)
158158
self.type = 'authorizationRequest.declined'
@@ -167,9 +167,9 @@ def __init__(self, id: str, created_at: datetime, amount: str, status: str, decl
167167
@staticmethod
168168
def from_json_api(_id, _type, attributes, relationships):
169169
return AuthorizationRequestDeclinedEvent(_id, date_utils.to_datetime(attributes["createdAt"]),
170-
attributes["amount"], attributes["status"],
170+
attributes["amount"], attributes.get("status"),
171171
attributes["declineReason"], attributes["partialApprovalAllowed"],
172-
attributes["merchant"], attributes["recurring"],
172+
attributes.get("merchant"), attributes.get("recurring"),
173173
attributes.get("tags"), relationships)
174174

175175

0 commit comments

Comments
 (0)