Async read and write keys

This commit is contained in:
Vladislav Hristov
2018-06-27 17:59:35 +03:00
parent 9cfed8ec81
commit 9660242234
5 changed files with 52 additions and 32 deletions

View File

@@ -7,8 +7,8 @@ const Crypto = require('../../../crypto/Crypto');
const genericSerializer = require('./generic');
module.exports = {
use(order, client) {
const keys = client.keys();
async use(order, client) {
const keys = await client.keys();
const ebicsAccount = {
partnerId: client.partnerId,
userId: client.userId,

View File

@@ -118,8 +118,8 @@ const process = {
};
module.exports = {
use(order, client) {
const keys = client.keys();
async use(order, client) {
const keys = await client.keys();
const { orderDetails, transactionId } = order;
const { xmlOptions, xmlSchema, productString } = genericSerializer(client.host, transactionId);
const orderType = orderDetails.OrderType.toUpperCase();

View File

@@ -47,19 +47,17 @@ const encryptedOrderData = (document, transactionKey) => {
};
module.exports = {
use(order, client) {
const keys = client.keys();
async use(order, client) {
const keys = await client.keys();
const ebicsAccount = {
partnerId: client.partnerId,
userId: client.userId,
hostId: client.hostId,
};
const {
transactionId, document,
} = order;
const { transactionId, document } = order;
const {
rootName, xmlOptions, xmlSchema, transfer,
} = downloadSerializer.use(order, client);
} = await downloadSerializer.use(order, client);
this.rootName = rootName;
this.xmlOptions = xmlOptions;