node-ebics-client/lib/middleware/ParseResponse.js

12 lines
283 B
JavaScript
Raw Normal View History

2018-05-17 15:03:59 +00:00
'use strict';
2018-06-11 12:25:07 +00:00
const H004Response = require('../versions/H004/Response');
2018-05-17 15:03:59 +00:00
module.exports = class ParseResponse {
2018-06-11 12:25:07 +00:00
static parse(data, keys, version) {
if (version.toUpperCase() === 'H004') return new H004Response(data, keys);
2018-05-17 15:03:59 +00:00
2018-06-11 12:25:07 +00:00
throw Error('Unknow EBICS response version');
2018-05-17 15:03:59 +00:00
}
};