payments fully integrated

This commit is contained in:
2023-08-06 20:35:50 +02:00
parent 32ed36b93f
commit 5cbf624284
6 changed files with 129 additions and 61 deletions

View File

@@ -8,6 +8,7 @@
*/
const path = require( 'path' );
const fs = require( 'fs' );
// const ph = require( './paymentHandler.js' );
// const paymentHandler = new ph();
@@ -15,4 +16,13 @@ module.exports = ( app, settings ) => {
app.get( '/payments/canceled', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../../ui/en/payments/canceled.html' ) );
} );
app.get( '/tickets/tickets.pdf', ( req, res ) => {
if ( req.session.id ) {
fs.readFile( path.join( __dirname + '/../tickets/store/' + req.session.id + '.pdf' ), ( error, data ) => {
if ( error ) res.sendFile( path.join( __dirname + '/../../ui/en/errors/404.html' ) );
else res.send( data );
} );
}
} );
};