2019-10-02 21:27:23 +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:27:23 +00:00
|
|
|
|
2019-11-29 12:12:15 +00:00
|
|
|
const client = gClient;
|
2019-10-02 21:27:23 +00:00
|
|
|
|
2019-10-02 22:07:52 +00:00
|
|
|
// The bank keys must have been already saved
|
2019-10-02 21:27:23 +00:00
|
|
|
client.send(ebics.Orders.HTD)
|
|
|
|
.then((resp) => {
|
2019-11-19 13:48:26 +00:00
|
|
|
console.log('Response for HTD order %j', resp);
|
2019-10-02 21:27:23 +00:00
|
|
|
if (resp.technicalCode !== '000000')
|
|
|
|
throw new Error('Something went wrong');
|
|
|
|
|
|
|
|
const data = Buffer.from(resp.orderData);
|
|
|
|
console.log(data.toString('utf8'));
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
});
|