mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-21 21:52:07 +00:00
fix(examples): bankLetter setup
This commit is contained in:
parent
3d4c94dff8
commit
fb464078dc
@ -6,16 +6,17 @@ const ebics = require('../index');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const configjs = require('./config.js');
|
||||
|
||||
const client = gClient;
|
||||
const config = require('./loadConfig')();
|
||||
const client = require('./getClient')(config);
|
||||
|
||||
const bankName = gConfig.bankName;
|
||||
const languageCode = gConfig.languageCode;
|
||||
const template = fs.readFileSync('../templates/ini_'+languageCode+'.hbs').toString();
|
||||
const letter = new ebics.BankLetter({ client, bankName, template });
|
||||
const template = fs.readFileSync('../templates/ini_'+config.languageCode+'.hbs', { encoding: 'utf8 '});
|
||||
const bankLetterFile = path.join(os.homedir(), 'bankLetter_'+languageCode+'.html');
|
||||
|
||||
const letter = new ebics.BankLetter({ client, bankName, template });
|
||||
|
||||
letter.serialize(bankLetterFile)
|
||||
.then(() => {
|
||||
console.log('Send your bank the letter (%s)', bankLetterFile);
|
||||
|
Loading…
Reference in New Issue
Block a user