optimise speed of webhook for stripe

This commit is contained in:
2023-08-07 17:41:49 +02:00
parent 9b7eb913ae
commit e15057d682

View File

@@ -133,6 +133,7 @@ module.exports = ( app, settings ) => {
return res.status( 400 ).send( 'Webhook Error' );
}
res.status( 200 ).end();
if ( event.type === 'checkout.session.completed' ) {
setTimeout( () => {
if ( waitingClients[ sessionReference[ event.data.object.id ][ 'tok' ] ] ) {
@@ -172,7 +173,5 @@ module.exports = ( app, settings ) => {
console.error( err );
} );
}
res.status( 200 ).end();
} );
};