// The bank keys must have been already saved client.send(Orders.HKD) .then((resp) => { console.log('Response for HKD order %j', resp); 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); });
// New keys will be generated and saved in ./keys-test client.send(Orders.INI) .then((resp) => { console.log('Response for INI order %j', resp); return client.send(ebics.Orders.HIA); }) .then((resp) => { console.log('Response for HIA order %j', resp); 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); });
// Client keys must be already generated and send by letter. // The bank should have enabled the user client.send(Orders.HPB) .then((resp) => { console.log('Response for HPB order %j', resp); if (resp.technicalCode !== '000000') throw new Error('Something went wrong'); console.log('Received bank keys: %j', resp.bankKeys); return client.setBankKeys(resp.bankKeys); }) .catch((err) => { console.error(err); process.exit(1); });
// The bank keys must have been already saved client.send(Orders.HTD) .then((resp) => { console.log('Response for HTD order %j', resp); 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); });
// The bank keys must have been already saved client.send(Orders.DKI(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' .then((resp) => { console.log('Response for DKI order %j', resp); if (resp.technicalCode !== '000000') throw new Error('Something went wrong'); // Processing of the Exchange Rate file should go here, ideally after saving it to disk const data = Buffer.from(resp.orderData); console.log(data.toString('utf8')); }) .catch((err) => { console.error(err); process.exit(1); });
// The bank keys must have been already saved client.send(Orders.C52(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' .then((resp) => { console.log('Response for C52 order %j', resp); if (resp.technicalCode !== '000000') throw new Error('Something went wrong'); // Parsing and processing the CAMT052 file should happen somewhere here, ideally after saving it to disk const data = Buffer.from(resp.orderData); console.log(data.toString('utf8')); }) .catch((err) => { console.error(err); process.exit(1); });
// The bank keys must have been already saved client.send(Orders.STA(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' .then((resp) => { console.log('Response for STA order %j', resp); if (resp.technicalCode !== '000000') throw new Error('Something went wrong'); // Parsing and processing the MT940 file should happen somewhere here, ideally after saving it to disk const data = Buffer.from(resp.orderData); console.log(data.toString('utf8')); }) .catch((err) => { console.error(err); process.exit(1); });
// The bank keys must have been already saved client.send(Orders.VMK(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' .then((resp) => { console.log('Response for VMK order %j', resp); if (resp.technicalCode !== '000000') throw new Error('Something went wrong'); // Parsing and processing the MT942 file should happen somewhere here, ideally after saving it to disk const data = Buffer.from(resp.orderData); console.log(data.toString('utf8')); }) .catch((err) => { console.error(err); process.exit(1); });
// The bank keys must have been already saved client.send(Orders.C53(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' .then((resp) => { console.log('Response for C53 order %j', resp); if (resp.technicalCode !== '000000') throw new Error('Something went wrong'); // Parsing and processing the CAMT053 file should happen somewhere here, ideally after saving it to disk const data = Buffer.from(resp.orderData); console.log(data.toString('utf8')); }) .catch((err) => { console.error(err); process.exit(1); });