mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
load payment gateway settings
This commit is contained in:
@@ -41,22 +41,32 @@ class PluginManager {
|
||||
|
||||
loadPaymentGatewaySettings () {
|
||||
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, optionsBuffer ) => {
|
||||
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, configBuffer ) => {
|
||||
if ( err ) reject( err );
|
||||
let options, config;
|
||||
try {
|
||||
options = JSON.parse( optionsBuffer );
|
||||
config = JSON.parse( configBuffer );
|
||||
} catch ( err ) {
|
||||
reject( err );
|
||||
return;
|
||||
}
|
||||
let f = options;
|
||||
for ( let s in f ) {
|
||||
f[ s ][ 'value' ] = config[ s ];
|
||||
}
|
||||
resolve( f );
|
||||
resolve( { 'data': f, 'gateway': this.paymentGateway } );
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
||||
savePaymentGatewaySettings () {
|
||||
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
saveSettings ( plugin, settings ) {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"APIKey": {
|
||||
"display": "API key",
|
||||
"id": "APIKey",
|
||||
"tooltip":"This is the secret key API key you can get from the stripe dashboard. Please make a test purchase (FREE) before you go live!",
|
||||
"value": "",
|
||||
"type": "text"
|
||||
},
|
||||
"instance": {
|
||||
"display": "Instance",
|
||||
"id": "instance",
|
||||
"tooltip":"Please specify the instance name you used to create the payrexx account. (e.g. libreevent)",
|
||||
"value": "",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"APIKey": {
|
||||
"display": "API key",
|
||||
"id": "APIKey",
|
||||
"tooltip":"This is the secret key API key you can get from the stripe dashboard. Please make a test purchase (FREE) before you go live!",
|
||||
"value": "",
|
||||
"type": "text"
|
||||
},
|
||||
"endpointSecret": {
|
||||
"display": "Webhook endpoint secret",
|
||||
"id": "endpointSecret",
|
||||
"tooltip":"Please specify the endpoint secret that you can get from the stripe dashboard when creating the webhook integration",
|
||||
"value": "",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user