Zbiór zmian 971 dla trunk/eCard/eCardMVC/Platnosci/Models
- Data:
- 2009-12-23 11:59:36 (16 years ago)
- Lokalizacja:
- trunk/eCard/eCardMVC/Platnosci/Models
- Pliki:
-
- 2 zmodyfikowane
- 2 przeniesione
-
ErrorViewData.cs (zmodyfikowane) (1 diff)
-
InvoiceDetailsViewData.cs (zmodyfikowane) (1 diff)
-
MerchantHelper.cs (przeniesione) (przeniesione from trunk/eCard/eCardMVC/Platnosci/Models/eCardData.cs) (2 diffs)
-
PaymentsUtils.cs (przeniesione) (przeniesione from trunk/eCard/eCardMVC/Platnosci/Models/FunkcjePlatnosci.cs) (6 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/Platnosci/Models/ErrorViewData.cs
r933 r971 1 namespace Platnosci.Models1 namespace adMoto.Payments.Web.Models 2 2 { 3 3 public class ErrorViewData 4 4 { 5 public string Error { get; set; }6 public int InvoiceId { get; set; }5 public string Error { get; set; } 6 public int InvoiceId { get; set; } 7 7 } 8 8 } -
trunk/eCard/eCardMVC/Platnosci/Models/InvoiceDetailsViewData.cs
r970 r971 2 2 using adMoto.Payments.Core.Data; 3 3 4 namespace Platnosci.Models4 namespace adMoto.Payments.Web.Models 5 5 { 6 6 public class InvoiceDetailsViewData 7 7 { 8 public Invoice vPlatnosciEcard{ get; set; }8 public Invoice Invoice { get; set; } 9 9 public Payer Payer {get; set;} 10 public string brutto { get; set; }11 public string termin { get; set; }12 public string info { get; set; }10 public string Brutto { get; set; } 11 public string Termin { get; set; } 12 public string Info { get; set; } 13 13 } 14 14 } -
trunk/eCard/eCardMVC/Platnosci/Models/MerchantHelper.cs
r970 r971 8 8 using adMoto.Payments.Core.Interfaces; 9 9 10 namespace Platnosci.Models10 namespace adMoto.Payments.Web.Models 11 11 { 12 public class eCardData12 public class MerchantHelper 13 13 { 14 14 public const string HASH_ERROR_INFO = "payment not exist"; 15 private readonly FunkcjePlatnosci _funkcjePlatnosci;15 private readonly PaymentsUtils _paymentsUtils; 16 16 private IRepository<PlatnosciEcard> _repPayment; 17 17 18 public eCardData(IRepository<PlatnosciEcard> repPayment)18 public MerchantHelper(IRepository<PlatnosciEcard> repPayment) 19 19 { 20 20 _repPayment = repPayment; 21 _ funkcjePlatnosci = new FunkcjePlatnosci(_repPayment);21 _paymentsUtils = new PaymentsUtils(_repPayment); 22 22 } 23 23 … … 43 43 var merchant = new Merchant(); 44 44 45 var waluta = _ funkcjePlatnosci.SetAmount(invoice);46 var newPayment = _ funkcjePlatnosci.CreateAndAddNewPyment(invoice, waluta, payer, sessionId);45 var waluta = _paymentsUtils.SetAmount(invoice); 46 var newPayment = _paymentsUtils.CreateAndAddNewPyment(invoice, waluta, payer, sessionId); 47 47 48 48 merchant.SystemKsiegowy = invoice.SystemKsiegowyId.ToString(); 49 49 50 50 #if DEBUG 51 //TODO: find better method to set SystemKsiegowy when testing or developing51 //TODO: find better method to set SystemKsiegowy when testing or developing 52 52 merchant.SystemKsiegowy = "2"; 53 53 #endif -
trunk/eCard/eCardMVC/Platnosci/Models/PaymentsUtils.cs
r970 r971 10 10 11 11 12 namespace Platnosci.Models12 namespace adMoto.Payments.Web.Models 13 13 { 14 public class FunkcjePlatnosci14 public class PaymentsUtils 15 15 { 16 16 public const string EUR = "978"; … … 21 21 public const string KOD_POLSKA = "616"; //kod kraju Akceptanta - Polska 22 22 public const string KODOWANIE = "ISO-8859-2"; 23 private IRepository<PlatnosciEcard> _repPayment;23 private readonly IRepository<PlatnosciEcard> _repPayment; 24 24 private readonly ITranslateManager _translateManager; 25 25 26 public FunkcjePlatnosci()26 public PaymentsUtils() 27 27 { 28 28 _repPayment = new Repository<PlatnosciEcard>(new DataContext()); … … 30 30 } 31 31 32 public FunkcjePlatnosci(IRepository<PlatnosciEcard> repPayment)32 public PaymentsUtils(IRepository<PlatnosciEcard> repPayment) 33 33 { 34 34 _repPayment = repPayment; 35 35 _translateManager = new Translation(); 36 36 } 37 public FunkcjePlatnosci(IRepository<PlatnosciEcard> repPayment, ITranslateManager translate)37 public PaymentsUtils(IRepository<PlatnosciEcard> repPayment, ITranslateManager translate) 38 38 { 39 39 _repPayment = repPayment; … … 58 58 public Waluta SetAmount(Invoice platnosc) 59 59 { 60 var waluta = new Waluta(); 61 waluta.Currency = GetCurrency(platnosc.waluta_miano); 60 var waluta = new Waluta {Currency = GetCurrency(platnosc.waluta_miano)}; 62 61 63 if (waluta.Currency == PLN) 64 waluta.Amount = Convert.ToInt32(platnosc.Brutto * 100); 65 else 66 waluta.Amount = Convert.ToInt32(platnosc.waluta_brutto * 100); 62 waluta.Amount = waluta.Currency == PLN ? Convert.ToInt32(platnosc.Brutto * 100) : Convert.ToInt32(platnosc.waluta_brutto * 100); 67 63 68 64 return waluta; … … 174 170 } 175 171 176 public ErrorViewData IsError(Invoice platnosc, String UserName)172 public ErrorViewData IsError(Invoice platnosc, String userName) 177 173 { 178 174 var errortxt = ""; … … 180 176 if (platnosc == null) 181 177 errortxt = _translateManager.Translate("tlumaczenia", "brakdanych"); 182 else if (!UserIdentity(platnosc, UserName))178 else if (!UserIdentity(platnosc, userName)) 183 179 errortxt = _translateManager.Translate("tlumaczenia", "weryfikacja"); 184 180
