@@ -761,6 +761,48 @@ def from_json_api(_id, _type, attributes, relationships):
761761 return DisputeStatusChangedEvent (_id , date_utils .to_datetime (attributes ["createdAt" ]), attributes ["previousStatus" ],
762762 attributes ["newStatus" ], attributes .get ("tags" ), relationships )
763763
764+ class ReceivedPaymentCreatedEvent (BaseEvent ):
765+ def __init__ (self , id : str , created_at : datetime ,
766+ status : str ,
767+ type : str ,
768+ amount : int ,
769+ completion_date : date ,
770+ company_name : str ,
771+ counterparty_routing_number : str ,
772+ description : str ,
773+ trace_number : str ,
774+ sec_code : str ,
775+ return_cutoff_time : Optional [datetime ],
776+ can_be_reprocessed : Optional [bool ],
777+ addenda : Optional [str ],
778+ tags : Optional [Dict [str , str ]],
779+ relationships : Optional [Dict [str , Relationship ]]):
780+ BaseEvent .__init__ (self , id , created_at , tags , relationships )
781+ self .attributes ["status" ] = status
782+ self .attributes ["type" ] = type
783+ self .attributes ["amount" ] = amount
784+ self .attributes ["completionDate" ] = completion_date
785+ self .attributes ["companyName" ] = company_name
786+ self .attributes ["counterpartyRoutingNumber" ] = counterparty_routing_number
787+ self .attributes ["description" ] = description
788+ self .attributes ["traceNumber" ] = trace_number
789+ self .attributes ["secCode" ] = sec_code
790+ self .attributes ["returnCutoffTime" ] = return_cutoff_time
791+ self .attributes ["canBeReprocessed" ] = can_be_reprocessed
792+ self .attributes ["addenda" ] = addenda
793+
794+ self .type = 'receivedPayment.created'
795+
796+ @staticmethod
797+ def from_json_api (_id , _type , attributes , relationships ):
798+ return ReceivedPaymentCreatedEvent (_id , date_utils .to_datetime (attributes ["createdAt" ]),
799+ attributes ["status" ], attributes ["type" ], attributes ["amount" ],
800+ attributes ["completionDate" ], attributes ["companyName" ],
801+ attributes ["counterpartyRoutingNumber" ], attributes ["description" ],
802+ attributes ["traceNumber" ], attributes ["secCode" ],
803+ attributes .get ("returnCutoffTime" ), attributes .get ("canBeReprocessed" ),
804+ attributes .get ("addenda" ), attributes .get ("tags" ), relationships )
805+
764806
765807EventDTO = Union [
766808 AccountClosedEvent , AccountFrozenEvent , ApplicationDeniedEvent , ApplicationAwaitingDocumentsEvent ,
@@ -778,7 +820,7 @@ def from_json_api(_id, _type, attributes, relationships):
778820 CustomerCreatedEvent , PaymentClearingEvent , PaymentSentEvent , PaymentReturnedEvent ,
779821 StatementsCreatedEvent , TransactionCreatedEvent , AccountReopenedEvent , RawUnitObject ,
780822 StopPaymentCreatedEvent , StopPaymentPaymentStoppedEvent , StopPaymentDisabledEvent ,
781- DisputeCreatedEvent , DisputeStatusChangedEvent ,
823+ DisputeCreatedEvent , DisputeStatusChangedEvent , ReceivedPaymentCreatedEvent
782824]
783825
784826
0 commit comments