Index: trunk/eCard/eCardMVC/Platnosci.Core/Platnosci.Core.csproj
===================================================================
--- trunk/eCard/eCardMVC/Platnosci.Core/Platnosci.Core.csproj (revision 927)
+++ trunk/eCard/eCardMVC/Platnosci.Core/Platnosci.Core.csproj (revision 934)
@@ -35,5 +35,5 @@
     <Reference Include="Elmah, Version=1.1.11517.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\Documents and Settings\Administrator\Pulpit\bin\net-3.5\Debug\Elmah.dll</HintPath>
+      <HintPath>..\lib\Elmah.dll</HintPath>
     </Reference>
     <Reference Include="System" />
@@ -72,4 +72,5 @@
     <Compile Include="Interface\ITranslateManager.cs" />
     <Compile Include="Linq\DataContext1.cs" />
+    <Compile Include="Linq\Merchant.cs" />
     <Compile Include="Linq\Payer.cs" />
     <Compile Include="Linq\Platnosci.cs">
Index: trunk/eCard/eCardMVC/Platnosci.Core/Linq/Merchant.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci.Core/Linq/Merchant.cs (revision 934)
+++ trunk/eCard/eCardMVC/Platnosci.Core/Linq/Merchant.cs (revision 934)
@@ -0,0 +1,13 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace Platnosci.Core.Linq
+{
+    public class Merchant
+    {
+        public string merchntId { get; set; }
+        public string merchantPassword { get; set; }
+    }
+}
Index: trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs (revision 933)
+++ trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs (revision 934)
@@ -98,8 +98,9 @@
             Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity(User, ""), null);
         }
-        public ErrorViewData InitErrorViewData(string errortxt)
+        public ErrorViewData InitErrorViewData(string errortxt, int idFaktury)
         {
             ErrorViewData er = new ErrorViewData();
             er.Error = errortxt;
+            er.InvoiceId = idFaktury;
             return er;
         }
Index: trunk/eCard/eCardMVC/Platnosci/App_GlobalResources/tlumaczenia.pl.resx
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/App_GlobalResources/tlumaczenia.pl.resx (revision 927)
+++ trunk/eCard/eCardMVC/Platnosci/App_GlobalResources/tlumaczenia.pl.resx (revision 934)
@@ -145,7 +145,4 @@
     <value>Wyloguj</value>
   </data>
-  <data name="Informacja" xml:space="preserve">
-    <value>Trwa przekierowanie na stronę autoryzacyjną eCard...</value>
-  </data>
   <data name="Miasto" xml:space="preserve">
     <value>Miasto:</value>
@@ -201,6 +198,5 @@
   </data>
   <data name="KolejnaProba" xml:space="preserve">
-    <value>Spróbuj ponownie...
-</value>
+    <value>Spróbuj ponownie...</value>
   </data>
   <data name="podziekowania" xml:space="preserve">
Index: trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs (revision 933)
+++ trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs (revision 934)
@@ -20,6 +20,4 @@
         public const string KODOWANIE = "ISO-8859-2";
         public const string HASH_ERROR_INFO = "payment not exist";
-        private string _merchantId;
-        private string _merchantPassword;
 
         private readonly IRepository<vPlatnosciEcard> _repVPayment;
@@ -44,15 +42,9 @@
             var platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault();
                  
-            if (platnosc == null)
-            {
-                ErrorViewData errorViewData = _funkcjePlatnosci.InitErrorViewData(_translateManager.Translate("tlumaczenia", "brakdanych"));
-                return View("Error1", errorViewData);
-            }
+            if (platnosc == null) 
+                return View("Error1", IsError("brakdanych", 0));
             
             if (!_funkcjePlatnosci.UserIdentity(platnosc, ControllerContext.HttpContext.User.Identity.Name))
-            {
-                ErrorViewData errorViewData = _funkcjePlatnosci.InitErrorViewData(_translateManager.Translate("tlumaczenia", "weryfikacja"));
-                return View("Error1", errorViewData);
-            }
+                return View("Error1", IsError("weryfikacja", 0));           
 
             var waluta = _funkcjePlatnosci.setAmount(platnosc);
@@ -64,22 +56,13 @@
             
             if (createPayment == false)
-            {
-                ErrorViewData errorViewData = _funkcjePlatnosci.InitErrorViewData(_translateManager.Translate("tlumaczenia", "error_hash"));
-                errorViewData.InvoiceId = payer.Id_faktury;
-                return View("Error1", errorViewData);
-            }
+                return View("Error1", IsError("error_hash", payer.Id_faktury));
 
-            _merchantId = systemKs == "1" ? "171485000" : "170906000";
-            _merchantPassword = systemKs == "1" ? "ashSeth2" : "JaYpqfs0";
+            var merchant = getMerchantInfo(systemKs);          
 
-            var hash = GetHash(newPayment, _merchantId, _merchantPassword);
+            var hash = GetHash(newPayment, merchant);
             hash = hash.Replace("\n","");
-            
+          
             if (hash == BAD_HASH || hash == "" || hash == HASH_ERROR_INFO)
-            {
-                ErrorViewData errorViewData = _funkcjePlatnosci.InitErrorViewData(_translateManager.Translate("tlumaczenia", "error_hash"));
-                errorViewData.InvoiceId = payer.Id_faktury;
-                return View("Error1", errorViewData);
-            }
+                return View("Error1", IsError("error_hash", payer.Id_faktury));
 
             //przeslanie w linku ordernumber potrzebnego do wyswietlenia potwierdzenia
