mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
fix a possible crash in payrexx integration
This commit is contained in:
@@ -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