mirror of
https://github.com/janishutz/libreevent.git
synced 2026-09-22 13:15:25 +02:00
fix a possible crash in payrexx integration
This commit is contained in:
1 parent
a6c6a4feb0
commit
0019b25244
1 file changed
+6
-1
@@ -133,8 +133,13 @@ module.exports = ( app, settings ) => {
|
||||
} );
|
||||
|
||||
app.post( '/payments/webhook', bodyParser.json(), async ( req, res ) => {
|
||||
if ( !req.body ) {
|
||||
if ( !req.body.transaction ) {
|
||||
res.status( 400 ).send( 'ERR_REQ_WRONG' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( req.body.transaction.status === 'confirmed' ) {
|
||||
console.error( gatewayReference[ req.body.transaction.referenceId ] );
|
||||
const response = await payrexx.getGateway( gatewayReference[ req.body.transaction.referenceId ] );
|
||||
|
||||
if ( response.status === 200 ) {
|
||||
|
||||
Reference in new issue
Block a user