From fb464078dc082b795480ced62f4fb1399b22ab04 Mon Sep 17 00:00:00 2001 From: nanov Date: Mon, 30 Dec 2019 11:10:48 +0200 Subject: [PATCH] fix(examples): bankLetter setup --- examples/bankLetter.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/bankLetter.js b/examples/bankLetter.js index e2a953d..3ec8d47 100755 --- a/examples/bankLetter.js +++ b/examples/bankLetter.js @@ -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);