Zbiór zmian 989 dla trunk/eCard
- Data:
- 2010-01-04 09:47:00 (16 years ago)
- Pliki:
-
- 1 zmodyfikowane
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/eCard/eCardMVC/adMoto.Payments.Web/Controllers/eCardController.cs
r985 r989 6 6 using adMoto.Payments.Web.Exceptions; 7 7 using Elmah; 8 using System.Collections.Generic;9 10 using System.Configuration;11 using System.Linq;12 8 13 9 namespace adMoto.Payments.Web.Controllers … … 37 33 if (System.Web.HttpContext.Current != null) 38 34 ErrorSignal.FromCurrentContext().Raise(new ConfirmationLogger(), System.Web.HttpContext.Current); 39 35 40 36 var potwierdzenie = new PotwierdzeniaEcard(); 41 42 37 potwierdzenie.MERCHANTNUMBER = Request["MERCHANTNUMBER"] ?? Request.Form["MERCHANTNUMBER"]; 43 if (String.IsNullOrEmpty(potwierdzenie.MERCHANTNUMBER)) 44 throw new ArgumentNullException("MERCHANTNUMBER"); 45 46 string ordernumber = Request["ORDERNUMBER"] ?? Request.Form["ORDERNUMBER"]; 47 if (!String.IsNullOrEmpty(ordernumber)) 48 potwierdzenie.ORDERNUMBER = Convert.ToInt32(ordernumber); 49 else 50 throw new ArgumentNullException("ORDERNUMBER"); 51 38 potwierdzenie.ORDERNUMBER = Request["ORDERNUMBER"] != null ? Convert.ToInt32(Request["ORDERNUMBER"]) : Convert.ToInt32(Request.Form["ORDERNUMBER"]); 52 39 potwierdzenie.COMMTYPE = Request["COMMTYPE"] ?? Request.Form["COMMTYPE"]; 53 if (String.IsNullOrEmpty(potwierdzenie.COMMTYPE))54 throw new ArgumentNullException("COMMTYPE");55 56 40 potwierdzenie.CURRENTSTATE = Request["CURRENTSTATE"] ?? Request.Form["CURRENTSTATE"]; 57 if (String.IsNullOrEmpty(potwierdzenie.CURRENTSTATE))58 throw new ArgumentNullException("CURRENTSTATE");59 60 41 potwierdzenie.PREVIOUSSTATE = Request["PREVIOUSSTATE"] ?? Request.Form["PREVIOUSSTATE"]; 61 if (String.IsNullOrEmpty(potwierdzenie.PREVIOUSSTATE)) 62 throw new ArgumentNullException("PREVIOUSSTATE"); 63 64 string paymenttype = Request["PAYMENTTYPE"] ?? Request.Form["PAYMENTTYPE"]; 65 if (!String.IsNullOrEmpty(paymenttype)) 66 potwierdzenie.PAYMENTTYPE = Convert.ToBoolean(paymenttype); 67 else 68 throw new ArgumentNullException("PAYMENTTYPE"); 69 70 string eventtype = Request["EVENTTYPE"] ?? Request.Form["EVENTTYPE"]; 71 if (!String.IsNullOrEmpty(eventtype)) 72 potwierdzenie.EVENTTYPE = Convert.ToBoolean(eventtype); 73 else 74 throw new ArgumentNullException("EVENTTYPE"); 75 76 string paymentnumber = Request["PAYMENTNUMBER"] ?? Request.Form["PAYMENTNUMBER"]; 77 if (!String.IsNullOrEmpty(paymentnumber)) 78 potwierdzenie.PAYMENTNUMBER = Convert.ToBoolean(paymentnumber); 79 else 80 throw new ArgumentNullException("PAYMENTNUMBER"); 81 42 potwierdzenie.PAYMENTTYPE = Request["PAYMENTTYPE"] != null ? Convert.ToBoolean(Convert.ToInt32(Request["PAYMENTTYPE"])) : Convert.ToBoolean(Convert.ToInt32(Request.Form["PAYMENTTYPE"])); 43 potwierdzenie.EVENTTYPE = Request["EVENTTYPE"] != null ? Convert.ToBoolean(Convert.ToInt32(Request["EVENTTYPE"])) : Convert.ToBoolean(Convert.ToInt32(Request.Form["EVENTTYPE"])); 44 potwierdzenie.PAYMENTNUMBER = Request["PAYMENTNUMBER"] != null ? Convert.ToBoolean(Convert.ToInt32(Request["PAYMENTNUMBER"])) : Convert.ToBoolean(Convert.ToInt32(Request.Form["PAYMENTNUMBER"])); 45 potwierdzenie.APPROVALCODE = Request["APPROVALCODE"] ?? Request.Form["APPROVALCODE"]; 82 46 potwierdzenie.VALIDATIONCODE = Request["VALIDATIONCODE"] ?? Request.Form["VALIDATIONCODE"]; 83 if (String.IsNullOrEmpty(potwierdzenie.VALIDATIONCODE))84 throw new ArgumentNullException("VALIDATIONCODE");85 86 //zapisywany do bazy tylko wtedy, gdy validationcode = 00087 potwierdzenie.APPROVALCODE = Request["APPROVALCODE"] ?? Request.Form["APPROVALCODE"];88 if (String.IsNullOrEmpty(potwierdzenie.APPROVALCODE) && potwierdzenie.VALIDATIONCODE == "000")89 throw new ArgumentNullException("APPROVALCODE");90 91 47 potwierdzenie.BIN = Request["BIN"] ?? Request.Form["BIN"]; 92 if (String.IsNullOrEmpty(potwierdzenie.BIN)) 93 throw new ArgumentNullException("BIN"); 94 95 string authtime = Request["AUTHTIME"] ?? Request.Form["AUTHTIME"]; 96 if (!String.IsNullOrEmpty(authtime)) 97 potwierdzenie.AUTHTIME = Convert.ToDateTime(authtime); 98 else 99 throw new ArgumentNullException("AUTHTIME"); 100 48 potwierdzenie.AUTHTIME = Request["AUTHTIME"] != null ? Convert.ToDateTime(Request["AUTHTIME"]) : Convert.ToDateTime(Request.Form["AUTHTIME"]); 101 49 potwierdzenie.TYPE = Request["TYPE"] ?? Request.Form["TYPE"]; 102 if (String.IsNullOrEmpty(potwierdzenie.TYPE))103 throw new ArgumentNullException("TYPE");104 105 50 potwierdzenie.WITHCVC = Request["WITHCVC"] ?? Request.Form["WITHCVC"]; 106 if (String.IsNullOrEmpty(potwierdzenie.WITHCVC)) 107 throw new ArgumentNullException("WITHCVC"); 108 109 potwierdzenie.DATATRANSMISJI = DateTime.Now; 51 potwierdzenie.DATATRANSMISJI = DateTime.Now; 110 52 111 53 _eCardRepository.Insert(potwierdzenie); … … 121 63 122 64 return content; 123 } 65 } 124 66 } 125 67 }
