public string SubmitPayment(string meterNo, string amt, string dealerName, string custName, string custAddress, string crCode, string fixedCharge2, string conlogTID, string password, string mtid, string channelRefNo, string collectionType = "NRG", string invoiceNo = "", string businessUnit = "") { string errorMsg = ""; ClsLog cl = new ClsLog(); ClsDealer dl = new ClsDealer(); if (dl.ChannelRefExists(channelRefNo)) { return("0|Get receipt from payment history"); } if (RequestIsValid(dealerName, password)) { return(pawakadApp.PwkRESTWS.utilClass.SubmitPayment.PerformPayment(meterNo, amt, dealerName, custName, custAddress, crCode, fixedCharge2, conlogTID, password, mtid, channelRefNo, collectionType, invoiceNo, businessUnit)); } else { errorMsg = "0|Invalid_Request"; cl.LogPaymentError(meterNo, "", int.Parse(amt), errorMsg, "PAYMENT", DateTime.Now /*, dCode, DateTime.Now, false*/); //dl.AddLoginLocation(dealerName, longitude, latitude, address, mtid); return(errorMsg); } }
public string SubmitPayment(string meterNo, string amt, string dealerName, string custName, string custAddress, string crCode, string fixedCharge2, string conlogTID, string password, string mtid, string channelRefNo, string phoneNo, string collectionType = "NRG", string accountType = "", string orgName = "", string orgNo = "", string invoiceNo = "", string businessUnit = "") { string errorMsg = ""; ClsLog cl = new ClsLog(); ClsDealer dl = new ClsDealer(); if (dl.ChannelRefExists(channelRefNo)) { return("0|Get receipt from payment history"); } if (RequestIsValid(dealerName, password)) { bool phoneIsNeeded = int.Parse(new pawakadApp.ClsCard.ClsCards().RunThisQuery2("select convert(varchar,count(id)) from ControlTable where phoneCheck='true'")) > 0; if (phoneIsNeeded && new Regex(@"^0[789][01]\d{8}$").Match(phoneNo).Success == false) { errorMsg = "0|A valid phone number is required"; cl.LogPaymentError(meterNo, "", int.Parse(amt), errorMsg, "PAYMENT", DateTime.Now); return(errorMsg); } return(pawakadApp.PwkRESTWS.utilClass.SubmitPayment.PerformPayment(meterNo, amt, dealerName, custName, custAddress, crCode, fixedCharge2, conlogTID, password, mtid, channelRefNo, phoneNo, collectionType, accountType, orgName, orgNo, invoiceNo, businessUnit)); } else { errorMsg = "0|Invalid_Request"; cl.LogPaymentError(meterNo, "", int.Parse(amt), errorMsg, "PAYMENT", DateTime.Now /*, dCode, DateTime.Now, false*/); //dl.AddLoginLocation(dealerName, longitude, latitude, address, mtid); return(errorMsg); } }