Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve readme, update xml-crypto, fix ci. #96

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 18, 19, 20 ]
node: [ 18, 20, 22 ]
name: Node.js ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
Expand Down
49 changes: 37 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,55 @@
<a href='https://coveralls.io/github/eCollect/node-ebics-client?branch=master' title="Coverage Status"><img src='https://coveralls.io/repos/github/eCollect/node-ebics-client/badge.svg?branch=master' alt='Coverage Status' /></a>
</p>

Pure node.js ( >=8 ) implementation of [EBICS](https://en.wikipedia.org/wiki/Electronic_Banking_Internet_Communication_Standard) ( Electronic Banking Internet Communication ).
Pure Node.js (>= 16) implementation of [EBICS](https://en.wikipedia.org/wiki/Electronic_Banking_Internet_Communication_Standard) (Electronic Banking Internet Communication).

The client is aimed to be 100% [ISO 20022](https://www.iso20022.org) compliant, and supports the complete initializations process ( INI, HIA, HPB orders ) and HTML letter generation.
The client is aimed to be 100% [ISO 20022](https://www.iso20022.org) compliant, and supports the complete initializations process (INI, HIA, HPB orders) and HTML letter generation.

## Usage

For examples on how to use this library, take a look at the [examples](https://github.com/node-ebics/node-ebics-client/tree/master/examples).

### A note on recent Node.js versions

The latest Node.js versions don't support `RSA_PKCS1_PADDING` for private decryption for security reasons, throwing an error like _TypeError: RSA_PKCS1_PADDING is no longer supported for private decryption, this can be reverted with --security-revert=CVE-2023-46809_.

EBICS requires this mode, so in order for this library to work, add the following parameter when starting Node.js: `--security-revert=CVE-2023-46809`

### Initialization

1. Create a configuration (see [example configs](https://github.com/node-ebics/node-ebics-client/tree/master/examples/config)) with the EBICS credentials you received from your bank and name it in this schema: `config.<environment>.<bank>[.<entity>].json` (the entity is optional).

- The fields `url`, `partnerId`, `userId`, `hostId` are provided by your bank.
- The `passphrase` is used to encrypt the keys file, which will be stored at the `storageLocation`.
- The `bankName` and `bankShortName` are used internally for creating files and identifying the bank to you.
- The `languageCode` is used when creating the Initialization Letter and can be either `de`, `en`, or `fr`.
- You can chose any environment, bank and, optionally, entity name. Entities are useful if you have multiple EBICS users for the same bank account.

2. Run `node examples/initialize.js <environment> <bank> [entity]` to generate your key pair and perform the INI and HIA orders (ie. send the public keys to your bank)
The generated keys are stored in the file specified in your config and encrypted with the specified passphrase.
3. Run `node examples/bankLetter.js <environment> <bank> [entity]` to generate the Initialization Letter
4. Print the letter, sign it and send it to your bank. Wait for them to activate your EBICS account.
5. Download the bank keys by running `node examples/save-bank-keys.js <environment> <bank> [entity]`

If all these steps were executed successfully, you can now do all things EBICS, like fetching bank statements by running `node examples/send-sta-order.js <environment> <bank> [entity]`, or actually use this library in your custom banking applications.

## Supported Banks
The client is currently tested and verified to work with the following banks:

* [Credit Suisse (Schweiz) AG](https://www.credit-suisse.com/ch/en.html)
* [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/)
The client is currently tested and verified to work with the following banks:

- [Credit Suisse (Schweiz) AG](https://www.credit-suisse.com/ch/en.html)
- [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

The basic concept of this library was inspired by the [EPICS](https://github.com/railslove/epics) library from the Railslove Team.


## Copyright

Copyright: Dimitar Nanov, 2019-2022.
Licensed under the [MIT](LICENSE) license.

2 changes: 1 addition & 1 deletion examples/bankLetter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const os = require('os');
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 template = fs.readFileSync("./templates/ini_"+client.languageCode+".hbs", { encoding: 'utf8'});
const bankLetterFile = path.join("./", "bankLetter_"+client.bankShortName+"_"+client.languageCode+".html");

const letter = new ebics.BankLetter({ client, bankName, template });
Expand Down
67 changes: 46 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"scripts": {
"lint": "eslint .",
"test": "nyc mocha test/**/*.js",
"test": "nyc node --security-revert=CVE-2023-46809 ./node_modules/.bin/mocha test/**/*.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"version": "auto-changelog -p -t changelog-template.hbs && git add CHANGELOG.md"
},
Expand Down Expand Up @@ -69,7 +69,7 @@
"node-forge": "^1.3.1",
"rock-req": "^5.1.3",
"uuid": "^9.0.1",
"xml-crypto": "^4.0.1",
"xml-crypto": "^6.0.0",
"xpath": "0.0.32"
},
"devDependencies": {
Expand Down
Loading