mirror of
				https://github.com/node-ebics/node-ebics-client.git
				synced 2025-10-31 03:27:05 +00:00 
			
		
		
		
	In order to more easily manage testing of various order types as well as production, development etc. environments, externalize this config values. Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
		
			
				
	
	
		
			27 lines
		
	
	
		
			721 B
		
	
	
	
		
			JavaScript
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			721 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 configjs = require('./config.js');
 | |
| 
 | |
| const client = gClient;
 | |
| 
 | |
| 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 bankLetterFile = path.join(os.homedir(), 'bankLetter_'+languageCode+'.html');
 | |
| 
 | |
| letter.serialize(bankLetterFile)
 | |
| 	.then(() => {
 | |
| 		console.log('Send your bank the letter (%s)', bankLetterFile);
 | |
| 	})
 | |
| 	.catch((err) => {
 | |
| 		console.error(err);
 | |
| 		process.exit(1);
 | |
| 	});
 |