64 Commits
push ... v0.2.1

Author SHA1 Message Date
nanov
d0c6d76431 bump version 2021-03-30 14:51:20 +03:00
nanov
936e103c3f fix: crypto check 2021-03-30 14:50:32 +03:00
nanov
9ee2be97c4 chore: changelog 2021-03-30 14:27:22 +03:00
nanov
f9fb6d3dc9 chore: cleanup & bump 2021-03-30 14:26:35 +03:00
nanov
2d580c0d44 merge 2021-03-30 14:24:07 +03:00
nanov
5c8139e1bc bump version 2021-03-30 14:23:52 +03:00
Dimitar Nanov
cecaa782c9 Merge pull request #56 from node-ebics/dependabot/npm_and_yarn/y18n-4.0.1
chore(deps): bump y18n from 4.0.0 to 4.0.1
2021-03-30 14:22:37 +03:00
Dimitar Nanov
3eb997e3df Merge pull request #53 from Herrie82/herrie/additionalConfigItems
Add additional bank configuration items
2021-03-30 14:22:14 +03:00
nanov
2b35ed072a fix: crypto additional byte check 2021-03-30 14:20:25 +03:00
Herrie
9ef50081ca Merge branch 'master' into herrie/additionalConfigItems 2021-03-30 11:03:35 +02:00
Herman van Hazendonk
d192e61d29 Add additional bank configuration items
For prettier generation of bank letters and other bits used in examples:

Expand the bank config to include:

* "bankFullName" used in the INI letter's which are sent to the bank.
* "bankShortName" used in the filename for the generated letters and in other places if needed.
* "languageCode" used for determining which template to use for the bank (currently "en" and "de" are supported).
* "storageLocation" can be used to specify a local or network path where to store downloaded files.

* In bankLetter.js: Use the current script folder as output for the bank's letter in HTML format instead of the user/os homedir folder.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-30 11:02:36 +02:00
dependabot[bot]
0e56947b07 chore(deps): bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-30 07:50:28 +00:00
nanov
e6420244dc chore: update deps 2021-03-30 10:36:45 +03:00
Dimitar Nanov
c8220f6d45 Merge pull request #46 from node-ebics/dependabot/npm_and_yarn/xmldom-0.5.0
chore(deps): bump xmldom from 0.3.0 to 0.5.0
2021-03-30 10:29:44 +03:00
nanov
f6dfc73ff2 chore: add https://github.com/Herrie82 to contributors 2021-03-30 09:21:34 +03:00
nanov
6921f8d503 chore: cleanup crypto sign fucntion 2021-03-30 09:20:21 +03:00
Dimitar Nanov
043caedc94 Merge pull request #50 from Herrie82/master
Cryto.js: Nasty workaround for incorrect signature (257 vs 256) and h…
2021-03-30 08:58:35 +03:00
Dimitar Nanov
13f6d03cb2 Merge pull request #51 from Herrie82/herrie/multibank
Examples: Improve config implementation for multibank
2021-03-30 08:53:35 +03:00
Dimitar Nanov
546d371193 Merge pull request #55 from Herrie82/herrie/jpm
README.md: Add J.P. Morgan to tested banks
2021-03-30 08:52:02 +03:00
Herman van Hazendonk
374560b14a README.md: Add J.P. Morgan to tested banks
J.P. Morgan has been tested for their global EBICS channel as well and confirmed to be working.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-29 14:53:27 +02:00
Herman van Hazendonk
500737dbc7 Remove not needed else statement
Cleanup as per comment
2021-03-29 09:12:23 +02:00
Dimitar Nanov
57a15f0722 Merge pull request #49 from Herrie82/herrie/gazprumm
Add support for Bank GPB AO (Gazprombank Russia)
2021-03-29 09:13:59 +03:00
Dimitar Nanov
bff972f354 Merge pull request #48 from Herrie82/herrie/zipped-camt
Add sample code for zipped CAMT statements
2021-03-29 09:12:36 +03:00
Herman van Hazendonk
de92265c95 Examples: Improve config implementation for multibank.
When using the software with multiple banks, the current config file solution wasn't very flexible. We had some different local implementation at our end. In order to use upstream software directly without any changes, suggesting to merge these changes. For me locally it would mean I can get rid of a lot of local example code which are currently bank and even entity specific and can be made more generic.
This will also allow multiple EBICS connections with the same bank for different entities as well, in case this is needed. In our case we have multiple EBICS connections with the same bank.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-26 19:57:54 +01:00
Herrie
61581d1af7 Cryto.js: Nasty workaround for incorrect signature (257 vs 256) and hex key length (514 vs 512)
For some unknown reason, the signature gets a length of 257 bytes instead of 256 bytes, and the length of the hex value is 514 bytes instead of 512 bytes.

This works around it, until a proper fix is implemented. The bug seems to be caused by https://github.com/node-ebics/node-ebics-client/blob/master/lib/crypto/Crypto.js#L71 somehow.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-25 10:07:33 +01:00
Herman van Hazendonk
8af3cb50c5 Add sample code for zipped CAMT statements
Some banks provide zipped CAMT statements, add some example code on how to write these to a file.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-24 22:14:21 +01:00
Herman van Hazendonk
a628e00b9b Add support for Bank GPB AO (Gazprombank Russia)
Add custom order types (G02, G52, G53, G1R and G1V) and examples for Bank GPB AO (Gazprombank Russia).

