public ActionResult GetPaymentData(string callId) { ViewBag.Message = "Visa Checkout - GetPaymentData result."; ViewBag.CallId = callId; GetPaymentData request = new GetPaymentData(callId, ApiKey) { DataLevel = VisaHelper.Options.DataLevels.FULL }; string response; bool success = request.SendRequest(SharedKey, out response); SuccessModel model = new SuccessModel(); if (success) { dynamic result = JsonConvert.DeserializeObject(response); model.UnencryptedData = JsonConvert.SerializeObject(result, Formatting.Indented); } else { TempData.Add("error", response); } return(View(model)); }
internal bool CompleteOrder(List <Product> listOfOrderItems, Customer activeCustomer) { //choose customer payment option. //when option is chosen it should be added to the open order. var total = 0.0; foreach (var product in listOfOrderItems) { total += product.Price; } Console.WriteLine($"Your order Total is {total} Ready to Purchase? (Y/N)"); var userInput = (Console.ReadLine()).ToUpper(); if (userInput == "Y") { var paymentData = new GetPaymentData(); var customerPaymentData = paymentData.GetPaymentsByCustomerID(activeCustomer.CustomerID); View menu = new View(); foreach (var payment in customerPaymentData) { menu.AddMenuOption(payment.PaymentType); } Console.WriteLine(menu.GetFullMenu()); // get the users payment type //add that payment type to Order } return(true); }