public ActionResult Pay(FormCollection fc)
        {
            string cvv = fc["Customer.Card.CVV"];
            //TODO AR REIKIA VALIDUOTI CVV?

            ActionResult actionResult = GetSessionProperties(out Customer customer, out Cart cart);

            _logger.InfoFormat("Payment for cart price [{1}]", cart.Id, cart.Cost);


            if (actionResult != null)
            {
                return(actionResult);
            }

            var paymentInfo = _customerPaymentService.Pay(customer.Id, cart, cvv);

            _logger.InfoFormat("Payment info : [{0}], for cart with id [{1}]", paymentInfo.OrderStatus, cart.Id);

            Session["Cart"]  = null;
            Session["Count"] = 0;

            return(View(new PaymentViewModel()
            {
                PaymentInfo = paymentInfo, Cart = cart
            }));
        }
Exemple #2
0
        public void Charge(ICustomerPaymentService paymentService, INotificationService notificationService)
        {
            Printer.Print(ConsoleColor.Cyan);

            // do some internal logic

            paymentService.Pay(this);
            notificationService.SendEmail(Email, "Paid successfully", "bla bla bla");
        }
Exemple #3
0
 public void NotifyByEmail(ICustomerPaymentService paymentService)
 {
     Printer.Print(ConsoleColor.Cyan);
     paymentService.Pay(this);
 }
Exemple #4
0
 public void Charge(ICustomerPaymentService paymentService, INotificationService notificationService)
 {
     paymentService.Pay(this);
     notificationService.SendEmail(Email, "Paid successfully", "bla bla bla");
 }