Pokaż
Ignoruj:
Data:
2009-12-22 10:43:43 (16 years ago)
Autor:
marek
Opis:

re #215

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/eCard/eCardMVC/Platnosci/Models/eCardData.cs

    r959 r960  
    11using System; 
    2 using System.Web; 
    32using System.Net; 
    43using System.IO; 
    54using System.Linq; 
    6 using System.Web.Mvc; 
    75using System.Configuration; 
    86using Platnosci.Core.Linq; 
     
    1614        private readonly FunkcjePlatnosci _funkcjePlatnosci; 
    1715        private IRepository<PlatnosciEcard> _repPayment; 
    18          
     16 
    1917        public eCardData(IRepository<PlatnosciEcard> repPayment) 
    2018        { 
     
    2523        public String GetUrl(Merchant merchant) 
    2624        { 
    27             if (merchant == null)  
    28                 throw new ArgumentNullException("parametr merchant is null in GetUrl method"); 
    29              
     25            if (merchant == null) 
     26                throw new ArgumentNullException("merchant"); 
     27 
    3028            var dane = ConfigurationManager.AppSettings["eCard.Url"] + "?ORDERDESCRIPTION=" + merchant.Payment.ORDERDESCRIPTION; 
    3129            dane += "&AMOUNT=" + merchant.Payment.AMOUNT + "&CURRENCY=" + merchant.Payment.CURRENCY; 
     
    4240        { 
    4341            var merchant = new Merchant(); 
    44             
     42 
    4543            var waluta = _funkcjePlatnosci.SetAmount(invoice); 
    4644            var newPayment = _funkcjePlatnosci.CreateAndAddNewPyment(invoice, waluta, payer, sessionId); 
    4745 
    4846            merchant.SystemKsiegowy = invoice.SystemKsiegowyId.ToString(); 
    49             if (ConfigurationManager.AppSettings["wersja"] == "TEST") 
    50                 merchant.SystemKsiegowy = "2"; 
     47 
     48#if DEBUG 
     49            //TODO: find better method to set SystemKsiegowy when testing or developing 
     50            merchant.SystemKsiegowy = "2"; 
     51#endif 
    5152 
    5253            merchant.Payment = newPayment; 
     
    5960            var linkFail = ConfigurationManager.AppSettings["Strona"]; 
    6061            linkFail += "/" + lang + ConfigurationManager.AppSettings["LinkFail"]; 
    61             linkFail += "/" + newPayment.IDFaktury + "?o=" + orderek;  
     62            linkFail += "/" + newPayment.IDFaktury + "?o=" + orderek; 
    6263 
    6364            var linkOk = ConfigurationManager.AppSettings["Strona"]; 
     
    6869            merchant.LinkFail = linkFail; 
    6970 
    70             if (merchant != null) merchant.IsValid(); 
     71            merchant.IsValid(); 
    7172 
    7273            return merchant; 
     
    8889        { 
    8990            if (merchant == null) 
    90                 throw new ArgumentNullException("parametr merchant is null in SetHash method"); 
     91                throw new ArgumentNullException("merchant"); 
    9192 
    9293            var platnosc = _repPayment.Find(i => i.ORDERDESCRIPTION == merchant.Payment.ORDERDESCRIPTION && i.IDFaktury == merchant.Payment.IDFaktury && i.Data == merchant.Payment.Data).SingleOrDefault(); 
    9394 
    94             if (platnosc == null)             
     95            if (platnosc == null) 
    9596                merchant.Hash = HASH_ERROR_INFO; 
    9697            else