node-ebics-client/lib/orders/HAC.js

55 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-05-17 15:03:59 +00:00
'use strict';
const GenericOrder = require('./GenericOrder');
module.exports = class HAC extends GenericOrder {
2018-06-01 13:16:43 +00:00
constructor(client, from = null, to = null) {
2018-05-17 15:03:59 +00:00
super(client);
this._from = from;
2018-06-01 13:16:43 +00:00
this._to = to;
2018-05-17 15:03:59 +00:00
this._schema.header = {
2018-06-01 13:16:43 +00:00
'@': { authenticate: true },
2018-05-17 15:03:59 +00:00
static: {
2018-06-01 13:16:43 +00:00
HostID: this.hostId,
Nonce: this.nonce(),
2018-05-17 15:03:59 +00:00
Timestamp: this.timestamp(),
PartnerID: this.partnerId,
2018-06-01 13:16:43 +00:00
UserID: this.userId,
Product: {
'@': { Language: 'de' },
'#': this.productString,
2018-05-17 15:03:59 +00:00
},
OrderDetails: {
2018-06-01 13:16:43 +00:00
OrderType: 'HAC',
OrderAttribute: 'DZHNN',
2018-05-17 15:03:59 +00:00
StandardOrderParams: this._hasDateRange() ? {
DateRange: {
Start: this._from,
2018-06-01 13:16:43 +00:00
End: this._to,
},
} : '',
2018-05-17 15:03:59 +00:00
},
BankPubKeyDigests: {
Authentication: {
2018-06-01 13:16:43 +00:00
'@': { Version: 'X002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankX().publicDigest(),
2018-05-17 15:03:59 +00:00
},
Encryption: {
2018-06-01 13:16:43 +00:00
'@': { Version: 'E002', Algorithm: 'http://www.w3.org/2001/04/xmlenc#sha256' },
'#': this.client.bankE().publicDigest(),
},
2018-05-17 15:03:59 +00:00
},
2018-06-01 13:16:43 +00:00
SecurityMedium: '0000',
2018-05-17 15:03:59 +00:00
},
mutable: {
2018-06-01 13:16:43 +00:00
TransactionPhase: 'Initialisation',
},
2018-05-17 15:03:59 +00:00
};
2018-06-01 13:16:43 +00:00
}
2018-05-17 15:03:59 +00:00
_hasDateRange() {
return this._from && this._to;
}
};