From 4b0bf0eba63f3eaa8986d8974ca4c0e647b9029f Mon Sep 17 00:00:00 2001 From: nanov Date: Mon, 30 Dec 2019 11:36:11 +0200 Subject: [PATCH] fix(examples): orders ref --- examples/initialize.js | 4 +++- examples/save-bank-keys.js | 3 ++- examples/send-c52-order.js | 3 ++- examples/send-c53-order.js | 3 ++- examples/send-dki-order.js | 3 ++- examples/send-hkd-order.js | 3 ++- examples/send-htd-order.js | 3 ++- examples/send-sta-order.js | 3 ++- examples/send-vmk-order.js | 4 +++- examples/send-xg1-order.js | 3 ++- 10 files changed, 22 insertions(+), 10 deletions(-) diff --git a/examples/initialize.js b/examples/initialize.js index 571c8a6..329eeda 100755 --- a/examples/initialize.js +++ b/examples/initialize.js @@ -6,9 +6,11 @@ const ebics = require('../index'); const configjs = require('./config.js'); const client = gClient; +const { Orders } = require('../index'); + // New keys will be generated and saved in ./keys-test -client.send(ebics.Orders.INI) +client.send(Orders.INI) .then((resp) => { console.log('Response for INI order %j', resp); return client.send(ebics.Orders.HIA); diff --git a/examples/save-bank-keys.js b/examples/save-bank-keys.js index 7ac3ee1..de7f20b 100644 --- a/examples/save-bank-keys.js +++ b/examples/save-bank-keys.js @@ -3,10 +3,11 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // Client keys must be already generated and send by letter. // The bank should have enabled the user -client.send(ebics.Orders.HPB) +client.send(Orders.HPB) .then((resp) => { console.log('Response for HPB order %j', resp); if (resp.technicalCode !== '000000') diff --git a/examples/send-c52-order.js b/examples/send-c52-order.js index 862379d..5a20d12 100644 --- a/examples/send-c52-order.js +++ b/examples/send-c52-order.js @@ -3,9 +3,10 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved -client.send(ebics.Orders.C52(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' +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') diff --git a/examples/send-c53-order.js b/examples/send-c53-order.js index a366fb2..41cb5d9 100644 --- a/examples/send-c53-order.js +++ b/examples/send-c53-order.js @@ -3,9 +3,10 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved -client.send(ebics.Orders.C53(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' +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') diff --git a/examples/send-dki-order.js b/examples/send-dki-order.js index 7796926..b90d7ae 100644 --- a/examples/send-dki-order.js +++ b/examples/send-dki-order.js @@ -3,9 +3,10 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved -client.send(ebics.Orders.DKI(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' +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') diff --git a/examples/send-hkd-order.js b/examples/send-hkd-order.js index 3e8eafc..25e6d4c 100644 --- a/examples/send-hkd-order.js +++ b/examples/send-hkd-order.js @@ -3,9 +3,10 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved -client.send(ebics.Orders.HKD) +client.send(Orders.HKD) .then((resp) => { console.log('Response for HKD order %j', resp); if (resp.technicalCode !== '000000') diff --git a/examples/send-htd-order.js b/examples/send-htd-order.js index 4eb8488..30f218f 100644 --- a/examples/send-htd-order.js +++ b/examples/send-htd-order.js @@ -3,9 +3,10 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved -client.send(ebics.Orders.HTD) +client.send(Orders.HTD) .then((resp) => { console.log('Response for HTD order %j', resp); if (resp.technicalCode !== '000000') diff --git a/examples/send-sta-order.js b/examples/send-sta-order.js index 6dd19db..eedc3cc 100644 --- a/examples/send-sta-order.js +++ b/examples/send-sta-order.js @@ -3,9 +3,10 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved -client.send(ebics.Orders.STA(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' +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') diff --git a/examples/send-vmk-order.js b/examples/send-vmk-order.js index d35e818..d010d3f 100644 --- a/examples/send-vmk-order.js +++ b/examples/send-vmk-order.js @@ -3,9 +3,11 @@ 'use strict'; const client = require('./getClient')(); +const { Orders } = require('../index'); + // The bank keys must have been already saved -client.send(ebics.Orders.VMK(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD' +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') diff --git a/examples/send-xg1-order.js b/examples/send-xg1-order.js index 4b93c97..a96b9d2 100644 --- a/examples/send-xg1-order.js +++ b/examples/send-xg1-order.js @@ -6,11 +6,12 @@ const ebics = require('../index'); const fs = require('fs'); const client = require('./getClient')(); +const { Orders } = require('../index'); // The bank keys must have been already saved const paymentFile = fs.readFileSync('mytestfile.xml').toString(); -client.send(ebics.Orders.XG1(paymentFile)) +client.send(Orders.XG1(paymentFile)) .then((resp) => { console.log('Response for XG1 order %j', resp); })