mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-21 21:52:07 +00:00
add predefined orders
This commit is contained in:
parent
8e9e0df276
commit
c0ec4b8fb7
2
index.js
2
index.js
@ -1,9 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const Client = require('./lib/Client');
|
||||
const Orders = require('./lib/predefinedOrders');
|
||||
const fsKeysStorage = require('./lib/storages/fsKeysStorage');
|
||||
|
||||
module.exports = {
|
||||
Client,
|
||||
Orders,
|
||||
fsKeysStorage,
|
||||
};
|
||||
|
@ -107,22 +107,6 @@ module.exports = class Client {
|
||||
});
|
||||
}
|
||||
|
||||
ini(order) {
|
||||
return this.initialization(order);
|
||||
}
|
||||
|
||||
payment(order) {
|
||||
return this.upload(order);
|
||||
}
|
||||
|
||||
statement(order) {
|
||||
return this.download(order);
|
||||
}
|
||||
|
||||
status(order) {
|
||||
return this.download(order);
|
||||
}
|
||||
|
||||
keys() {
|
||||
const keysString = this.keyStorage.read();
|
||||
|
||||
|
@ -47,7 +47,7 @@ module.exports = (keysStorage, passphrase, algorithm = 'aes-256-cbc') => {
|
||||
return key;
|
||||
});
|
||||
|
||||
storage.save(encrypt(JSON.stringify(keysObject), algo, pass));
|
||||
storage.write(encrypt(JSON.stringify(keysObject), algo, pass));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
8
lib/predefinedOrders/AZV.js
Normal file
8
lib/predefinedOrders/AZV.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'AZV', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
8
lib/predefinedOrders/CCS.js
Normal file
8
lib/predefinedOrders/CCS.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'CCS', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
8
lib/predefinedOrders/CCT.js
Normal file
8
lib/predefinedOrders/CCT.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'CCT', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
8
lib/predefinedOrders/CD1.js
Normal file
8
lib/predefinedOrders/CD1.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'CD1', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
8
lib/predefinedOrders/CDB.js
Normal file
8
lib/predefinedOrders/CDB.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'CDB', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
8
lib/predefinedOrders/CDD.js
Normal file
8
lib/predefinedOrders/CDD.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'CDD', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
8
lib/predefinedOrders/CDS.js
Normal file
8
lib/predefinedOrders/CDS.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'CDS', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
11
lib/predefinedOrders/HAA.js
Normal file
11
lib/predefinedOrders/HAA.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'HAA',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: {},
|
||||
},
|
||||
operation: 'download',
|
||||
};
|
23
lib/predefinedOrders/HAC.js
Normal file
23
lib/predefinedOrders/HAC.js
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const dateRange = (start, end) => {
|
||||
if (start && end)
|
||||
return {
|
||||
DateRange: {
|
||||
Start: start,
|
||||
End: end,
|
||||
},
|
||||
};
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
module.exports = (start = null, end = null) => ({
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'HAC',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: dateRange(start, end),
|
||||
},
|
||||
operation: 'download',
|
||||
});
|
7
lib/predefinedOrders/HIA.js
Normal file
7
lib/predefinedOrders/HIA.js
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'HIA', OrderAttribute: 'DZNNN' },
|
||||
operation: 'ini',
|
||||
};
|
11
lib/predefinedOrders/HKD.js
Normal file
11
lib/predefinedOrders/HKD.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'HKD',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: {},
|
||||
},
|
||||
operation: 'download',
|
||||
};
|
7
lib/predefinedOrders/HPB.js
Normal file
7
lib/predefinedOrders/HPB.js
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'HPB', OrderAttribute: 'DZHNN' },
|
||||
operation: 'ini',
|
||||
};
|
11
lib/predefinedOrders/HPD.js
Normal file
11
lib/predefinedOrders/HPD.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'HPD',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: {},
|
||||
},
|
||||
operation: 'download',
|
||||
};
|
11
lib/predefinedOrders/HTD.js
Normal file
11
lib/predefinedOrders/HTD.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'HTD',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: {},
|
||||
},
|
||||
operation: 'download',
|
||||
};
|
7
lib/predefinedOrders/INI.js
Normal file
7
lib/predefinedOrders/INI.js
Normal file
@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'INI', OrderAttribute: 'DZNNN' },
|
||||
operation: 'ini',
|
||||
};
|
23
lib/predefinedOrders/PTK.js
Normal file
23
lib/predefinedOrders/PTK.js
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const dateRange = (start, end) => {
|
||||
if (start && end)
|
||||
return {
|
||||
DateRange: {
|
||||
Start: start,
|
||||
End: end,
|
||||
},
|
||||
};
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
module.exports = (start = null, end = null) => ({
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'PTK',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: dateRange(start, end),
|
||||
},
|
||||
operation: 'download',
|
||||
});
|
23
lib/predefinedOrders/STA.js
Normal file
23
lib/predefinedOrders/STA.js
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const dateRange = (start, end) => {
|
||||
if (start && end)
|
||||
return {
|
||||
DateRange: {
|
||||
Start: start,
|
||||
End: end,
|
||||
},
|
||||
};
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
module.exports = (start = null, end = null) => ({
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'STA',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: dateRange(start, end),
|
||||
},
|
||||
operation: 'download',
|
||||
});
|
23
lib/predefinedOrders/VMK.js
Normal file
23
lib/predefinedOrders/VMK.js
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
const dateRange = (start, end) => {
|
||||
if (start && end)
|
||||
return {
|
||||
DateRange: {
|
||||
Start: start,
|
||||
End: end,
|
||||
},
|
||||
};
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
module.exports = (start = null, end = null) => ({
|
||||
version: 'h004',
|
||||
orderDetails: {
|
||||
OrderType: 'VMK',
|
||||
OrderAttribute: 'DZHNN',
|
||||
StandardOrderParams: dateRange(start, end),
|
||||
},
|
||||
operation: 'download',
|
||||
});
|
8
lib/predefinedOrders/XE3.js
Normal file
8
lib/predefinedOrders/XE3.js
Normal file
@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = document => ({
|
||||
version: 'h004',
|
||||
orderDetails: { OrderType: 'XE3', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
|
||||
operation: 'upload',
|
||||
document,
|
||||
});
|
47
lib/predefinedOrders/index.js
Normal file
47
lib/predefinedOrders/index.js
Normal file
@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
const INI = require('./INI');
|
||||
const HIA = require('./HIA');
|
||||
const HPB = require('./HPB');
|
||||
|
||||
const AZV = require('./AZV');
|
||||
const CD1 = require('./CD1');
|
||||
const CDB = require('./CDB');
|
||||
const CDD = require('./CDD');
|
||||
const CDS = require('./CDS');
|
||||
const CCT = require('./CCT');
|
||||
const CCS = require('./CCS');
|
||||
const XE3 = require('./XE3');
|
||||
|
||||
const STA = require('./STA');
|
||||
const VMK = require('./VMK');
|
||||
const HAA = require('./HAA');
|
||||
const HTD = require('./HTD');
|
||||
const HPD = require('./HPD');
|
||||
const HKD = require('./HKD');
|
||||
const PTK = require('./PTK');
|
||||
const HAC = require('./HAC');
|
||||
|
||||
module.exports = {
|
||||
INI,
|
||||
HIA,
|
||||
HPB,
|
||||
|
||||
AZV,
|
||||
CD1,
|
||||
CDB,
|
||||
CDD,
|
||||
CDS,
|
||||
CCT,
|
||||
CCS,
|
||||
XE3,
|
||||
|
||||
STA,
|
||||
VMK,
|
||||
HAA,
|
||||
HTD,
|
||||
HPD,
|
||||
HKD,
|
||||
PTK,
|
||||
HAC,
|
||||
};
|
Loading…
Reference in New Issue
Block a user