Index: trunk/eCard/eCardMVC/adMoto.Payments.Web/Controllers/AccountController.cs
===================================================================
--- trunk/eCard/eCardMVC/adMoto.Payments.Web/Controllers/AccountController.cs (revision 971)
+++ trunk/eCard/eCardMVC/adMoto.Payments.Web/Controllers/AccountController.cs (revision 984)
@@ -29,9 +29,9 @@
         }
 
-        public AccountController(IFormsAuthentication formsAuth, IRepository<Invoice> repository, PaymentsUtils func)
+        public AccountController(IFormsAuthentication formsAuth, IRepository<Invoice> repository, PaymentsUtils paymentsUtils)
         {
             _repository = repository;
             FormsAuth = formsAuth ?? new FormsAuthenticationService();
-            _paymentsUtils = func;
+            _paymentsUtils = paymentsUtils;
         }
 
@@ -51,13 +51,14 @@
         {
             _paymentsUtils.SetLanguage(language);
-            var platnosc = new Invoice();
+            var invoice = new Invoice();
+            
             if (!ValidateLogOn(nip, numerFaktury))
-            {
+                return View();            
+            
+            invoice = _repository.FindInvoiceByNipNumber(nip, numerFaktury).SingleOrDefault();
+            
+            if (invoice == null) 
                 return View();
-            }
-            
-            var login = _repository.FindInvoiceByNipNumber(nip, numerFaktury).SingleOrDefault();
-            platnosc = login;
-            if (platnosc == null) return View();
+
             _paymentsUtils.SetUserLogger(nip, numerFaktury);
 
@@ -65,9 +66,7 @@
 
             if (!String.IsNullOrEmpty(returnUrl))
-            {
                 return Redirect(returnUrl);
-            }
             
-            return RedirectToAction("Show", "Platnosc", new { id = platnosc.ID_faktury });
+            return RedirectToAction("Show", "Platnosc", new { id = invoice.ID_faktury });
         }
 
@@ -86,4 +85,5 @@
             if (String.IsNullOrEmpty(nip))
                 ModelState.AddModelError("nip", errNip);
+            
             if (String.IsNullOrEmpty(numerFaktury))
                 ModelState.AddModelError("numerFaktury", errFaktura);
