public Task <DealTransaction> CaptureCardTransaction() { var transaction = new DealTransaction { AuthorizationCode = GetGenericCode(), CardBrand = CardBrand, TransactionDate = DateTime.Now, Cost = 0, Amount = Amount, Status = TransactionStatus.Paid, Tid = Tid, Nsu = Nsu }; return(Task.FromResult(transaction)); }
public Task <DealTransaction> CancelAuthorization() { var transaction = new DealTransaction { AuthorizationCode = "", CardBrand = CardBrand, TransactionDate = DateTime.Now, Cost = 0, Amount = Amount, Status = TransactionStatus.Cancelled, Tid = Tid, Nsu = Nsu }; return(Task.FromResult(transaction)); }
public Task <DealTransaction> AuthorizeCardTransaction() { var success = new Random().Next(2) == 0; DealTransaction transaction; if (success) { transaction = new DealTransaction { AuthorizationCode = GetGenericCode(), CardBrand = "MasterCard", TransactionDate = DateTime.Now, Cost = Amount * (decimal)0.03, Amount = Amount, Status = TransactionStatus.Authorized, Tid = GetGenericCode(), Nsu = GetGenericCode() }; return(Task.FromResult(transaction)); } transaction = new DealTransaction { AuthorizationCode = "", CardBrand = "", TransactionDate = DateTime.Now, Cost = 0, Amount = 0, Status = TransactionStatus.Refused, Tid = "", Nsu = "" }; return(Task.FromResult(transaction)); }