Zbiór zmian 952 dla trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs
- Data:
- 2009-12-15 14:06:23 (16 years ago)
- Pliki:
-
- 1 zmodyfikowane
-
trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs (zmodyfikowane) (4 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/Platnosci/Controllers/MerchantController.cs
r951 r952 15 15 public class MerchantController : Controller 16 16 { 17 public const string BAD_HASH = "zlyHash"; //b³êdne has³o - odpowied z eCard18 public const string HASH_ERROR_INFO = "payment not exist";19 20 17 private readonly IRepository<vPlatnosciEcard> _repVPayment; 21 18 private readonly IRepository<PlatnosciEcard> _repPayment; … … 28 25 _repVPayment = new Repository<vPlatnosciEcard>(new DataContext()); 29 26 _repPayment = new Repository<PlatnosciEcard>(new DataContext()); 30 _funkcjePlatnosci = new FunkcjePlatnosci( );27 _funkcjePlatnosci = new FunkcjePlatnosci(_repPayment); 31 28 _translateManager = new Translation(); 32 29 _eCardData = new eCardData(_repPayment); … … 36 33 _repVPayment = repVPayment; 37 34 _repPayment = repPayment; 38 _funkcjePlatnosci = new FunkcjePlatnosci();39 35 _translateManager = translate; 36 _funkcjePlatnosci = new FunkcjePlatnosci(_repPayment, _translateManager); 40 37 _eCardData = ecardData; 41 38 } … … 47 44 var id1 = Convert.ToInt32(payer.Id_faktury); 48 45 var platnosc = _repVPayment.Find(p => p.ID_faktury == id1).SingleOrDefault(); 49 50 if (platnosc == null) 51 return View("Error1", IsError("brakdanych", 0)); 52 53 if (!_funkcjePlatnosci.UserIdentity(platnosc, ControllerContext.HttpContext.User.Identity.Name)) 54 return View("Error1", IsError("weryfikacja", 0)); 46 47 var errorViewData = _funkcjePlatnosci.IsError(platnosc, ControllerContext.HttpContext.User.Identity.Name); 48 if (!String.IsNullOrEmpty(errorViewData.Error)) 49 return View("Error1", errorViewData); 55 50 56 51 var merchant = _eCardData.CreateMerchantData(platnosc, payer, language, Session.SessionID); 57 52 58 if (merchant != null) merchant.IsValid();59 60 53 if (merchant == null || (merchant != null && (!String.IsNullOrEmpty(merchant.Error)))) 61 return View("Error1", IsError("error_hash", payer.Id_faktury));54 return View("Error1", _funkcjePlatnosci.InitErrorViewData(_translateManager.Translate("tlumaczenia", "error_hash"), payer.Id_faktury)); 62 55 63 56 var adres = _eCardData.GetUrl(merchant); 64 57 Response.Redirect(adres); 65 58 return new EmptyResult(); 66 } 67 public ErrorViewData IsError(string errortxt, int idFaktury) 68 { 69 if (errortxt == "brakdanych") 70 errortxt = _translateManager.Translate("tlumaczenia", "brakdanych"); 71 else if (errortxt == "weryfikacja") 72 errortxt = _translateManager.Translate("tlumaczenia", "weryfikacja"); 73 else if (errortxt == "error_hash") 74 errortxt = _translateManager.Translate("tlumaczenia", "error_hash"); 75 else if (errortxt == "error_hash") 76 errortxt = _translateManager.Translate("tlumaczenia", "error_hash"); 77 78 return _funkcjePlatnosci.InitErrorViewData(errortxt, idFaktury); 79 } 80 59 } 81 60 } 82 61 }