@@ -94,7 +77,7 @@
             linkOk += "/" + newPayment.IDFaktury + "?o=" + orderek;
             
-            SendRequest(newPayment, hash, _merchantId, linkFail, linkOk);
+            SendRequest(newPayment, hash, merchant, linkFail, linkOk);
             return new EmptyResult();          
-        }
+        }        
         private PlatnosciEcard InitNewPayment(int id, vPlatnosciEcard platnosc, Waluta waluta, Payer payer)
         {
@@ -131,5 +114,5 @@
         }
 
-        private string GetHash(PlatnosciEcard p, string merchantId, string merchantPassword)
+        private string GetHash(PlatnosciEcard p, Merchant merchant)
         {
             var platnosc = _repPayment.Find(i => i.ORDERDESCRIPTION == p.ORDERDESCRIPTION && i.IDFaktury == p.IDFaktury && i.Data == p.Data).First();
@@ -141,5 +124,5 @@
             var dane = "&orderDescription=&amount=" + platnosc.AMOUNT;
             dane += "&currency=" + platnosc.CURRENCY;
-            dane += string.Format("&merchantId={0}&password={1}", merchantId, merchantPassword);
+            dane += string.Format("&merchantId={0}&password={1}", merchant.merchntId, merchant.merchantPassword);
 
             var bdata = System.Text.Encoding.ASCII.GetBytes(dane);
@@ -159,5 +142,5 @@
         }
 
-        private void SendRequest(PlatnosciEcard m, string hash, string merchantid, string linkok, string linkfail)
+        private void SendRequest(PlatnosciEcard m, string hash, Merchant merchant, string linkok, string linkfail)
         {
             var adres = ConfigurationManager.AppSettings["eCard.Url"] + "?ORDERDESCRIPTION=" + m.ORDERDESCRIPTION;
@@ -165,8 +148,34 @@
             var dane = "&AMOUNT=" + m.AMOUNT + "&CURRENCY=" + m.CURRENCY + "&ORDERNUMBER=" + m.ORDERNUMBER;
             dane += "&NAME=" + m.NAME + "&SURNAME=" + m.SURNAME + "&LANGUAGE=" + m.LANGUAGE + "&CHARSET=ISO-8859-2";
-            dane += "&COUNTRY=616&PAYMENTTYPE=CARDS&JS=1&HASH=" + hash + "&MERCHANTID=" + merchantid + "&AUTODEPOSIT=" + m.AUTODEPOSIT;
+            dane += "&COUNTRY=616&PAYMENTTYPE=CARDS&JS=1&HASH=" + hash + "&MERCHANTID=" + merchant.merchntId + "&AUTODEPOSIT=" + m.AUTODEPOSIT;
             dane += "&LINKFAIL=" + linkfail + "&LINKOK=" + linkok + "&SESSIONID=" + m.SESSIONID;
             Response.Redirect(adres + dane);
         }
+        public ErrorViewData IsError(string errortxt, int idFaktury)
+        {
+            if (errortxt == "brakdanych")
+                errortxt = _translateManager.Translate("tlumaczenia", "brakdanych");
+            else if (errortxt == "weryfikacja")
+                errortxt = _translateManager.Translate("tlumaczenia", "weryfikacja");
+            else if (errortxt == "error_hash")
+                errortxt = _translateManager.Translate("tlumaczenia", "error_hash");
+
+            return _funkcjePlatnosci.InitErrorViewData(errortxt, idFaktury);
+        }
+        public Merchant getMerchantInfo( string systemKs)
+        {
+            var merchant = new Merchant();
+            if (systemKs == "1")
+            {
+                merchant.merchntId = "171485000";
+                merchant.merchantPassword = "ashSeth2";
+            }
+            else
+            {
+                merchant.merchntId = "170906000";
+                merchant.merchantPassword = "JaYpqfs0";
+            }              
+            return merchant;
+        }
     }
 }
Index: trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
===================================================================
--- trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (revision 933)
+++ trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs (revision 934)
@@ -199,5 +199,5 @@
                 errortxt = _translateManager.Translate("tlumaczenia","weryfikacja");
 
-            return _funkcjePlatnosci.InitErrorViewData(errortxt);
+            return _funkcjePlatnosci.InitErrorViewData(errortxt,0);
         }
 
Index: trunk/eCard/eCardMVC/Platnosci.Tests/Platnosci.Tests.csproj
===================================================================
--- trunk/eCard/eCardMVC/Platnosci.Tests/Platnosci.Tests.csproj (revision 931)
+++ trunk/eCard/eCardMVC/Platnosci.Tests/Platnosci.Tests.csproj (revision 934)
@@ -38,5 +38,5 @@
     <Reference Include="Moq, Version=4.0.812.4, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\Documents and Settings\Administrator\Pulpit\Moq.4.0.812.4-bin\Moq.dll</HintPath>
+      <HintPath>..\lib\Moq.dll</HintPath>
     </Reference>
     <Reference Include="MvcContrib, Version=1.5.996.0, Culture=neutral, processorArchitecture=MSIL">
@@ -78,5 +78,5 @@
     <Reference Include="WatiN.Core, Version=2.0.10.928, Culture=neutral, PublicKeyToken=db7cfd3acb5ad44e, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\Documents and Settings\Administrator\Pulpit\WatiN-2.0.10.928-net-2.0\bin\WatiN.Core.dll</HintPath>
+      <HintPath>..\lib\WatiN.Core.dll</HintPath>
     </Reference>
   </ItemGroup>
