@@ -51,7 +51,7 @@ const handleWebhook = async (req: Request, res: Response) => {
5151 logger . warn ( 'Woovi webhook missing correlationID' , { body } ) ;
5252 return res . sendStatus ( 400 ) ;
5353 }
54- logger . info ( `> Woovi notification: ${ event } ` , { correlationID } ) ;
54+ logger . info ( `> Woovi notification: ${ event } for ${ correlationID } ` ) ;
5555 const status = parseWooviStatus ( event ) ;
5656 if ( ! status ) {
5757 logger . info ( `Ignoring Woovi event: ${ event } ` ) ;
@@ -81,8 +81,8 @@ const handleWebhook = async (req: Request, res: Response) => {
8181 try {
8282 const orders = await listOrdersByTransaction ( correlationID ) ;
8383 if ( ! orders . length ) {
84- logger . warn ( ' Order not found for Woovi charge' , { correlationID } ) ;
85- return res . sendStatus ( 404 ) ;
84+ logger . warn ( ` Order not found for Woovi charge ${ correlationID } ` ) ;
85+ return res . status ( 200 ) . send ( ) ;
8686 }
8787
8888 await Promise . all ( orders . map ( async ( order ) => {
@@ -108,7 +108,7 @@ const handleWebhook = async (req: Request, res: Response) => {
108108 logger . info ( `Updated order ${ orderId } to ${ status } ` ) ;
109109 } ) ) ;
110110
111- return res . sendStatus ( 200 ) ;
111+ return res . status ( 200 ) . send ( ) ;
112112 } catch ( err : any ) {
113113 logger . error ( 'Woovi webhook error' , err ) ;
114114 return res . status ( 500 ) . send ( {
0 commit comments