Esempio n. 1
0
        public ActionResult EditTransaction(int?transactionId)
        {
            if (transactionId == null)
            {
                ModelState.AddModelError("InvalidRequest", "Invalid transaction id");
            }
            var transaction = _transactionsService.GetTransaction(transactionId.Value);

            return(View("View", new TransactionModel()
            {
                Id = transaction.Id.Value,
                Account = transaction.Account,
                Amount = transaction.Amount == null ? 0.0M : transaction.Amount.Value,
                CurrencyCode = transaction.CurrencyCode,
                Description = transaction.Description
            }));
        }
Esempio n. 2
0
        public async Task <ActionResult <Transaction> > GetTransaction(string id)
        {
            var transaction = await _service.GetTransaction(new Guid(id));

            if (transaction == null)
            {
                return(NotFound());
            }

            return(transaction);
        }
        public void GetTransactionByTransactionId()
        {
            var result = _transactionsService.GetTransaction(this.AttemptPayment());

            Console.WriteLine("Transaction ID we just got is: " + result.Response.TransactionId + " and is applied to " + result.Response.AppliedTo.Length + " invoices");

            for (var i = 0; i < result.Response.AppliedTo.Length; i++)
            {
                Console.WriteLine("  Applied to invoice " + result.Response.AppliedTo[i].InvoiceId);
            }
        }