mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2025-08-14 03:35:36 +00:00
initial commit
This commit is contained in:
22
lib/middleware/ParseResponse.js
Normal file
22
lib/middleware/ParseResponse.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const Response = require('../Response');
|
||||
|
||||
module.exports = class ParseResponse {
|
||||
constructor(client, data) {
|
||||
this.client = client;
|
||||
this.data = data;
|
||||
};
|
||||
|
||||
static go (client, data) {
|
||||
const parseRensponse = new ParseResponse(client, data);
|
||||
const response = new Response(client, data);
|
||||
|
||||
// TODO:
|
||||
// raise error if any
|
||||
|
||||
this.data = response.doc;
|
||||
|
||||
return response;
|
||||
}
|
||||
};
|
22
lib/middleware/XMLSign.js
Normal file
22
lib/middleware/XMLSign.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const Signer = require('../Signer');
|
||||
|
||||
module.exports = class XMLSign {
|
||||
constructor(client, data) {
|
||||
this.client = client;
|
||||
this.data = data;
|
||||
};
|
||||
|
||||
static go (client, data) {
|
||||
const xmlSigner = new XMLSign(client, data);
|
||||
const signer = new Signer(client, data);
|
||||
|
||||
signer.digest();
|
||||
signer.sign();
|
||||
|
||||
this.data = signer.toXML();
|
||||
|
||||
return this.data;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user