/// <inheritdoc /> /// <summary> /// Gets the transactions view model. /// </summary> /// <param name="umbracoContext">The umbraco context.</param> /// <returns></returns> public IEnumerable <BraintreeTransactionViewModel> GetTransactionsViewModel(UmbracoContext umbracoContext) { loggingService.Info(GetType()); List <BraintreeTransactionViewModel> viewModels = new List <BraintreeTransactionViewModel>(); PaymentSettingsModel model = paymentProvider.GetPaymentSettingsModel(umbracoContext); if (model.PaymentsEnabled) { transactionsRepository.SetKey(umbracoContext); bool exists = transactionsRepository.Exists(); if (exists) { return(transactionsRepository.Get <IEnumerable <BraintreeTransactionViewModel> >()); } ResourceCollection <Transaction> transactions = paymentProvider.GetBraintreeTransactions(model); viewModels = (from Transaction transaction in transactions select transactionTranslator.Translate(transaction)) .ToList(); transactionsRepository.Add(viewModels); } return(viewModels); }