Pokaż
Ignoruj:
Data:
2009-12-14 16:03:54 (16 years ago)
Autor:
alina
Opis:

re #215 dodanie testów, mała przebudowa akcji Merchant (wydzielenie funkcji)

Pliki:
1 zmodyfikowane

Legenda:

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

    r950 r951  
    66using System.Configuration; 
    77using System.Security.Principal; 
     8using Platnosci.Core.Interface; 
    89 
    910 
     
    1617        private const string USD = "789"; 
    1718        private const string PLN = "985"; 
     19        public const string CARDS = "CARDS";            //obsługa tylko kart płatniczych 
     20        public const string KOD_POLSKA = "616";         //kod kraju Akceptanta - Polska 
     21        public const string KODOWANIE = "ISO-8859-2"; 
    1822 
    1923        public string BruttoToString(decimal? kwota, decimal? waluta, string miano) 
     
    3943            if (!String.IsNullOrEmpty(platnosc.waluta_miano) && platnosc.waluta_miano != "PLN") 
    4044            { 
     45                waluta.Amount = Convert.ToInt32(platnosc.waluta_brutto * 100); 
    4146                switch (platnosc.waluta_miano) 
    4247                { 
     
    118123            return er; 
    119124        } 
     125        public PlatnosciEcard CreateAndAddNewPyment(vPlatnosciEcard platnosc, Waluta waluta, Payer payer, IRepository<PlatnosciEcard> _repPayment, string sessionId) 
     126        { 
     127            var newPayment = new PlatnosciEcard(); 
     128            newPayment.IDFaktury = platnosc.ID_faktury; 
     129            newPayment.ORDERDESCRIPTION = platnosc.Faktura_Numer; 
     130            newPayment.nip = platnosc.nip; 
     131            newPayment.nrZlecenia = ""; 
     132            newPayment.AMOUNT = waluta.Amount; 
     133            newPayment.CURRENCY = waluta.Currency; 
     134            newPayment.SESSIONID = sessionId; 
     135            newPayment.NAME = payer.FirstName; 
     136            newPayment.SURNAME = payer.LastName; 
     137            newPayment.AUTODEPOSIT = true; 
     138            newPayment.LANGUAGE = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToUpper(); 
     139            newPayment.CHARSET = KODOWANIE; 
     140            newPayment.COUNTRY = KOD_POLSKA; 
     141            newPayment.JS = true; 
     142            newPayment.PAYMENTTYPE = CARDS; 
     143            newPayment.Data = DateTime.Now; 
     144            newPayment.Status = null; 
     145            newPayment.Status_data = null; 
    120146 
     147            if (newPayment != null) 
     148            { 
     149                _repPayment.Insert(newPayment); 
     150                return newPayment; 
     151            } 
     152            return null; 
     153        } 
    121154    } 
    122155}