mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2025-08-13 19:35:34 +00:00
Add additional bank configuration items
For prettier generation of bank letters and other bits used in examples: Expand the bank config to include: * "bankFullName" used in the INI letter's which are sent to the bank. * "bankShortName" used in the filename for the generated letters and in other places if needed. * "languageCode" used for determining which template to use for the bank (currently "en" and "de" are supported). * "storageLocation" can be used to specify a local or network path where to store downloaded files. * In bankLetter.js: Use the current script folder as output for the bank's letter in HTML format instead of the user/os homedir folder. Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
This commit is contained in:
@@ -9,10 +9,9 @@ const os = require('os');
|
||||
|
||||
const config = require('./loadConfig')();
|
||||
const client = require('./getClient')(config);
|
||||
const bankName = config.bankName;
|
||||
const languageCode = config.languageCode;
|
||||
const template = fs.readFileSync('../templates/ini_'+config.languageCode+'.hbs', { encoding: 'utf8 '});
|
||||
const bankLetterFile = path.join(os.homedir(), 'bankLetter_'+languageCode+'.html');
|
||||
const bankName = client.bankName;
|
||||
const template = fs.readFileSync("../templates/ini_"+client.languageCode+".hbs", { encoding: 'utf8'});
|
||||
const bankLetterFile = path.join("./", "bankLetter_"+client.bankShortName+"_"+client.languageCode+".html");
|
||||
|
||||
const letter = new ebics.BankLetter({ client, bankName, template });
|
||||
|
||||
|
@@ -5,6 +5,8 @@
|
||||
"hostId": "MyHostIdTest",
|
||||
"passphrase": "MyPasswordTest",
|
||||
"keyStoragePath": "./keys-test",
|
||||
"bankName":"Test Bank",
|
||||
"languageCode":"en"
|
||||
"bankName":"Test Bank Full Name",
|
||||
"bankShortName":"TESTBANKSHORT",
|
||||
"languageCode":"en",
|
||||
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Test\\"
|
||||
}
|
||||
|
@@ -5,6 +5,8 @@
|
||||
"hostId": "MyHostIdProduction",
|
||||
"passphrase": "MyPasswordProduction",
|
||||
"keyStoragePath": "./keys-prod",
|
||||
"bankName":"Production Bank",
|
||||
"languageCode":"en"
|
||||
"bankName":"Production Bank Full Name",
|
||||
"bankShortName":"PRODBANKSHORT",
|
||||
"languageCode":"en",
|
||||
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Production\\"
|
||||
}
|
12
examples/config/config.production.testbank.testentity.json
Normal file
12
examples/config/config.production.testbank.testentity.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"url": "https://ebics.server",
|
||||
"partnerId": "EBICS ParnerID Production",
|
||||
"userId": "MyUserIdProduction",
|
||||
"hostId": "MyHostIdProduction",
|
||||
"passphrase": "MyPasswordProduction",
|
||||
"keyStoragePath": "./keys-prod",
|
||||
"bankName":"Production Bank Full Name",
|
||||
"bankShortName":"PRODBANKSHORT",
|
||||
"languageCode":"en",
|
||||
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Production\\"
|
||||
}
|
Reference in New Issue
Block a user