-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladislav Hristov
authored and
Vladislav Hristov
committed
May 17, 2018
1 parent
cd37de3
commit 1f947ff
Showing
27 changed files
with
1,502 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# @see editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.js] | ||
indent_size = 4 | ||
|
||
[*.tag] | ||
indent_size = 2 | ||
|
||
[*.yml] | ||
indent_size = 2 | ||
|
||
# Trailing whitespace is significant in markdown files. | ||
[*.md] | ||
trim_trailing_whitespace = false | ||
max_line_length = 80 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
SERVER_PORT=3003 | ||
|
||
LOG_LEVEL=info | ||
LOG_ENABLED=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules/ | ||
build/ | ||
static/ | ||
config/ | ||
src/vue-router-custom-components | ||
src/directives/clickAway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"extends": "airbnb", | ||
"env": { | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "script", | ||
"ecmaFeatures": { | ||
"modules": false | ||
} | ||
}, | ||
"rules": { | ||
"max-len": 0, | ||
"linebreak-style": 0, | ||
"no-plusplus": [ | ||
2, | ||
{ | ||
"allowForLoopAfterthoughts": true | ||
} | ||
], | ||
"no-continue": 0, | ||
"indent": [2, "tab"], | ||
"no-tabs": 0, | ||
"strict": [2, "safe"], | ||
"curly": [2, "multi", "consistent"], | ||
"import/no-extraneous-dependencies": 0, | ||
"import/no-unresolved": 0, | ||
"no-underscore-dangle": 0, | ||
"no-param-reassign": 0, | ||
"generator-star-spacing": 0, | ||
"jsx-a11y/href-no-hash": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
npm-debug.log | ||
node_modules | ||
.DS_Store | ||
*.local.json5 | ||
yarn.lock | ||
/project.sublime-workspace | ||
/public/css/style.css.map | ||
/.idea | ||
/.vscode | ||
*.pid | ||
/coverage | ||
package-lock.json | ||
*.key | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# node-ebics-client v0.0.3 | ||
--- | ||
|
||
Pure node.js ( >=8 ) implementation of the [EBICS](https://en.wikipedia.org/wiki/Electronic_Banking_Internet_Communication_Standard) (Electronic Banking Internet Communication). | ||
|
||
The client is aimed to be 100% ISO 20022 complient, and supports complete initilizations process ( INI, HIA, HPB orders ) and HTML letter generation. | ||
|
||
## Supported Banks | ||
The client is tested and verified to work with the following banks: | ||
* Credit Suisse | ||
* Zürcher Kantonalbank | ||
* Raiffeisenbank | ||
|
||
|
||
## Inspiration | ||
|
||
A lot of the concepts in this library are inspired from the [EPICS](https://github.com/railslove/epics) library. | ||
|
||
## Copyright | ||
Copyright (c) 2017 eCollect. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
|
||
const Client = require('./lib/Client'); | ||
module.exports = Client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
|
||
const moment = require('moment'); | ||
const handlebars = require('handlebars'); | ||
const BN = require("bn.js"); | ||
|
||
module.exports = class BankLetter { | ||
constructor(client, bankName) { | ||
this.client = client; | ||
this.bankName = bankName; | ||
this.pathToTemplate = './app/ebics/ini.hbs'; | ||
}; | ||
|
||
_registerHelpers() { | ||
handlebars.registerHelper("today", () => { | ||
return moment().format('DD.MM.YYYY'); | ||
}); | ||
|
||
handlebars.registerHelper("now", () => { | ||
return moment().format('HH:mm:ss'); | ||
}); | ||
|
||
handlebars.registerHelper("keyExponentBits", (k) => { | ||
return Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8; | ||
}); | ||
|
||
handlebars.registerHelper("keyModulusBits", (k) => { | ||
return k.key.getKeySize(); | ||
// return Buffer.byteLength(new BN(k.key.keyPair.e).toBuffer()) * 8; | ||
}); | ||
|
||
handlebars.registerHelper("keyExponent", (k) => { | ||
return k.e(); | ||
}); | ||
|
||
handlebars.registerHelper("keyModulus", (k) => { | ||
return k.n().toUpperCase().match(/.{1,2}/g).join(' '); | ||
}); | ||
|
||
handlebars.registerHelper("sha256", (k) => { | ||
const digest = Buffer(k.publicDigest(), 'base64').toString('HEX'); | ||
|
||
return digest.toUpperCase().match(/.{1,2}/g).join(' '); | ||
}); | ||
}; | ||
|
||
generate() { | ||
this._registerHelpers(); | ||
|
||
const str = fs.readFileSync(this.pathToTemplate).toString(); | ||
const templ = handlebars.compile(str); | ||
|
||
const data = { | ||
bankName : this.bankName, | ||
userId : this.client.userId, | ||
partnerId: this.client.partnerId, | ||
A006 : this.client.a(), | ||
X002 : this.client.x(), | ||
E002 : this.client.e(), | ||
}; | ||
|
||
return templ(data); | ||
} | ||
} |
Oops, something went wrong.