/// <summary>
        /// Get payment details from Invoice, PaymentRequest and Order
        /// </summary>
        /// <param name="invoiceId">Invoice Id</param>
        /// <param name="force">Will force to create new order if the actual order is expired but can be considered
        //     as actual till extended due date</param>
        /// <returns></returns>
        public async Task <PaymentDetails> GetPaymentDetailsAsync(string invoiceId, bool force)
        {
            InvoiceModel invoice = await _payInvoiceClient.GetInvoiceAsync(invoiceId);

            if (invoice.DueDate <= DateTime.UtcNow || invoice.Status == InvoiceStatus.Removed)
            {
                return(null);
            }

            Task <MerchantModel> merchantTask = _payMerchantClient.Api.GetByIdAsync(invoice.MerchantId);

            Task <MarkupResponse> markupForMerchantTask =
                _payInternalClient.ResolveMarkupByMerchantAsync(invoice.MerchantId, $"{invoice.PaymentAssetId}{invoice.SettlementAssetId}");

            // now it is important to wait order checkout before making GetPaymentRequest
            // as WalletAddress will be only after that
            Task <OrderModel> orderTask = _payInternalClient.ChechoutOrderAsync(new ChechoutRequestModel
            {
                MerchantId       = invoice.MerchantId,
                PaymentRequestId = invoice.PaymentRequestId,
                Force            = force
            });

            try
            {
                await Task.WhenAll(merchantTask, markupForMerchantTask, orderTask);
            }
            catch (Exception ex)
            {
                _log.ErrorWithDetails(ex, invoice.Sanitize());
                throw;
            }

            OrderModel     order             = orderTask.Result;
            MerchantModel  merchant          = merchantTask.Result;
            MarkupResponse markupForMerchant = markupForMerchantTask.Result;

            PaymentRequestModel paymentRequest =
                await _payInternalClient.GetPaymentRequestAsync(invoice.MerchantId, invoice.PaymentRequestId);

            Asset settlementAsset = await _lykkeAssetsResolver.TryGetAssetAsync(invoice.SettlementAssetId);

            Asset paymentAsset = await _lykkeAssetsResolver.TryGetAssetAsync(invoice.PaymentAssetId);

            int totalSeconds             = 0;
            int remainingSeconds         = 0;
            int extendedTotalSeconds     = 0;
            int extendedRemainingSeconds = 0;

            if (invoice.Status == InvoiceStatus.Unpaid)
            {
                totalSeconds     = (int)(order.DueDate - order.CreatedDate).TotalSeconds;
                remainingSeconds = (int)(order.DueDate - DateTime.UtcNow).TotalSeconds;

                if (remainingSeconds > totalSeconds)
                {
                    remainingSeconds = totalSeconds;
                }

                extendedTotalSeconds     = (int)(order.ExtendedDueDate - order.DueDate).TotalSeconds;
                extendedRemainingSeconds = (int)(order.ExtendedDueDate - DateTime.UtcNow).TotalSeconds;

                if (extendedRemainingSeconds > extendedTotalSeconds)
                {
                    extendedRemainingSeconds = extendedTotalSeconds;
                }
            }

            return(new PaymentDetails
            {
                Id = invoice.Id,
                Number = invoice.Number,
                Status = invoice.Status,
                Merchant = merchant,
                PaymentAmount = order.PaymentAmount,
                SettlementAmount = invoice.Amount,
                PaymentAssetId = invoice.PaymentAssetId,
                PaymentAsset = paymentAsset,
                SettlementAssetId = invoice.SettlementAssetId,
                SettlementAsset = settlementAsset,
                ExchangeRate = order.ExchangeRate,
                DeltaSpread = markupForMerchant.DeltaSpread > 0,
                Pips = markupForMerchant.Pips + paymentRequest.MarkupPips,
                Percents = markupForMerchant.DeltaSpread + markupForMerchant.Percent + paymentRequest.MarkupPercent,
                Fee = markupForMerchant.FixedFee + paymentRequest.MarkupFixedFee,
                DueDate = invoice.DueDate,
                Note = invoice.Note,
                WalletAddress = paymentRequest.WalletAddress,
                PaymentRequestId = invoice.PaymentRequestId,
                TotalSeconds = totalSeconds,
                RemainingSeconds = remainingSeconds,
                ExtendedTotalSeconds = extendedTotalSeconds,
                ExtendedRemainingSeconds = extendedRemainingSeconds,
                PaidAmount = paymentRequest.PaidAmount,
                PaidDate = paymentRequest.PaidDate
            });
        }