2019-10-02 21:17:00 +00:00
|
|
|
#! /usr/bin/env node
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const ebics = require('../index');
|
2019-11-29 12:12:15 +00:00
|
|
|
const configjs = require('./config.js');
|
2019-10-02 21:17:00 +00:00
|
|
|
|
2019-11-29 12:12:15 +00:00
|
|
|
const client = gClient;
|
2019-12-30 09:36:11 +00:00
|
|
|
const { Orders } = require('../index');
|
|
|
|
|
2019-10-02 21:17:00 +00:00
|
|
|
|
|
|
|
// New keys will be generated and saved in ./keys-test
|
2019-12-30 09:36:11 +00:00
|
|
|
client.send(Orders.INI)
|
2019-10-02 21:17:00 +00:00
|
|
|
.then((resp) => {
|
2019-11-19 13:48:26 +00:00
|
|
|
console.log('Response for INI order %j', resp);
|
2019-10-02 21:17:00 +00:00
|
|
|
return client.send(ebics.Orders.HIA);
|
|
|
|
})
|
|
|
|
.then((resp) => {
|
2019-11-19 13:48:26 +00:00
|
|
|
console.log('Response for HIA order %j', resp);
|
2019-10-02 21:17:00 +00:00
|
|
|
if (resp.technicalCode !== '000000')
|
|
|
|
throw new Error('Something might went wrong');
|
|
|
|
|
|
|
|
console.log('Public keys should be sent to bank now. See examples/bankLetter.js');
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
});
|