mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
optimise speed of webhook for stripe
This commit is contained in:
@@ -133,6 +133,7 @@ module.exports = ( app, settings ) => {
|
|||||||
return res.status( 400 ).send( 'Webhook Error' );
|
return res.status( 400 ).send( 'Webhook Error' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
res.status( 200 ).end();
|
||||||
if ( event.type === 'checkout.session.completed' ) {
|
if ( event.type === 'checkout.session.completed' ) {
|
||||||
setTimeout( () => {
|
setTimeout( () => {
|
||||||
if ( waitingClients[ sessionReference[ event.data.object.id ][ 'tok' ] ] ) {
|
if ( waitingClients[ sessionReference[ event.data.object.id ][ 'tok' ] ] ) {
|
||||||
@@ -172,7 +173,5 @@ module.exports = ( app, settings ) => {
|
|||||||
console.error( err );
|
console.error( err );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status( 200 ).end();
|
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user