mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-25 07:32:06 +00:00
Fix orderData method
This commit is contained in:
parent
044bbba9e3
commit
5d4e9f8309
@ -78,7 +78,7 @@ module.exports = class Client {
|
||||
const returnedBusinessCode = res.businessCode();
|
||||
|
||||
return {
|
||||
orderData: xml,
|
||||
orderData: xml.length ? xml.toString() : xml,
|
||||
orderId: res.orderId(),
|
||||
|
||||
technicalCode: returnedTechnicalCode,
|
||||
|
@ -47,7 +47,7 @@ module.exports = (xml, keys) => ({
|
||||
const decipher = crypto.createDecipheriv('aes-128-cbc', this.transactionKey(), DEFAULT_IV).setAutoPadding(false);
|
||||
const data = Buffer.from(decipher.update(orderData, 'base64', 'binary') + decipher.final('binary'), 'binary');
|
||||
|
||||
return zlib.inflateSync(data).toString();
|
||||
return zlib.inflateSync(data);
|
||||
},
|
||||
|
||||
transactionKey() {
|
||||
@ -111,17 +111,8 @@ module.exports = (xml, keys) => ({
|
||||
return errors.technical[code].meaning;
|
||||
},
|
||||
|
||||
/* returnCode(where = 'header') {
|
||||
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
|
||||
const node = where === 'header'
|
||||
? select('//xmlns:header/xmlns:mutable/xmlns:ReturnCode', this.doc)
|
||||
: select('//xmlns:body/xmlns:ReturnCode', this.doc);
|
||||
|
||||
return node.length ? node[0].textContent : '';
|
||||
}, */
|
||||
|
||||
bankKeys() {
|
||||
const orderData = this.orderData();
|
||||
const orderData = this.orderData().toString();
|
||||
if (!Object.keys(orderData).length) return {};
|
||||
|
||||
const doc = new DOMParser().parseFromString(orderData, 'text/xml');
|
||||
|
Loading…
Reference in New Issue
Block a user