Pain.001.001.06 (RUB) - G1R
Pain.001.001.06 (FCY/FX/RLS) - G1V
Pain.002.001.06 - G02
Camt.052.001.05 - G52
Camt.053.001.05 - G53

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2021-03-24 22:13:18 +01:00
dependabot[bot]
b8ec1e228e chore(deps): bump xmldom from 0.3.0 to 0.5.0
Bumps [xmldom](https://github.com/xmldom/xmldom) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.3.0...0.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-13 02:40:29 +00:00
nanov
f027bc4048 chore: adjust ownership 2021-02-05 20:38:38 +02:00
nanov
a998538316 changelog 2021-02-05 20:30:59 +02:00
nanov
b44ff0f44c chore: bump 2021-02-05 20:29:22 +02:00
Dimitar Nanov
2ba095fbdd Merge pull request #44 from chrwoizi/master
fix high severity vulnerabilities
2021-01-25 16:21:16 +02:00
chrwoizi
c28a6f7f09 fix high severity vulnerabilities 2021-01-21 11:34:37 +01:00
Dimitar Nanov
0585ecd396 Merge pull request #39 from node-ebics/dependabot/npm_and_yarn/lodash-4.17.19
chore(deps): bump lodash from 4.17.15 to 4.17.19
2020-08-05 19:16:34 +03:00
dependabot[bot]
21a46832fc chore(deps): bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-18 18:01:50 +00:00
nanov
d5a24f9537 chore: fix dev dependencies voulnarbilities 2020-05-09 13:24:00 +03:00
nanov
a9bbdd95c6 chore: changelog 2020-05-09 13:21:16 +03:00
nanov
acd5a1897c v0.1.6 2020-05-09 13:20:30 +03:00
nanov
bd11a410f1 chore: update deps 2020-05-09 13:19:56 +03:00
Dimitar Nanov
4e5d8c2ea5 Merge pull request #34 from node-ebics/dependabot/npm_and_yarn/acorn-7.1.1
chore(deps): bump acorn from 7.1.0 to 7.1.1
2020-05-09 13:12:43 +03:00
dependabot[bot]
f913f95b64 chore(deps): bump acorn from 7.1.0 to 7.1.1
Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/7.1.0...7.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-14 11:26:46 +00:00
nanov
f232b81fc3 README.md adjust build status 2020-03-06 06:57:27 +02:00
nanov
3a18b213d5 v0.1.5 2020-03-06 06:51:37 +02:00
nanov
7053a03286 chore: update deps 2020-03-06 06:47:56 +02:00
nanov
be76a52ae5 chore: adjust samples 2020-03-06 06:43:17 +02:00
Dimitar Nanov
99f0bd9622 Merge pull request #33 from chrwoizi/master
feat: Wait until the keys are generated
2020-03-06 05:44:59 +02:00
chrwoizi
e57316c6cb Wait until the keys are generated
The initialization method should wait until the key file is written because other methods could use the keys-method after initialization.
2020-02-14 11:46:15 +01:00
nanov
4b0bf0eba6 fix(examples): orders ref 2019-12-30 11:36:11 +02:00
nanov
e060863356 fix keyStoragePath 2019-12-30 11:28:33 +02:00
nanov
fb464078dc fix(examples): bankLetter setup 2019-12-30 11:10:48 +02:00
nanov
3d4c94dff8 fix(examples): serverAddress -> url 2019-12-30 11:07:24 +02:00
nanov
e98a1f8cc3 fix: loadConfig in exmaples 2019-12-30 09:37:19 +02:00
nanov
c5e59414f3 changelog 2019-12-18 16:54:58 +02:00
nanov
5e73d3ce5e bump 2019-12-18 16:53:18 +02:00
nanov
c7e739f767 lock 2019-12-18 16:49:26 +02:00
nanov
478571e447 chore: update deps 2019-12-18 16:49:20 +02:00
nanov
f6dfdf4c40 feat: generalize examples 2019-12-18 16:48:05 +02:00
Dimitar Nanov
fcbf4ca165 Merge pull request #28 from Herrie82/herrie/config
examples: Externalize configuration values and allow for multiple env…
2019-12-18 10:37:02 +02:00
nanov
6187902ae5 chore: transfer to new repository 2019-12-16 14:28:35 +02:00
Dimitar Nanov
65658ab131 Merge pull request #29 from Herrie82/herrie/send-XG1
Add XG1 order type and example
2019-12-13 10:36:30 +02:00
Herrie
d38460011c Add XG1 order type and example
XG1 order type is used for ISO XML 20022 CGI (Common Global Implementation) which should be a unified format that works within a country (irrespective of bank).

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-29 14:38:46 +01:00
Dimitar Nanov
b9058fac93 Merge pull request #27 from Herrie82/herrie/SupportedBank
README.md: Add Bank GPB International S.A. to supported bank list
2019-11-29 14:14:10 +02:00
Herrie
c3d3decd6a examples: Externalize configuration values and allow for multiple environments
In order to more easily manage testing of various order types as well as production, development etc. environments, externalize this config values.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-29 13:12:15 +01:00
Herrie
a5b65f815e README.md: Add Bank GPB International S.A. to supported bank list
I was able to test DKI, INI, HAA, HAC, HEV, HVD, STA, VMK, XG1 with Bank GPB International S.A., so I think we're good to add it to the supported bank list.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
2019-11-29 11:46:53 +01:00
38 changed files with 2312 additions and 1055 deletions

View File

@@ -1,108 +1,164 @@
### Changelog
#### [v0.1.3](https://github.com/eCollect/node-ebics-client/compare/v0.1.2...v0.1.3)
#### [v0.2.0](https://github.com/node-ebics/node-ebics-client/compare/v0.1.7...v0.2.0)
> 30 March 2021
- chore(deps): bump y18n from 4.0.0 to 4.0.1 [`#56`](https://github.com/node-ebics/node-ebics-client/pull/56)
- Add additional bank configuration items [`#53`](https://github.com/node-ebics/node-ebics-client/pull/53)
- chore(deps): bump xmldom from 0.3.0 to 0.5.0 [`#46`](https://github.com/node-ebics/node-ebics-client/pull/46)
- Cryto.js: Nasty workaround for incorrect signature (257 vs 256) and h… [`#50`](https://github.com/node-ebics/node-ebics-client/pull/50)
- Examples: Improve config implementation for multibank [`#51`](https://github.com/node-ebics/node-ebics-client/pull/51)
- README.md: Add J.P. Morgan to tested banks [`#55`](https://github.com/node-ebics/node-ebics-client/pull/55)
- Add support for Bank GPB AO (Gazprombank Russia) [`#49`](https://github.com/node-ebics/node-ebics-client/pull/49)
- Add sample code for zipped CAMT statements [`#48`](https://github.com/node-ebics/node-ebics-client/pull/48)
- chore: cleanup & bump [`f9fb6d3`](https://github.com/node-ebics/node-ebics-client/commit/f9fb6d3dc94c27a0c983205ce0ef00e4a18f95ff)
- merge [`2d580c0`](https://github.com/node-ebics/node-ebics-client/commit/2d580c0d443b0ec0d103a94b64c803bfa1dd6b0b)
- chore: update deps [`e642024`](https://github.com/node-ebics/node-ebics-client/commit/e6420244dc5d218926ede3b0123897096fb6dfd9)
#### [v0.1.7](https://github.com/node-ebics/node-ebics-client/compare/v0.1.6...v0.1.7)
> 5 February 2021
- fix high severity vulnerabilities [`#44`](https://github.com/node-ebics/node-ebics-client/pull/44)
- chore(deps): bump lodash from 4.17.15 to 4.17.19 [`#39`](https://github.com/node-ebics/node-ebics-client/pull/39)
- chore: fix dev dependencies voulnarbilities [`d5a24f9`](https://github.com/node-ebics/node-ebics-client/commit/d5a24f9537f676ded8d1996928ed7e76b7b9ba3f)
- changelog [`a998538`](https://github.com/node-ebics/node-ebics-client/commit/a998538316c963896c0e7ca76002513f9ea4a01a)
- chore: changelog [`a9bbdd9`](https://github.com/node-ebics/node-ebics-client/commit/a9bbdd95c6ce0fdb9cac5452af6fedb4f04b10cb)
#### [v0.1.6](https://github.com/node-ebics/node-ebics-client/compare/v0.1.4...v0.1.6)
> 9 May 2020
- chore(deps): bump acorn from 7.1.0 to 7.1.1 [`#34`](https://github.com/node-ebics/node-ebics-client/pull/34)
- feat: Wait until the keys are generated [`#33`](https://github.com/node-ebics/node-ebics-client/pull/33)
- chore: update deps [`bd11a41`](https://github.com/node-ebics/node-ebics-client/commit/bd11a410f1d2444cdfdfba965df7be37cedcc14a)
- chore: update deps [`7053a03`](https://github.com/node-ebics/node-ebics-client/commit/7053a03286c700106bb1988fce72338f51ca9a96)
- changelog [`c5e5941`](https://github.com/node-ebics/node-ebics-client/commit/c5e59414f35a9634e12a6b74163f1b7fa6403de5)
#### [v0.1.4](https://github.com/node-ebics/node-ebics-client/compare/v0.1.3...v0.1.4)
> 18 December 2019
- examples: Externalize configuration values and allow for multiple env… [`#28`](https://github.com/node-ebics/node-ebics-client/pull/28)
- Add XG1 order type and example [`#29`](https://github.com/node-ebics/node-ebics-client/pull/29)
- README.md: Add Bank GPB International S.A. to supported bank list [`#27`](https://github.com/node-ebics/node-ebics-client/pull/27)
- feat: generalize examples [`f6dfdf4`](https://github.com/node-ebics/node-ebics-client/commit/f6dfdf4c40621d9d6d9bcd64b8698d614307ea61)
- examples: Externalize configuration values and allow for multiple environments [`c3d3dec`](https://github.com/node-ebics/node-ebics-client/commit/c3d3decd6a17f733b41ea9f24ed5df8b0b7364f6)
- lock [`c7e739f`](https://github.com/node-ebics/node-ebics-client/commit/c7e739f7670856cff5af8fc93a341baf98e01546)
#### [v0.1.3](https://github.com/node-ebics/node-ebics-client/compare/v0.1.2...v0.1.3)
> 26 November 2019
- * Add DKI, C52, C53 order types. [`#26`](https://github.com/eCollect/node-ebics-client/pull/26)
- Bank Letter: Add English template & flexible generation [`95403cb`](https://github.com/eCollect/node-ebics-client/commit/95403cbe6f90c81a696bb589533d713a4ba04873)
- * Add DKI, C52, C53 order types. [`#26`](https://github.com/node-ebics/node-ebics-client/pull/26)
- feat: Add English template & flexible generation [`#24`](https://github.com/node-ebics/node-ebics-client/pull/24)
- chore: Various fixes for spelling [`#23`](https://github.com/node-ebics/node-ebics-client/pull/23)
#### [v0.1.2](https://github.com/eCollect/node-ebics-client/compare/v0.1.1...v0.1.2)
- test: add additional tests [`6d73ef7`](https://github.com/node-ebics/node-ebics-client/commit/6d73ef77d4454ff966b733f995b64d6dfd7c18b2)
- test: add more tests [`67d74cf`](https://github.com/node-ebics/node-ebics-client/commit/67d74cfa0060d97c948bb747885eaba26294663b)
- Bank Letter: Add English template & flexible generation [`95403cb`](https://github.com/node-ebics/node-ebics-client/commit/95403cbe6f90c81a696bb589533d713a4ba04873)
#### [v0.1.2](https://github.com/node-ebics/node-ebics-client/compare/v0.1.1...v0.1.2)
> 7 November 2019
- chore: add changelog configoration [`#22`](https://github.com/eCollect/node-ebics-client/pull/22)
- Closes #17 and #13 [`#21`](https://github.com/eCollect/node-ebics-client/pull/21)
- Drop moment dependency [`#20`](https://github.com/eCollect/node-ebics-client/pull/20)
- chore: add changelog configoration [`#22`](https://github.com/node-ebics/node-ebics-client/pull/22)
- Closes #17 and #13 [`#21`](https://github.com/node-ebics/node-ebics-client/pull/21)
- Drop moment dependency [`#20`](https://github.com/node-ebics/node-ebics-client/pull/20)
- feat: add nyc and cleanup .gitignore [`3e95478`](https://github.com/eCollect/node-ebics-client/commit/3e95478b3be719c86f32c7df10c42e46b7518669)
- feat: drop bn.js [`eea0a49`](https://github.com/eCollect/node-ebics-client/commit/eea0a49130e30c123b110120c69d7b7c19fd12ba)
- add changelog configoration [`1f34dcb`](https://github.com/eCollect/node-ebics-client/commit/1f34dcbfb6e0febbb93d5356fa36ac57d697a990)
- feat: add nyc and cleanup .gitignore [`3e95478`](https://github.com/node-ebics/node-ebics-client/commit/3e95478b3be719c86f32c7df10c42e46b7518669)
- feat: drop bn.js [`eea0a49`](https://github.com/node-ebics/node-ebics-client/commit/eea0a49130e30c123b110120c69d7b7c19fd12ba)
- add changelog configoration [`1f34dcb`](https://github.com/node-ebics/node-ebics-client/commit/1f34dcbfb6e0febbb93d5356fa36ac57d697a990)
#### [v0.1.1](https://github.com/eCollect/node-ebics-client/compare/v0.1.0...v0.1.1)
#### [v0.1.1](https://github.com/node-ebics/node-ebics-client/compare/v0.1.0...v0.1.1)
> 5 November 2019
- chore: update license [`9aabe93`](https://github.com/eCollect/node-ebics-client/commit/9aabe933e91b506ea38820b952ce8e5e58b4c2ff)
- chore: update license [`9aabe93`](https://github.com/node-ebics/node-ebics-client/commit/9aabe933e91b506ea38820b952ce8e5e58b4c2ff)
#### [v0.1.0](https://github.com/eCollect/node-ebics-client/compare/v0.0.8...v0.1.0)
#### [v0.1.0](https://github.com/node-ebics/node-ebics-client/compare/v0.0.8...v0.1.0)
> 5 November 2019
- Feat: handle unsual exponent migrate to node-forge [`#16`](https://github.com/eCollect/node-ebics-client/pull/16)
- Add order generation tests and fix linting [`#15`](https://github.com/eCollect/node-ebics-client/pull/15)
- test script run mocha [`#14`](https://github.com/eCollect/node-ebics-client/pull/14)
- Feat: handle unsual exponent migrate to node-forge [`#16`](https://github.com/node-ebics/node-ebics-client/pull/16)
- Add order generation tests and fix linting [`#15`](https://github.com/node-ebics/node-ebics-client/pull/15)
- test script run mocha [`#14`](https://github.com/node-ebics/node-ebics-client/pull/14)
- feat: prepare order generation tests [`e40f79c`](https://github.com/eCollect/node-ebics-client/commit/e40f79cee68a194272c93f07e763175b213a77a1)
- chore: cleanup [`0c01420`](https://github.com/eCollect/node-ebics-client/commit/0c01420c1e14992a4169098ccd47cd196b899f06)
- feat: prepare order generation tests [`e40f79c`](https://github.com/node-ebics/node-ebics-client/commit/e40f79cee68a194272c93f07e763175b213a77a1)
- chore: cleanup [`0c01420`](https://github.com/node-ebics/node-ebics-client/commit/0c01420c1e14992a4169098ccd47cd196b899f06)
#### [v0.0.36](https://github.com/eCollect/node-ebics-client/compare/v0.0.35...v0.0.36)
#### [v0.0.36](https://github.com/node-ebics/node-ebics-client/compare/v0.0.35...v0.0.36)
> 1 June 2018
- various modular fixes [`8492d94`](https://github.com/eCollect/node-ebics-client/commit/8492d940542f61b17aa3a2da7de23f6539ffaad5)
- various modular fixes [`8492d94`](https://github.com/node-ebics/node-ebics-client/commit/8492d940542f61b17aa3a2da7de23f6539ffaad5)
#### [v0.0.35](https://github.com/eCollect/node-ebics-client/compare/v0.0.3...v0.0.35)
#### [v0.0.35](https://github.com/node-ebics/node-ebics-client/compare/v0.0.3...v0.0.35)
> 31 May 2018
- update License to GPL v3 [`babcf76`](https://github.com/eCollect/node-ebics-client/commit/babcf76b61af6eb737ab291a301e71bb84621820)
- Add MGF1.js file - mask generation utility class [`7e6e2ff`](https://github.com/eCollect/node-ebics-client/commit/7e6e2ff142688b0c453369fa7137b49e8b89cd81)
- Add sign, _emsaPSS and _modPowe methods in Key.js file [`5ace213`](https://github.com/eCollect/node-ebics-client/commit/5ace2137231af9a3563ab31fa0f70fbdf4b148cb)
- update License to GPL v3 [`babcf76`](https://github.com/node-ebics/node-ebics-client/commit/babcf76b61af6eb737ab291a301e71bb84621820)
- Add MGF1.js file - mask generation utility class [`7e6e2ff`](https://github.com/node-ebics/node-ebics-client/commit/7e6e2ff142688b0c453369fa7137b49e8b89cd81)
- Add sign, _emsaPSS and _modPowe methods in Key.js file [`5ace213`](https://github.com/node-ebics/node-ebics-client/commit/5ace2137231af9a3563ab31fa0f70fbdf4b148cb)
#### [v0.0.8](https://github.com/eCollect/node-ebics-client/compare/v0.0.7...v0.0.8)
#### [v0.0.8](https://github.com/node-ebics/node-ebics-client/compare/v0.0.7...v0.0.8)
> 8 October 2019
- chore: readme maintenance [`#11`](https://github.com/eCollect/node-ebics-client/pull/11)
- Provide examples [`#10`](https://github.com/eCollect/node-ebics-client/pull/10)
- chore: readme maintenance [`#11`](https://github.com/node-ebics/node-ebics-client/pull/11)
- Provide examples [`#10`](https://github.com/node-ebics/node-ebics-client/pull/10)
- initialize.js [`7dad7c8`](https://github.com/eCollect/node-ebics-client/commit/7dad7c878722be94e03808cef3af38d34019c623)
- examples/bankLetter.js [`ce6e58b`](https://github.com/eCollect/node-ebics-client/commit/ce6e58b3f33017967e5b26fe15a2c435012b8af6)
- examples/send-hbt-order.js [`166c61a`](https://github.com/eCollect/node-ebics-client/commit/166c61aec4a247d923de82278271ec02cbef815f)
- initialize.js [`7dad7c8`](https://github.com/node-ebics/node-ebics-client/commit/7dad7c878722be94e03808cef3af38d34019c623)
- examples/bankLetter.js [`ce6e58b`](https://github.com/node-ebics/node-ebics-client/commit/ce6e58b3f33017967e5b26fe15a2c435012b8af6)
- examples/send-hbt-order.js [`166c61a`](https://github.com/node-ebics/node-ebics-client/commit/166c61aec4a247d923de82278271ec02cbef815f)
#### [v0.0.7](https://github.com/eCollect/node-ebics-client/compare/v0.0.6...v0.0.7)
#### [v0.0.7](https://github.com/node-ebics/node-ebics-client/compare/v0.0.6...v0.0.7)
> 2 August 2019
- * Add Z53 order type [`#7`](https://github.com/eCollect/node-ebics-client/pull/7)
- remove eCollect from constant and minor verbose error handeling [`#2`](https://github.com/eCollect/node-ebics-client/pull/2)
- add iso pain format XCT order type [`#1`](https://github.com/eCollect/node-ebics-client/pull/1)
- * Add Z53 order type [`#7`](https://github.com/node-ebics/node-ebics-client/pull/7)
- remove eCollect from constant and minor verbose error handeling [`#2`](https://github.com/node-ebics/node-ebics-client/pull/2)
- add iso pain format XCT order type [`#1`](https://github.com/node-ebics/node-ebics-client/pull/1)
- add new order type XZ53 and removed repeated dateRange to consts [`5ff3147`](https://github.com/eCollect/node-ebics-client/commit/5ff314712443c4c8465f46292b010cfedfed8c2e)
- move dateRange from constants to utils [`aa761cf`](https://github.com/eCollect/node-ebics-client/commit/aa761cf7ad87a271d6e6d9eed40e04eb4376f6c5)
- bump version [`79f17e1`](https://github.com/eCollect/node-ebics-client/commit/79f17e14045d121c9505eb3118967f5f88ae79e2)
- add new order type XZ53 and removed repeated dateRange to consts [`5ff3147`](https://github.com/node-ebics/node-ebics-client/commit/5ff314712443c4c8465f46292b010cfedfed8c2e)
- move dateRange from constants to utils [`aa761cf`](https://github.com/node-ebics/node-ebics-client/commit/aa761cf7ad87a271d6e6d9eed40e04eb4376f6c5)
- bump version [`79f17e1`](https://github.com/node-ebics/node-ebics-client/commit/79f17e14045d121c9505eb3118967f5f88ae79e2)
#### [v0.0.6](https://github.com/eCollect/node-ebics-client/compare/v0.0.5...v0.0.6)
#### [v0.0.6](https://github.com/node-ebics/node-ebics-client/compare/v0.0.5...v0.0.6)
> 24 July 2019
- remove eCollect from constant and minor verbose error handaling [`#4`](https://github.com/eCollect/node-ebics-client/pull/4)
- add iso pain format XCT order type [`#5`](https://github.com/eCollect/node-ebics-client/pull/5)
- remove eCollect from constant and minor verbose error handaling [`#4`](https://github.com/node-ebics/node-ebics-client/pull/4)
- add iso pain format XCT order type [`#5`](https://github.com/node-ebics/node-ebics-client/pull/5)
- remove eCollect from constant and minor verbose error handeling [`cb2062a`](https://github.com/eCollect/node-ebics-client/commit/cb2062ae2fbd8e8881de26561efddad1f272e065)
- bump [`c9f52d3`](https://github.com/eCollect/node-ebics-client/commit/c9f52d3bd99b9f8761652365b217d9580fa34632)
- remove eCollect from constant and minor verbose error handeling [`cb2062a`](https://github.com/node-ebics/node-ebics-client/commit/cb2062ae2fbd8e8881de26561efddad1f272e065)
- bump [`c9f52d3`](https://github.com/node-ebics/node-ebics-client/commit/c9f52d3bd99b9f8761652365b217d9580fa34632)
#### [v0.0.5](https://github.com/eCollect/node-ebics-client/compare/v0.0.4...v0.0.5)
#### [v0.0.5](https://github.com/node-ebics/node-ebics-client/compare/v0.0.4...v0.0.5)
> 28 June 2019
- Fix parsing of the bank keys in the HPB response [`#3`](https://github.com/eCollect/node-ebics-client/pull/3)
- Fix parsing of the bank keys in the HPB response [`#3`](https://github.com/node-ebics/node-ebics-client/pull/3)
- tc for bank keys parsing error [`c571ef1`](https://github.com/eCollect/node-ebics-client/commit/c571ef181bca2e0cbec70bc6df53c706acd6c829)
- #2 corrected bank keys parsing [`5f0b6cd`](https://github.com/eCollect/node-ebics-client/commit/5f0b6cd3747c4613920d2f71f3c04ce13225d397)
- tc for bank keys parsing error [`c571ef1`](https://github.com/node-ebics/node-ebics-client/commit/c571ef181bca2e0cbec70bc6df53c706acd6c829)
- #2 corrected bank keys parsing [`5f0b6cd`](https://github.com/node-ebics/node-ebics-client/commit/5f0b6cd3747c4613920d2f71f3c04ce13225d397)
#### [v0.0.4](https://github.com/eCollect/node-ebics-client/compare/v0.0.36...v0.0.4)
#### [v0.0.4](https://github.com/node-ebics/node-ebics-client/compare/v0.0.36...v0.0.4)
> 3 September 2018
- Major changes. Separating responsibilities. Orders builder, serializer. [`ff9a3a1`](https://github.com/eCollect/node-ebics-client/commit/ff9a3a16b47d0a25674134c875bfd651995837e4)
- code optimization [`1876360`](https://github.com/eCollect/node-ebics-client/commit/187636019c290d757aca77d4c14fb4f2519acd38)
- client and order optimization [`9454992`](https://github.com/eCollect/node-ebics-client/commit/945499290a8698aed504b573019de2c23148006a)
- Major changes. Separating responsibilities. Orders builder, serializer. [`ff9a3a1`](https://github.com/node-ebics/node-ebics-client/commit/ff9a3a16b47d0a25674134c875bfd651995837e4)
- code optimization [`1876360`](https://github.com/node-ebics/node-ebics-client/commit/187636019c290d757aca77d4c14fb4f2519acd38)
- client and order optimization [`9454992`](https://github.com/node-ebics/node-ebics-client/commit/945499290a8698aed504b573019de2c23148006a)
#### v0.0.3
> 17 May 2018
- initial commit [`1f947ff`](https://github.com/eCollect/node-ebics-client/commit/1f947ff1480c522f89fa1f547581b55e2378d920)
- Initial commit [`cd37de3`](https://github.com/eCollect/node-ebics-client/commit/cd37de3895e32a61798c79ce3a6447e2f269019d)
- initial commit [`1f947ff`](https://github.com/node-ebics/node-ebics-client/commit/1f947ff1480c522f89fa1f547581b55e2378d920)
- Initial commit [`cd37de3`](https://github.com/node-ebics/node-ebics-client/commit/cd37de3895e32a61798c79ce3a6447e2f269019d)

View File

@@ -4,7 +4,7 @@
<h1 align="center">node-ebics-client</h1>
<p align="center">
<a href="https://travis-ci.org/eCollect/node-ebics-client" title="Build Status"><img src="https://travis-ci.org/eCollect/node-ebics-client.svg?branch=master" alt="Build Status" /></a>
<a href="https://travis-ci.org/node-ebics/node-ebics-client" title="Build Status"><img src="https://travis-ci.org/node-ebics/node-ebics-client.svg?branch=master" alt="Build Status" /></a>
<a href="https://www.npmjs.com/package/ebics-client" title="Build Status">
<img alt="ebics-client" src="https://img.shields.io/npm/v/ebics-client">
</a>
@@ -27,6 +27,9 @@ The client is currently tested and verified to work with the following banks:
* [Zürcher Kantonalbank](https://www.zkb.ch/en/lg/ew.html)
* [Raiffeisen Schweiz](https://www.raiffeisen.ch/rch/de.html)
* [BW Bank](https://www.bw-bank.de/de/home.html)
* [Bank GPB International S.A.](https://gazprombank.lu/e-banking)
* [Bank GPB AO](https://gazprombank.ru/)
* [J.P. Morgan](https://www.jpmorgan.com/)
## Inspiration
@@ -36,6 +39,6 @@ The basic concept of this library was inspired by the [EPICS](https://github.com
## Copyright
Copyright: eCollect AG, 2018-9.
Copyright: Dimitar Nanov, 2019-2021.
Licensed under the [GPLv3](LICENSE) license.

View File

@@ -7,20 +7,13 @@ const path = require('path');
const fs = require('fs');
const os = require('os');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
const config = require('./loadConfig')();
const client = require('./getClient')(config);
const bankName = client.bankName;
const template = fs.readFileSync("../templates/ini_"+client.languageCode+".hbs", { encoding: 'utf8'});
const bankLetterFile = path.join("./", "bankLetter_"+client.bankShortName+"_"+client.languageCode+".html");
const bankName = 'Bank name'; // Change this to the bank name you're going to send the letter to.
const languageCode = 'en'; // Currently 'de' and 'en' are valid values.
const template = fs.readFileSync('../templates/ini_'+languageCode+'.hbs').toString();
const letter = new ebics.BankLetter({ client, bankName, template });
const bankLetterFile = path.join(os.homedir(), 'bankLetter_'+languageCode+'.html');
letter.serialize(bankLetterFile)
.then(() => {

View File

@@ -0,0 +1,12 @@
{
"url": "https://ebics-test.server",
"partnerId": "EBICS ParnerID Test",
"userId": "MyUserIdTest",
"hostId": "MyHostIdTest",
"passphrase": "MyPasswordTest",
"keyStoragePath": "./keys-test",
"bankName":"Test Bank Full Name",
"bankShortName":"TESTBANKSHORT",
"languageCode":"en",
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Test\\"
}

View File

@@ -0,0 +1,12 @@
{
"url": "https://ebics.server",
"partnerId": "EBICS ParnerID Production",
"userId": "MyUserIdProduction",
"hostId": "MyHostIdProduction",
"passphrase": "MyPasswordProduction",
"keyStoragePath": "./keys-prod",
"bankName":"Production Bank Full Name",
"bankShortName":"PRODBANKSHORT",
"languageCode":"en",
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Production\\"
}

View File

@@ -0,0 +1,12 @@
{
"url": "https://ebics.server",
"partnerId": "EBICS ParnerID Production",
"userId": "MyUserIdProduction",
"hostId": "MyHostIdProduction",
"passphrase": "MyPasswordProduction",
"keyStoragePath": "./keys-prod",
"bankName":"Production Bank Full Name",
"bankShortName":"PRODBANKSHORT",
"languageCode":"en",
"storageLocation":"\\\\myserver\\Share\\Folder\\BankName\\Production\\"
}

21
examples/getClient.js Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
const { Client, fsKeysStorage } = require('../index');
const loadConfig = require('./loadConfig');
module.exports = ({
url,
partnerId,
userId,
hostId,
passphrase,
keyStoragePath,
} = loadConfig()) => new Client({
url,
partnerId,
userId,
hostId,
passphrase,
keyStorage: fsKeysStorage(keyStoragePath),
});

View File

@@ -2,19 +2,14 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: 'PARTNER',
userId: 'USER',
hostId: 'HOST',
passphrase: 'test', // keys-test will be encrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
const client = require('./getClient')();
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);

46
examples/loadConfig.js Normal file
View File

@@ -0,0 +1,46 @@
'use strict';
const fs = require('fs');
const path = require('path');
const safeLoadJson = (file) => {
if (!file)
return {};
try {
return JSON.parse(fs.readFileSync(file));
} catch (e) {
console.warn(`Couldn't load ${file} config file.`);
return {};
}
}
const getDefaultEnv = () => {
const [,,parArg] = process.argv;
return parArg || process.env.NODE_ENV;
}
const getBankIdentifier = () => {
const [,,,parArg] = process.argv;
return parArg || "testbank";
}
const getEntityIdentifier = () => {
const [,,,,parArg] = process.argv;
return parArg || ""
}
const loadConfig = (configDirectory = path.join(__dirname, './config'), env = getDefaultEnv(), bank = getBankIdentifier(), entity = getEntityIdentifier()) => {
entity ? console.log(`Loading config from ${configDirectory} with env set to ${env}, bank set to ${bank} and entity set to ${entity}.`) : console.log(`Loading config from ${configDirectory} with env set to ${env} and bank set to ${bank}.`);
global.entity = entity;
const baseConfigFile = path.join(configDirectory, 'config.json');
const envConfigFile = env ? entity ? path.join(configDirectory, `config.${env}.${bank}.${entity}.json`) : path.join(configDirectory, `config.${env}.${bank}.json`) : null;
return {
...safeLoadJson(baseConfigFile),
...safeLoadJson(envConfigFile),
}
}
module.exports = loadConfig;

View File

@@ -2,20 +2,12 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// 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);
let distPath = "CAMT052.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -2,19 +2,11 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// 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);
let distPath = "CAMT053.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -2,19 +2,11 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -2,19 +2,11 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.G02(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for G02 order %j', resp);
if (resp.technicalCode !== '000000')
throw new Error('Something went wrong');
// Parsing and processing the G02 Pain.002.001.06 file should happen somewhere here, ideally after saving it to disk
const data = Buffer.from(resp.orderData);
let distPath = "G02.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,20 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
const paymentFile = fs.readFileSync('RUB_PAYMENT.xml').toString();
client.send(Orders.G1R(paymentFile))
.then((resp) => {
console.log('Response for G1R order %j', resp);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,20 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
const paymentFile = fs.readFileSync('FCY_PAYMENT.xml').toString();
client.send(Orders.G1V(paymentFile))
.then((resp) => {
console.log('Response for G1V order %j', resp);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.G52(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for G52 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);
let distPath = "CAMT052-G52.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,28 @@
#! /usr/bin/env node
'use strict';
const fs = require('fs');
const client = require('./getClient')();
const { Orders } = require('../index');
// The bank keys must have been already saved
client.send(Orders.G53(null, null)) // startDate 'YYYY-MM-DD', endDate 'YYYY-MM-DD'
.then((resp) => {
console.log('Response for G53 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);
let distPath = "CAMT053-G53.zip";
const dstZip = fs.createWriteStream(distPath);
dstZip.write(data);
dstZip.end();
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -2,19 +2,11 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -2,19 +2,11 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -2,19 +2,11 @@
'use strict';
const ebics = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
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')

View File

@@ -2,19 +2,12 @@
'use strict';
const ebics = require('../index');
const client = require('./getClient')();
const { Orders } = require('../index');
const client = new ebics.Client({
url: 'https://ebics.server',
partnerId: '',
userId: '',
hostId: '',
passphrase: 'test', // keys-test will be decrypted with this passphrase
keyStorage: ebics.fsKeysStorage('./keys-test'),
});
// 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')

View File

@@ -0,0 +1,21 @@
#! /usr/bin/env node
'use strict';
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(Orders.XG1(paymentFile))
.then((resp) => {
console.log('Response for XG1 order %j', resp);
})
.catch((err) => {
console.error(err);
process.exit(1);
});

View File

@@ -46,6 +46,10 @@ const stringifyKeys = (keys) => {
* @property {string} passphrase - passphrase for keys encryption
* @property {KeyStorage} keyStorage - keyStorage implementation
* @property {object} [tracesStorage] - traces (logs) storage implementation
* @property {string} bankName - Full name of the bank to be used in the bank INI letters.
* @property {string} bankShortName - Short name of the bank to be used in folders, filenames etc.
* @property {string} languageCode - Language code to be used in the bank INI letters ("de", "en" and "fr" are currently supported).
* @property {string} storageLocation - Location where to store the files that are downloaded. This can be a network share for example.
*/
@@ -62,6 +66,10 @@ module.exports = class Client {
passphrase,
keyStorage,
tracesStorage,
bankName,
bankShortName,
languageCode,
storageLocation,
}) {
if (!url)
throw new Error('EBICS URL is required');
@@ -84,6 +92,10 @@ module.exports = class Client {
this.keyStorage = keyStorage;
this.keyEncryptor = defaultKeyEncryptor({ passphrase });
this.tracesStorage = tracesStorage || null;
this.bankName = bankName || 'Dummy Bank Full Name';
this.bankShortName = bankShortName || 'BANKSHORTCODE';
this.languageCode = languageCode || 'en';
this.storageLocation = storageLocation || null;
}
async send(order) {
@@ -104,7 +116,7 @@ module.exports = class Client {
async initialization(order) {
const keys = await this.keys();
if (keys === null) this._generateKeys();
if (keys === null) await this._generateKeys();
if (this.tracesStorage)
this.tracesStorage.new().ofType('ORDER.INI');
@@ -223,10 +235,10 @@ module.exports = class Client {
}
}
_generateKeys() {
async _generateKeys() {
const keysObject = Keys.generate();
this._writeKeys(keysObject);
await this._writeKeys(keysObject);
}
async setBankKeys(bankKeys) {

View File

@@ -67,12 +67,15 @@ module.exports = class Crypto {
}
static sign(key, msg, salt = crypto.randomBytes(32)) {
// console.log(key.d());
const base = new BigNumber(emsaPSS(msg, salt));
const power = new BigNumber(key.d());
const mod = new BigNumber(key.n());
const buffer = modPow(base, power, mod).toBEBuffer();
return (modPow(base, power, mod)).toBEBuffer().toString('base64');
if (buffer.byteLength === 257 && buffer[0] === 0x00)
return buffer.slice(1).toString('base64');
return buffer.toString('base64');
}
static pad(d) {

View File

@@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'G02',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'G1R', OrderAttribute: 'DZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'G1V', OrderAttribute: 'DZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'G52',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@@ -0,0 +1,13 @@
'use strict';
const utils = require('../utils');
module.exports = (start = null, end = null) => ({
version: 'h004',
orderDetails: {
OrderType: 'G53',
OrderAttribute: 'DZHNN',
StandardOrderParams: utils.dateRange(start, end),
},
operation: 'download',
});

View File

@@ -0,0 +1,8 @@
'use strict';
module.exports = document => ({
version: 'h004',
orderDetails: { OrderType: 'XG1', OrderAttribute: 'OZHNN', StandardOrderParams: {} },
operation: 'upload',
document,
});

View File

@@ -13,6 +13,9 @@ const CCT = require('./CCT');
const CCS = require('./CCS');
const XE3 = require('./XE3');
const XCT = require('./XCT');
const XG1 = require('./XG1');
const G1V = require('./G1V');
const G1R = require('./G1R');
const STA = require('./STA');
const VMK = require('./VMK');
@@ -26,6 +29,9 @@ const Z53 = require('./Z53');
const DKI = require('./DKI');
const C52 = require('./C52');
const C53 = require('./C53');
const G52 = require('./G52');
const G53 = require('./G53');
const G02 = require('./G02');
module.exports = {
INI,
@@ -42,6 +48,9 @@ module.exports = {
CCS,
XE3,
XCT,
XG1,
G1V,
G1R,
STA,
VMK,
@@ -54,4 +63,7 @@ module.exports = {
DKI,
C52,
C53,
G52,
G53,
G02,
};

View File

@@ -2,7 +2,7 @@
const fs = require('fs');
const uuidv1 = require('uuid/v1');
const { v1: uuidv1 } = require('uuid');
const traceName = (uuid, label, type, ext = 'xml') => `${uuid}_${label}_${type}.${ext}`;

2449
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "ebics-client",
"version": "0.1.3",
"version": "0.2.1",
"description": "Node.js ISO 20022 Compliant EBICS Client",
"main": "index.js",
"files": [
@@ -15,7 +15,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/eCollect/node-ebics-client"
"url": "https://github.com/node-ebics/node-ebics-client"
},
"keywords": [
"EBICS",
@@ -47,28 +47,36 @@
{
"name": "Herman van Hazendonk",
"email": "github.com@herrie.org"
},
{
"name": "chrwoizi",
"url": "https://github.com/chrwoizi"
},
{
"name": "Herrie",
"url": "https://github.com/Herrie82"
}
],
"license": "GPL-3.0-only",
"dependencies": {
"auto-changelog": "^1.16.2",
"handlebars": "^4.5.3",
"js2xmlparser": "^4.0.0",
"node-forge": "^0.9.1",
"request": "^2.88.0",
"uuid": "^3.3.3",
"xml-crypto": "^1.4.0",
"xmldom": "^0.1.27",
"xpath": "0.0.27"
"handlebars": "^4.7.7",
"js2xmlparser": "^4.0.1",
"node-forge": "^0.10.0",
"request": "^2.88.2",
"uuid": "^8.3.2",
"xml-crypto": "^2.1.1",
"xmldom": "^0.5.0",
"xpath": "0.0.32"
},
"devDependencies": {
"chai": "^4.2.0",
"coveralls": "^3.0.7",
"eslint": "^6.6.0",
"auto-changelog": "^1.16.2",
"chai": "^4.3.4",
"coveralls": "^3.1.0",
"eslint": "^6.7.2",
"eslint-config-ecollect-base": "^0.1.2",
"eslint-plugin-import": "^2.18.2",
"libxmljs": "^0.19.7",
"mocha": "^6.2.2",
"nyc": "^14.1.1"
"mocha": "^7.1.2",
"nyc": "^15.1.0"
}
}

164
templates/ini_fr.hbs Normal file
View File

@@ -0,0 +1,164 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta charset="UTF-8" />
<title>EBICS ini</title>
</head>
<body>
<div>
<h2>Lettre d'initialisation pour clés électroniques bancaires (INI)</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Heure</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Banque</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>ID Utilisateur</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>ID Partenaire</td>
<td>{{ partnerId }}</td>
</tr>
</table>
<p>Clé publique (Public Key) pour la signature électronique (A006)</p>
<p>Exposant ({{ keyExponentBits A006 }} Bit):</p>
<p>
<code>{{ keyExponent A006 }}</code>
</p>
<p>Modulo ({{ keyModulusBits A006 }} Bit):</p>
<p>
<code>{{ keyModulus A006 }}</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>{{ sha256 A006 }}</code>
</p>
<p>Je confirme par la présente la clé publique ci-dessus pour ma signature électronique.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>Lieu/Date</td>
<td>Nom/Entreprise</td>
<td>Signature</td>
</tr>
</table>
</div>
<div style="page-break-after:always"></div>
<h2>Lettre d'initialisation pour clés électroniques bancaires (HIA) - Page 1/2</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Heure</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Banque</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>ID Utilisateur</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>ID Partenaire</td>
<td>{{ partnerId }}</td>
</tr>
</table>
<div>
<p>Clé d'identification publique (X002)</p>
<p>Exposant ({{ keyExponentBits X002 }} Bit):</p>
<p>
<code>{{ keyExponent X002 }}</code>
</p>
<p>Modulo ({{ keyModulusBits X002 }} Bit):</p>
<p>
<code>{{ keyModulus X002 }}</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>{{ sha256 X002 }}</code>
</p>
<p>Suite à la page 2 ...</p>
<div style="page-break-after:always"></div>
<h2>Lettre d'initialisation pour clés électroniques bancaires (HIA) - Page 2/2</h2>
<table>
<tr>
<td>Date</td>
<td>{{ today }}</td>
</tr>
<tr>
<td>Heure</td>
<td>{{ now }}</td>
</tr>
<tr>
<td>Banque</td>
<td>{{ bankName }}</td>
</tr>
<tr>
<td>ID Utilisateur</td>
<td>{{ userId }}</td>
</tr>
<tr>
<td>ID Partenaire</td>
<td>{{ partnerId }}</td>
</tr>
</table>
</div>
<div>
<p>Clé de chiffrement publique (E002)</p>
<p>Exposant ({{ keyExponentBits E002 }} Bit):</p>
<p>
<code>{{ keyExponent E002 }}</code>
</p>
<p>Modulo ({{ keyModulusBits E002 }} Bit):</p>
<p>
<code>{{ keyModulus E002 }}</code>
</p>
<p>Hash (SHA-256):</p>
<p>
<code>{{ sha256 E002 }}</code>
</p>
<p>Je confirme par la présente les clés publiques ci-dessus.</p>
<br/>
<br/>
<br/>
<br/>
<table>
<tr>
<td>_________________________</td>
<td>_________________________</td>
<td>_________________________</td>
</tr>
<tr>
<td>Lieu/Date</td>
<td>Nom/Entreprise</td>
<td>Signature</td>
</tr>
</table>
</div>
</body>
</html>