mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-12-23 12:51:48 +00:00
28 lines
764 B
JavaScript
Executable File
28 lines
764 B
JavaScript
Executable File
#! /usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const ebics = require('../index');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
const os = require('os');
|
|
|
|
const config = require('./loadConfig')();
|
|
const client = require('./getClient')(config);
|
|
|
|
const bankName = gConfig.bankName;
|
|
const languageCode = gConfig.languageCode;
|
|
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);
|
|
})
|
|
.catch((err) => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|