예제 #1
0
        public async Task <HistoryOperation> GetLatestPaymentDetailsAsync(string merchantId, string invoiceId)
        {
            IEnumerable <HistoryOperationViewModel> invoiceOperations =
                await _payHistoryClient.GetHistoryByInvoiceAsync(invoiceId);

            var filteredOperations = invoiceOperations.Where(x =>
                                                             x.Type == PayHistory.AutorestClient.Models.HistoryOperationType.OutgoingInvoicePayment &&
                                                             x.InvoiceStatus == InvoiceStatus.Paid.ToString()).ToList();

            if (!filteredOperations.Any())
            {
                return(null);
            }

            HistoryOperationViewModel operation = filteredOperations.MaxBy(x => x.CreatedOn);

            if (operation == null)
            {
                return(null);
            }

            return(await GetDetailsAsync(merchantId, operation.Id));
        }
예제 #2
0
 private string GetLogoKey(HistoryOperationViewModel historyOperation)
 {
     return(historyOperation.OppositeMerchantId ?? string.Empty);
 }