Zbiór zmian 877 dla trunk/eCard/eCardMVC/Platnosci/Controllers
- Data:
- 2009-11-16 16:06:37 (16 years ago)
- Lokalizacja:
- trunk/eCard/eCardMVC/Platnosci/Controllers
- Pliki:
-
- 2 zmodyfikowane
-
MerchantController.cs (zmodyfikowane) (7 diffs)
-
PlatnoscController.cs (zmodyfikowane) (2 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs
r870 r877 29 29 public const string KOD_POLSKA = "616"; //kod kraju Akceptanta - Polska 30 30 public const string KODOWANIE = "ISO-8859-2"; 31 private int ORDERNUMBER = 122; 31 32 32 33 private string merchantId; … … 43 44 public ActionResult Merchant(Payer payer, string language) 44 45 { 46 System.Diagnostics.Debug.WriteLine("MerchantController:Merchant:" + language); 45 47 language = _func.setLanguage(language); 46 48 … … 71 73 72 74 string link = ConfigurationManager.AppSettings["StatusLink"]; 73 string LinkFail = link + "? status=fail";74 string LinkOk = link + "? status=ok";75 string LinkFail = link + "?id=" + newPayment.IDFaktury + "&status=fail"; 76 string LinkOk = link + "?id=" + newPayment.IDFaktury + "&status=ok"; 75 77 76 78 var merchantViewData = InitMerchantViewData(newPayment, hash, merchantId, LinkFail, LinkOk); 79 wyslij(merchantViewData, hash, merchantId); 77 80 return View(merchantViewData); 78 81 } … … 90 93 newPayment.SURNAME = payer.LastName; 91 94 newPayment.AUTODEPOSIT = true; 92 newPayment.LANGUAGE = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToUpper(); //"PL";95 newPayment.LANGUAGE = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToUpper(); 93 96 newPayment.CHARSET = KODOWANIE; 94 97 newPayment.COUNTRY = KOD_POLSKA; … … 119 122 120 123 //wartosci testowe 121 merchantViewData.nowaPlatnosc.ORDERNUMBER = 4;122 merchantViewData.nowaPlatnosc.ORDERDESCRIPTION = "22 ";124 merchantViewData.nowaPlatnosc.ORDERNUMBER = ORDERNUMBER; 125 merchantViewData.nowaPlatnosc.ORDERDESCRIPTION = "222"; 123 126 merchantViewData.nowaPlatnosc.AMOUNT = 300; 124 127 merchantViewData.nowaPlatnosc.CURRENCY = "985"; 125 merchantViewData.nowaPlatnosc.SESSIONID = " ";128 merchantViewData.nowaPlatnosc.SESSIONID = "ff"; 126 129 merchantViewData.merchantId = "171485000"; 127 130 merchantViewData.LinkFail = ""; … … 141 144 142 145 //dane testowe 143 string adres = "https://pay.ecard.pl/servlet/HS?orderNumber= 4";146 string adres = "https://pay.ecard.pl/servlet/HS?orderNumber="+ORDERNUMBER; 144 147 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(adres); 145 148 string dane = "&orderDescription=&amount=300¤cy=985&merchantId=171485000&password=ashSeth2"; … … 159 162 160 163 return strResponse; 161 } 164 } 165 private void wyslij(MerchantViewData m, string hash, string id) 166 { 167 string adres = "https://pay.ecard.pl/servlet/PSTEST?ORDERDESCRIPTION="+m.nowaPlatnosc.ORDERDESCRIPTION; 168 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(adres); 169 string dane = "&AMOUNT=300&CURRENCY=985&ORDERNUMBER="+ORDERNUMBER+"&NAME="+m.nowaPlatnosc.NAME+"&SURNAME="+m.nowaPlatnosc.SURNAME+"&LANGUAGE=PL&CHARSET=ISO-8859-2"; 170 dane += "&COUNTRY=616&PAYMENTTYPE=CARDS&JS=1&HASH=" + hash + "&MERCHANTID=171485000&AUTODEPOSIT=" + m.nowaPlatnosc.AUTODEPOSIT + "&LINKFAIL="; 171 dane += "&LINKOK=&SESSIONID="; 172 Response.Redirect(adres + dane); 173 } 162 174 } 163 175 } -
trunk/eCard/eCardMVC/Platnosci/Controllers/PlatnoscController.cs
r873 r877 106 106 if (payer != null) 107 107 { 108 System.Diagnostics.Debug.WriteLine("P ;atnosciController:Show");108 System.Diagnostics.Debug.WriteLine("PlatnosciController:Show"); 109 109 return RedirectToAction("Merchant", "Merchant", payer); 110 } 111 110 } 112 111 else return View("Error"); 113 112 } … … 235 234 public void UpdateStatus(int ordernumber, string validationcode) 236 235 { 237 var platnosc = _repPl.FindOne(i => i.ORDERNUMBER == ordernumber); 236 var platnosc = _rep.FindPaymentByOrdernumber(ordernumber).SingleOrDefault(); 237 //Pl.FindOne(i => i.ORDERNUMBER == ordernumber); 238 238 if (platnosc != null && platnosc.Status == true && validationcode == "000") 239 239 {
