prepare payment gateway settings

This commit is contained in:
2023-08-29 17:27:45 +02:00
parent 6ac4fd9cda
commit 6a3127a35a
10 changed files with 57 additions and 21 deletions

View File

@@ -1,8 +1,10 @@
# Account view:
- Load all orders of customer from db when selecting tickets and save to memory to check if ticket count has been exceeded or not. - Load all orders of customer from db when selecting tickets and save to memory to check if ticket count has been exceeded or not.
- load all available start page templates with dir crawler
- fix ticket counting - fix ticket counting
- Seat numbering!!
- Update files to import when deploying for included json files instead of secret.json files - Update files to import when deploying for included json files instead of secret.json files
@@ -11,10 +13,6 @@
- Other optimization for seat plan editor - Other optimization for seat plan editor
- Seat numbering!!
- FUTURE: Implement Permission system - FUTURE: Implement Permission system
- FUTURE: Add Admin profile (page to change account settings per person like changing pwd) - FUTURE: Add Admin profile (page to change account settings per person like changing pwd)
- FUTURE add multi-language support - FUTURE add multi-language support

View File

@@ -86,9 +86,10 @@ let file = path.join( __dirname + '/webapp/main/dist/index.html' );
console.log( '[ Server ] loading backend components' ); console.log( '[ Server ] loading backend components' );
if ( settings.init ) { if ( settings.init ) {
require( './backend/helperRoutes.js' )( app, settings ); // Helper routes
require( './admin/adminRoutes.js' )( app, settings ); // admin routes require( './admin/adminRoutes.js' )( app, settings ); // admin routes
require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes
require( './backend/userAPIRoutes.js' )( app, settings ); // admin api routes require( './backend/userAPIRoutes.js' )( app, settings ); // user api routes
require( './backend/userRoutes.js' )( app, settings ); // user routes require( './backend/userRoutes.js' )( app, settings ); // user routes
require( './backend/payments/paymentRoutes.js' )( app, settings ); // payment routes require( './backend/payments/paymentRoutes.js' )( app, settings ); // payment routes
require( './backend/plugins/pluginLoader.js' )( app, settings ); // plugin loader require( './backend/plugins/pluginLoader.js' )( app, settings ); // plugin loader

View File

@@ -0,0 +1,20 @@
const path = require( 'path' );
module.exports = ( app, settings ) => {
app.get( '/eventAssets/:image', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../assets/events/' + req.params.image ) );
} );
app.get( '/otherAssets/:image', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../assets/' + req.params.image ) );
} );
app.get( '/supportFiles/:file', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../ui/home/templates/' + settings.startPage + '/supportFiles/' + req.params.file ) );
} );
// TODO: Decide if removed or not
app.get( '/startPage/helperFunction', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../ui/home/helper.js' ) );
} );
};

View File

@@ -33,6 +33,7 @@ class PluginManager {
getPluginDetails ( plugin ) { getPluginDetails ( plugin ) {
return new Promise( ( resolve, reject ) => { return new Promise( ( resolve, reject ) => {
fs.readFile( path.join( __dirname + '/others/' + plugin + '/plugin.json' ), ( err, file ) => { fs.readFile( path.join( __dirname + '/others/' + plugin + '/plugin.json' ), ( err, file ) => {
if ( err ) reject( err );
resolve( file ); resolve( file );
} ); } );
} ); } );
@@ -41,7 +42,9 @@ class PluginManager {
loadPaymentGatewaySettings () { loadPaymentGatewaySettings () {
return new Promise( ( resolve, reject ) => { return new Promise( ( resolve, reject ) => {
fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/configOptions.json' ), ( err, options ) => { fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/configOptions.json' ), ( err, options ) => {
if ( err ) reject( err );
fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/config.payments.json' ), ( err, config ) => { fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/config.payments.json' ), ( err, config ) => {
if ( err ) reject( err );
let f = options; let f = options;
for ( let s in f ) { for ( let s in f ) {
f[ s ][ 'value' ] = config[ s ]; f[ s ][ 'value' ] = config[ s ];
@@ -52,6 +55,10 @@ class PluginManager {
} ); } );
} }
savePaymentGatewaySettings () {
}
saveSettings ( plugin, settings ) { saveSettings ( plugin, settings ) {
} }

View File

@@ -11,7 +11,6 @@ const posth = require( './api/postHandler.js' );
const geth = require( './api/getHandler.js' ); const geth = require( './api/getHandler.js' );
const postHandler = new posth(); const postHandler = new posth();
const getHandler = new geth(); const getHandler = new geth();
const path = require( 'path' );
const bodyParser = require( 'body-parser' ); const bodyParser = require( 'body-parser' );
module.exports = ( app, settings ) => { module.exports = ( app, settings ) => {
@@ -39,12 +38,4 @@ module.exports = ( app, settings ) => {
res.status( error.code ).send( error.message ); res.status( error.code ).send( error.message );
} ); } );
} ); } );
app.get( '/eventAssets/:image', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../assets/events/' + req.params.image ) );
} );
app.get( '/otherAssets/:image', ( req, res ) => {
res.sendFile( path.join( __dirname + '/../assets/' + req.params.image ) );
} );
}; };

View File

@@ -11,5 +11,6 @@
"maxTickets":10, "maxTickets":10,
"currency":"CHF", "currency":"CHF",
"gcInterval":300, "gcInterval":300,
"ticketTimeout":900 "ticketTimeout":900,
"startPage": "default"
} }

View File

@@ -3,9 +3,13 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <link rel="stylesheet" href="/supportFiles/style.css">
<title>libreevent</title>
</head> </head>
<body> <body>
<h1>Test</h1> <nav></nav>
<img src="/otherAssets/logo.png" alt="libreevent logo" class="logo">
<h1>Welcome to libreevent!</h1>
<p>No start page has been configured yet! Please configure one either by using the configurator in the settings or by uploading your own HTML page to the correct folder as detailed <a href="https://libreevent.janishutz.com/docs/admin-panel/pages">here</a></p>
</body> </body>
</html> </html>

View File

View File

@@ -3,9 +3,11 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>{{ pageName }}</title>
</head> </head>
<body> <body>
<div>
</div>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,12 @@
/*
* libreevent - style.css
*
* Created by Janis Hutz 08/29/2023, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
.logo {
height: 50vh;
}