@@ -151,8 +151,8 @@ def from_json_api(_id, _type, attributes, relationships):
151151
152152
153153class 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