mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-11-22 06:02:09 +00:00
Return body error code
This commit is contained in:
parent
b259ac76d6
commit
ab2853956c
@ -94,8 +94,9 @@ module.exports = class Client {
|
|||||||
return {
|
return {
|
||||||
orderData: res.orderData(),
|
orderData: res.orderData(),
|
||||||
orderId: res.orderId(),
|
orderId: res.orderId(),
|
||||||
returnCode: res.returnCode(),
|
returnAuthCode: res.returnCode(),
|
||||||
reportText: res.reportText(),
|
reportAuthText: res.reportText(),
|
||||||
|
returnBodyCode: res.returnCode('body'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,9 +69,11 @@ module.exports = (xml, keys) => ({
|
|||||||
return node.length ? node[0].textContent : '';
|
return node.length ? node[0].textContent : '';
|
||||||
},
|
},
|
||||||
|
|
||||||
returnCode() {
|
returnCode(where = 'header') {
|
||||||
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
|
const select = xpath.useNamespaces({ xmlns: 'urn:org:ebics:H004' });
|
||||||
const node = select('//xmlns:header/xmlns:mutable/xmlns:ReturnCode', this.doc);
|
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 : '';
|
return node.length ? node[0].textContent : '';
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user