- Data:
- 2009-12-01 16:08:32 (16 years ago)
- Lokalizacja:
- trunk/eCard/eCardMVC
- Pliki:
-
- 1 dodane
- 7 zmodyfikowane
-
Platnosci.Tests/Platnosci.Tests.csproj (zmodyfikowane) (1 diff)
-
Platnosci.Tests/Web/FakeTranslate.cs (zmodyfikowane) (1 diff)
-
Platnosci.Tests/Web/MerchantControllerTests.cs (dodane)
-
Platnosci/App_GlobalResources/tlumaczenia.designer.cs (zmodyfikowane) (1 diff)
-
Platnosci/App_GlobalResources/tlumaczenia.resx (zmodyfikowane) (1 diff)
-
Platnosci/Controllers/MerchantController.cs (zmodyfikowane) (3 diffs)
-
Platnosci/Controllers/PlatnoscController.cs (zmodyfikowane) (2 diffs)
-
Platnosci/Views/Platnosc/Fail.aspx (zmodyfikowane) (1 diff)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/Platnosci.Tests/Platnosci.Tests.csproj
r911 r919 79 79 <ItemGroup> 80 80 <Compile Include="Properties\AssemblyInfo.cs" /> 81 <Compile Include="Web\MerchantControllerTests.cs" /> 81 82 <Compile Include="Web\FakeDataContext.cs" /> 82 83 <Compile Include="Web\FakeTranslate.cs" /> -
trunk/eCard/eCardMVC/Platnosci.Tests/Web/FakeTranslate.cs
r904 r919 11 11 public string TranslateStr(string className, string keyName) 12 12 { 13 if(keyName == "weryfikacja") return "weryfikacja"; 14 else if(keyName == "brakdanych") return "brakdanych"; 15 else if(keyName == "zaplacono") return "zaplacono"; 16 else if(keyName == "err_imieWK") return "imie"; 17 else if(keyName == "err_nazwiskoWK") return "nazwisko"; 18 13 if (keyName == "weryfikacja") return "weryfikacja"; 14 else if (keyName == "brakdanych") return "brakdanych"; 15 else if (keyName == "zaplacono") return "zaplacono"; 16 else if (keyName == "err_imieWK") return "imie"; 17 else if (keyName == "err_nazwiskoWK") return "nazwisko"; 18 else if (keyName == "error_hash") return "error_hash"; 19 19 20 return ""; 20 21 } -
trunk/eCard/eCardMVC/Platnosci/App_GlobalResources/tlumaczenia.designer.cs
r915 r919 534 534 535 535 /// <summary> 536 /// Looks up a localized string similar to PÅatnoÅÄ w trakcie realizacji.... 537 /// </summary> 538 internal static string wtrakcie { 539 get { 540 return ResourceManager.GetString("wtrakcie", resourceCulture); 541 } 542 } 543 544 /// <summary> 536 545 /// Looks up a localized string similar to Log out. 537 546 /// </summary> -
trunk/eCard/eCardMVC/Platnosci/App_GlobalResources/tlumaczenia.resx
r915 r919 296 296 <value>Sorry! An unexpected error has occured.</value> 297 297 </data> 298 <data name="wtrakcie" xml:space="preserve"> 299 <value>PÅatnoÅÄ w trakcie realizacji...</value> 300 </data> 298 301 </root> -
trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs
r917 r919 33 33 34 34 private readonly IRepository<vPlatnosciEcard> _repVPayment; 35 private readonly IRepository<PlatnosciEcard> _repPayment; 35 private readonly IRepository<PlatnosciEcard> _repPayment; 36 36 private FunkcjePlatnosci _func; 37 37 private ITranslate _t; … … 88 88 else merchantId = "171485000"; 89 89 90 //przeslanie w linku ordernumber potrzebnego do wyswietlenia potwierdzenia 91 int orderek = 0; 92 orderek = _repPayment.GetOrdernumber(newPayment.ORDERDESCRIPTION, newPayment.IDFaktury, newPayment.Data); 93 90 94 string LinkFail = ConfigurationManager.AppSettings["Strona"]; 91 95 LinkFail += "/" + language + ConfigurationManager.AppSettings["LinkFail"]; 92 LinkFail += "/" + newPayment.IDFaktury ;96 LinkFail += "/" + newPayment.IDFaktury + "?o=" + orderek; 93 97 94 98 string LinkOk = ConfigurationManager.AppSettings["Strona"]; 95 99 LinkOk += "/" + language + ConfigurationManager.AppSettings["LinkOk"]; 96 LinkOk += "/" + newPayment.IDFaktury ;100 LinkOk += "/" + newPayment.IDFaktury + "?o=" + orderek; ; 97 101 102 //merchantid dla srodowiska testowego 103 merchantId = "171485000"; 98 104 wyslij(newPayment, hash, merchantId, LinkFail, LinkOk); 99 105 return new EmptyResult(); … … 162 168 return strResponse; 163 169 } 164 private void wyslij(PlatnosciEcard m, string hash, string id, string linkok, string linkfail)170 private void wyslij(PlatnosciEcard m, string hash, string merchantid, string linkok, string linkfail) 165 171 { 172 //string adres = "https://pay.ecard.pl/payment/PS?ORDERDESCRIPTION=" + m.ORDERDESCRIPTION; 173 166 174 string adres = "https://pay.ecard.pl/servlet/PSTEST?ORDERDESCRIPTION=" + m.ORDERDESCRIPTION; 167 175 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(adres); 168 176 string dane = "&AMOUNT=" + m.AMOUNT + "&CURRENCY=" + m.CURRENCY + "&ORDERNUMBER=" + m.ORDERNUMBER; 169 177 dane += "&NAME=" + m.NAME + "&SURNAME=" + m.SURNAME + "&LANGUAGE=" + m.LANGUAGE + "&CHARSET=ISO-8859-2"; 170 dane += "&COUNTRY=616&PAYMENTTYPE=CARDS&JS=1&HASH=" + hash + "&MERCHANTID= 171485000&AUTODEPOSIT=" + m.AUTODEPOSIT;178 dane += "&COUNTRY=616&PAYMENTTYPE=CARDS&JS=1&HASH=" + hash + "&MERCHANTID=" + merchantid + "&AUTODEPOSIT=" + m.AUTODEPOSIT; 171 179 dane += "&LINKFAIL=" + linkfail + "&LINKOK=" + linkok + "&SESSIONID=" + m.SESSIONID; 172 180 Response.Redirect(adres + dane); -
trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
r911 r919 89 89 kwota = _func.BruttoToString(platnosc.Brutto, platnosc.waluta_brutto, platnosc.waluta_miano); 90 90 var viewData = InitInvoiceDetailsViewData(platnosc, payer, "", kwota ); 91 return View("Show",viewData); 91 return View("Show",viewData); 92 92 } 93 93 if (payer != null) … … 108 108 return View(invoiceDeatailsViewData); 109 109 } 110 public ActionResult Fail(string id, string language) 111 { 110 public ActionResult Fail(string id, string language, string o) 111 { 112 int order = ConvertId(o); 112 113 language = _func.setLanguage(language); 113 114 int id1 = ConvertId(id); 114 115 vPlatnosciEcard platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault(); 115 116 if (!String.IsNullOrEmpty(Iserror(platnosc).error)) return View("Error1", Iserror(platnosc)); 116 117 118 117 119 var invoiceDeatailsViewData = InitInvoiceDetailsViewData(platnosc, null, "", ""); 120 121 //sprawdzamy czy dla kombinacji ordernumber i idfaktury istnieje platnosc, 122 //jesli tak, to sprawdzamy czy przyszlo potwierdzenie z eCardu. 123 if (order > 0) 124 { 125 PlatnosciEcard pl = _repPayment.Find(p => p.ORDERNUMBER == order && p.IDFaktury == id1).SingleOrDefault(); 126 if (pl != null) 127 { 128 PotwierdzeniaEcard confirm = _repConfirm.Find(p => p.ORDERNUMBER == order).FirstOrDefault(); 129 if (confirm == null) 130 { 131 invoiceDeatailsViewData.info = _t.TranslateStr("tlumaczenia","wtrakcie"); 132 } 133 } 134 135 } 118 136 return View(invoiceDeatailsViewData); 119 137 } -
trunk/eCard/eCardMVC/Platnosci/Views/Platnosc/Fail.aspx
r885 r919 7 7 <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> 8 8 9 <p class="pay_error"> 10 <asp:Label ID="lab2" runat="server" Text="<%$Resources:tlumaczenia,blad1%>"></asp:Label> 11 <%if (Model.vPlatnosciEcard != null && !String.IsNullOrEmpty(Model.vPlatnosciEcard.Faktura_Numer)){%> 12 <%=Model.vPlatnosciEcard.Faktura_Numer%> 13 <%}%> 14 <asp:Label ID="lab3" runat="server" Text="<%$Resources:tlumaczenia,blad2%>"></asp:Label> 15 </p> 16 <%if (Model.vPlatnosciEcard != null && !String.IsNullOrEmpty(Model.vPlatnosciEcard.Faktura_Numer)) 17 { 18 string link2 = HttpContext.GetGlobalResourceObject("tlumaczenia", "KolejnaProba").ToString();%> 19 <p id="link1"><%=Html.ActionLink(link2, "Show", "Platnosc", new { id = ViewData.Model.vPlatnosciEcard.ID_faktury }, null)%></p> 20 <%} 21 else 22 { 23 string link1 = HttpContext.GetGlobalResourceObject("tlumaczenia", "Powrot").ToString(); %> 24 <p id="P1"><%=Html.ActionLink(link1, "LogOn", "Account")%></p> 25 <%} %> 9 <% 10 if (!String.IsNullOrEmpty(Model.info)) 11 { 12 %> 13 <%=Model.info%> 14 <% 15 }else{ 16 %> 17 <p class="pay_error"> 18 <asp:Label ID="lab2" runat="server" Text="<%$Resources:tlumaczenia,blad1%>"></asp:Label> 19 <%if (Model.vPlatnosciEcard != null && !String.IsNullOrEmpty(Model.vPlatnosciEcard.Faktura_Numer)){%> 20 <%=Model.vPlatnosciEcard.Faktura_Numer%> 21 <%}%> 22 <asp:Label ID="lab3" runat="server" Text="<%$Resources:tlumaczenia,blad2%>"></asp:Label> 23 </p> 24 <%if (Model.vPlatnosciEcard != null && !String.IsNullOrEmpty(Model.vPlatnosciEcard.Faktura_Numer)) 25 { 26 string link2 = HttpContext.GetGlobalResourceObject("tlumaczenia", "KolejnaProba").ToString();%> 27 <p id="link1"><%=Html.ActionLink(link2, "Show", "Platnosc", new { id = ViewData.Model.vPlatnosciEcard.ID_faktury }, null)%></p> 28 <%} 29 else 30 { 31 32 string link1 = HttpContext.GetGlobalResourceObject("tlumaczenia", "Powrot").ToString(); %> 33 <p id="P1"><%=Html.ActionLink(link1, "LogOn", "Account")%></p> 34 35 <%} %> 36 <%}%> 26 37 </asp:Content>
