Zbiór zmian 984 dla trunk/eCard/eCardMVC/adMoto.Payments.Web/Models/PaymentsUtils.cs
- Data:
- 2009-12-28 15:17:15 (16 years ago)
- Pliki:
-
- 1 zmodyfikowane
-
trunk/eCard/eCardMVC/adMoto.Payments.Web/Models/PaymentsUtils.cs (zmodyfikowane) (2 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/adMoto.Payments.Web/Models/PaymentsUtils.cs
r971 r984 40 40 _translateManager = translate; 41 41 } 42 public string BruttoToString(decimal? kwota, decimal? waluta , string miano)42 public string BruttoToString(decimal? kwota, decimal? waluta_brutto, string miano) 43 43 { 44 44 var brutto = String.Format("{0:0.00}", kwota.ToString().Replace(",", ".")) + " PLN "; 45 45 46 46 if (!String.IsNullOrEmpty(miano)) 47 if (waluta > 0 && miano.ToUpper() != "PLN")48 brutto += "(" + (waluta .ToString()).Replace(",", ".") + " " + miano.ToUpper() + ")";47 if (waluta_brutto > 0 && miano.ToUpper() != "PLN") 48 brutto += "(" + (waluta_brutto.ToString()).Replace(",", ".") + " " + miano.ToUpper() + ")"; 49 49 50 50 return brutto; 51 51 } 52 52 53 public bool UserIdentity(Invoice platnosc, string userName)53 public bool UserIdentity(Invoice invoice, string userName) 54 54 { 55 return platnosc != null && platnosc.nip == userName;55 return invoice != null && invoice.nip == userName; 56 56 } 57 57 58 public Waluta SetAmount(Invoice platnosc)58 public Waluta SetAmount(Invoice invoice) 59 59 { 60 var waluta = new Waluta {Currency = GetCurrency( platnosc.waluta_miano)};60 var waluta = new Waluta {Currency = GetCurrency(invoice.waluta_miano)}; 61 61 62 waluta.Amount = waluta.Currency == PLN ? Convert.ToInt32( platnosc.Brutto * 100) : Convert.ToInt32(platnosc.waluta_brutto * 100);62 waluta.Amount = waluta.Currency == PLN ? Convert.ToInt32(invoice.Brutto * 100) : Convert.ToInt32(invoice.waluta_brutto * 100); 63 63 64 64 return waluta; … … 144 144 return er; 145 145 } 146 public PlatnosciEcard CreateAndAddNewPyment(Invoice platnosc, Waluta waluta, Payer payer, string sessionId)146 public PlatnosciEcard CreateAndAddNewPyment(Invoice invoice, Waluta waluta, Payer payer, string sessionId) 147 147 { 148 var newPayment = new PlatnosciEcard();149 newPayment.IDFaktury = platnosc.ID_faktury;150 newPayment.ORDERDESCRIPTION = platnosc.Faktura_Numer;151 newPayment.nip = platnosc.nip;152 newPayment.nrZlecenia = "";153 newPayment.AMOUNT = waluta.Amount;154 newPayment.CURRENCY = waluta.Currency;155 newPayment.SESSIONID = sessionId;156 newPayment.NAME = payer.FirstName;157 newPayment.SURNAME = payer.LastName;158 newPayment.AUTODEPOSIT = true;159 newPayment.LANGUAGE = GetLanguage(); //ustawiamy jezyk, w ktorym ma byc wyświetlany formularz na stronie eCard160 newPayment.CHARSET = KODOWANIE;161 newPayment.COUNTRY = KOD_POLSKA;162 newPayment.JS = true;163 newPayment.PAYMENTTYPE = CARDS;164 newPayment.Data = DateTime.Now;165 newPayment.Status = null;166 newPayment.Status_data = null;148 var payment = new PlatnosciEcard(); 149 payment.IDFaktury = invoice.ID_faktury; 150 payment.ORDERDESCRIPTION = invoice.Faktura_Numer; 151 payment.nip = invoice.nip; 152 payment.nrZlecenia = ""; 153 payment.AMOUNT = waluta.Amount; 154 payment.CURRENCY = waluta.Currency; 155 payment.SESSIONID = sessionId; 156 payment.NAME = payer.FirstName; 157 payment.SURNAME = payer.LastName; 158 payment.AUTODEPOSIT = true; 159 payment.LANGUAGE = GetLanguage(); //ustawiamy jezyk, w ktorym ma byc wyświetlany formularz na stronie eCard 160 payment.CHARSET = KODOWANIE; 161 payment.COUNTRY = KOD_POLSKA; 162 payment.JS = true; 163 payment.PAYMENTTYPE = CARDS; 164 payment.Data = DateTime.Now; 165 payment.Status = null; 166 payment.Status_data = null; 167 167 168 _repPayment.Insert( newPayment);169 return newPayment;168 _repPayment.Insert(payment); 169 return payment; 170 170 } 171 171 172 public ErrorViewData IsError(Invoice platnosc, String userName)172 public ErrorViewData IsError(Invoice invoice, String userName) 173 173 { 174 174 var errortxt = ""; 175 175 176 if ( platnosc== null)176 if (invoice == null) 177 177 errortxt = _translateManager.Translate("tlumaczenia", "brakdanych"); 178 else if (!UserIdentity( platnosc, userName))178 else if (!UserIdentity(invoice, userName)) 179 179 errortxt = _translateManager.Translate("tlumaczenia", "weryfikacja"); 180 180
