/// <summary>
        /// Display the terms depends on the DO
        /// </summary>
        public void DisplayTerms()
        {
            AuthenticationClasses.WebService.Authentication authObj     = new AuthenticationClasses.WebService.Authentication();
            OrderClassesII.IssueDirectPaymentWrapper        issueDirect = new IssueDirectPaymentWrapper();
            try
            {
                DataSet ds = new DataSet();
                string  DO = string.Empty;
                ds = authObj.GetRepIDDO(HttpContext.Current.User.Identity.Name.ToString());
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DO = (ds.Tables[0].Rows[0][Constants.PC_DO_ID].ToString()).Trim();
                    List <string> DO_CC = issueDirect.DO_CC_Mapping();

                    if (DO_CC.Contains(DO) || string.IsNullOrEmpty(DO))
                    {
                        ContactCenterUser.Visible = true;
                        lblContactCenter.Visible  = true;
                        lblContactCenter.Text     = CSAAWeb.Constants.PC_Contact_Center_Script;
                        lbl_Terms.Text            = CSAAWeb.Constants.PC_CB_TANDC_CONTACTCENTER;
                    }
                    else
                    {
                        lblContactCenter.Visible = false;
                        lbl_Terms.Text           = CSAAWeb.Constants.PC_CB_TANDC_F2F;
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log(ex.ToString());
            }
            finally
            {
                authObj     = null;
                issueDirect = null;
            }
        }
示例#2
0
        /// <summary>
        /// CHG0112662 - Record Payment Enrollment SOA Service changes - new method to invoke payment enrollment service
        /// </summary>
        /// <param name="EnrollRequest"></param>
        /// <returns></returns>
        public List <string> PCPaymentEnrollService(RecordPaymentEnrollment.recordPaymentEnrollmentStatusRequest EnrollRequest)
        {
            List <string> resp_List = new List <string>();
            DataSet       ds        = new DataSet();
            string        DO        = string.Empty;
            bool          Errflag   = false;

            RecordPaymentEnrollment.RecordPaymentEnrollmentStatusRequest1  ReqObj     = new RecordPaymentEnrollment.RecordPaymentEnrollmentStatusRequest1();
            RecordPaymentEnrollment.recordPaymentEnrollmentStatusResponse  EnrollResp = new RecordPaymentEnrollment.recordPaymentEnrollmentStatusResponse();
            RecordPaymentEnrollment.RecordPaymentEnrollmentStatusResponse1 RespObj    = new RecordPaymentEnrollment.RecordPaymentEnrollmentStatusResponse1();
            AuthenticationClasses.WebService.Authentication authObj = new AuthenticationClasses.WebService.Authentication();
            ds = authObj.GetRepIDDO(HttpContext.Current.User.Identity.Name.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                DO = (ds.Tables[0].Rows[0]["DO ID"].ToString()).Trim();
            }
            try
            {
                RecordPaymentEnrollment.RecordPaymentEnrollmentStatus _RecordEnrollProvider = (RecordPaymentEnrollment.RecordPaymentEnrollmentStatusChannel)CreateInstance <RecordPaymentEnrollment.RecordPaymentEnrollmentStatusChannel>("RecordPaymentEnrollmentStatusSOAPPort");
                if (DO == string.Empty)
                {
                    EnrollRequest.authenticationChannel = Constants.PC_AUTHCH_CC;
                }
                else
                {
                    if (DO.Equals(CSAAWeb.Constants.PC_DO_AUTHIVR))
                    {
                        EnrollRequest.authenticationChannel = Constants.PC_AUTHCH_IVR;
                    }
                    else if ((Config.Setting("PC_DO.BO").ToString().IndexOf(DO)) > -1 && DO.Length > 1)
                    {
                        EnrollRequest.authenticationChannel = Constants.PC_AUTHCH_BO;
                    }
                    else if ((Config.Setting("PC_DO.CC").IndexOf(DO)) > -1 && DO.Length > 1)
                    {
                        EnrollRequest.authenticationChannel = Constants.PC_AUTHCH_CC;
                    }
                    else
                    {
                        EnrollRequest.authenticationChannel = Constants.PC_AUTHCH_F2F;
                    }
                }
                ReqObj.recordPaymentEnrollmentStatusRequest = EnrollRequest;
                if (ReqObj != null && (Config.Setting("Logging.RecordEnrollment") == "1"))
                {
                    System.Xml.Serialization.XmlSerializer serializerReq = new System.Xml.Serialization.XmlSerializer(ReqObj.GetType());
                    StringWriter writerReq = new StringWriter();
                    serializerReq.Serialize(writerReq, ReqObj);
                    Logger.Log("Payment Enrollment request to Payment Central - Record Payment Enrollment Request : \r\n" + writerReq);
                }
                RespObj    = _RecordEnrollProvider.RecordPaymentEnrollmentStatus(ReqObj);
                EnrollResp = RespObj.recordPaymentEnrollmentStatusResponse;
                if (EnrollResp != null)
                {
                    string Trnxid = string.Empty;
                    if (EnrollResp.status.ToUpper() == CSAAWeb.Constants.PC_SUCESS.ToUpper())
                    {
                        resp_List.Add(EnrollResp.status.ToUpper());
                        resp_List.Add(EnrollResp.receiptNumber);
                        //return resp_List;
                    }
                }
                if (EnrollResp != null && (Config.Setting("Logging.RecordEnrollment") == "1"))
                {
                    System.Xml.Serialization.XmlSerializer serializerRes = new System.Xml.Serialization.XmlSerializer(EnrollResp.GetType());
                    StringWriter writerRes = new StringWriter();
                    serializerRes.Serialize(writerRes, EnrollResp);
                    Logger.Log("Payment Enrollment Response from Payment Central - Record Payment Enrollment Response : \r\n" + writerRes);
                }
                else
                {
                    if (EnrollResp == null)
                    {
                        Logger.Log("Payment Enrollment Response is NULL");
                    }
                }
                // PC Phase II 4/20 - Added condition such that based on config entry the response is getting logged in log file.
            }
            catch (FaultException <RecordPaymentEnrollment.ErrorInfo> faultExpErrorInfo)
            {
                if (Config.Setting("Logging.RecordEnrollment") == "1")
                {
                    if (EnrollResp != null)
                    {
                        System.Xml.Serialization.XmlSerializer serializerRes = new System.Xml.Serialization.XmlSerializer(EnrollResp.GetType());
                        StringWriter writerRes = new StringWriter();
                        serializerRes.Serialize(writerRes, EnrollResp);
                        Logger.Log("Payment Enrollment Response from Payment Central - Record Payment Enrollment Response : \r\n" + writerRes);
                    }
                }
                if (faultExpErrorInfo.Detail != null)
                {
                    Logger.Log(faultExpErrorInfo.Detail.errorMessageText);
                    resp_List.Add(faultExpErrorInfo.Detail.errorCode);
                    resp_List.Add(faultExpErrorInfo.Detail.errorMessageText);
                }
                Errflag = true;
                return(resp_List);
            }
            catch (FaultException faultExp)
            {
                string errFriendlyMsg = "", errMsg = "", errCode = "", appendErrMsg = "";
                //PC Phase II 4/20 - Added condition such that based on config entry the response is getting logged in log file.
                if (Config.Setting("Logging.RecordEnrollment") == "1")
                {
                    if (EnrollResp != null)
                    {
                        System.Xml.Serialization.XmlSerializer serializerRes = new System.Xml.Serialization.XmlSerializer(EnrollResp.GetType());
                        StringWriter writerRes = new StringWriter();
                        serializerRes.Serialize(writerRes, EnrollResp);
                        Logger.Log("Enrollment Response from Payment Central - Record Enrollment Response : \r\n" + writerRes);
                    }
                }
                //PC Phase II 4/20 - Added condition such that based on config entry the response is getting logged in log file.
                FaultException <RecordPaymentEnrollment.www.aaancnuit.com.aaancnu_common_version2.ErrorInfo> errInfo = (FaultException <RecordPaymentEnrollment.www.aaancnuit.com.aaancnu_common_version2.ErrorInfo>)faultExp;
                if (errInfo.Detail != null)
                {
                    foreach (XmlNode node in errInfo.Detail.Nodes)
                    {
                        if (node.Name.Contains(CSAAWeb.Constants.PC_ERR_NODE_FRIENDLY_ERROR_MSG))
                        {
                            errFriendlyMsg = node.InnerText;
                        }
                        if (node.Name.Contains(CSAAWeb.Constants.PC_ERR_NODE_ERROR_MSG_TEXT))
                        {
                            errMsg = node.InnerText;
                        }
                        if (node.Name.Contains(CSAAWeb.Constants.PC_ERR_NODE_ERROR_CODE))
                        {
                            errCode = node.InnerText;
                        }
                    }
                }
                if (errCode == CSAAWeb.Constants.ERR_CODE_BUSINESS_EXCEPTION)
                {
                    appendErrMsg = CSAAWeb.Constants.PC_ERR_BUSINESS_EXCEPTION_ENROLL + CSAAWeb.Constants.ERR_CODE_BUSINESS_EXCEPTION + "-" + errMsg;
                }
                else
                {
                    appendErrMsg = errCode + "-" + CSAAWeb.Constants.PC_ERR_RUNTIME_EXCEPTION;
                }
                Logger.Log(errCode + " " + appendErrMsg);
                resp_List.Add(errCode);
                resp_List.Add(appendErrMsg);
                Errflag = true;
                return(resp_List);
            }
            catch (SoapException soapExp)
            {
                //PC Phase II 4/20 - Added condition such that based on config entry the response is getting logged in log file.
                if (Config.Setting("Logging.RecordEnrollment") == "1")
                {
                    if (EnrollResp != null)
                    {
                        System.Xml.Serialization.XmlSerializer serializerRes = new System.Xml.Serialization.XmlSerializer(EnrollResp.GetType());
                        StringWriter writerRes = new StringWriter();
                        serializerRes.Serialize(writerRes, EnrollResp);
                        Logger.Log("Enrollment Response from Payment Central - Record Enrollment Response : \r\n" + writerRes);
                    }
                }
                //PC Phase II 4/20 - Added condition such that based on config entry the response is getting logged in log file.
                if (soapExp.Message != null)
                {
                    Logger.Log(soapExp.Message);
                    resp_List.Add(soapExp.Code.ToString());
                    resp_List.Add(CSAAWeb.Constants.PC_ERR_RUNTIME_EXCEPTION);
                }
                Errflag = true;
                return(resp_List);
            }
            catch (Exception exp)
            {
                //PC Phase II 4/20 - Added condition such that based on config entry the response is getting logged in log file.
                if (Config.Setting("Logging.RecordEnrollment") == "1")
                {
                    if (EnrollResp != null)
                    {
                        System.Xml.Serialization.XmlSerializer serializerRes = new System.Xml.Serialization.XmlSerializer(EnrollResp.GetType());
                        StringWriter writerRes = new StringWriter();
                        serializerRes.Serialize(writerRes, EnrollResp);
                        Logger.Log("Enrollment Response from Payment Central - Record Enrollment Response : \r\n" + writerRes);
                    }
                }
                if (exp.Message != null)
                {
                    Logger.Log(exp.Message);
                    resp_List.Add("");
                    resp_List.Add(CSAAWeb.Constants.PC_ERR_RUNTIME_EXCEPTION);
                }
                Errflag = true;
                return(resp_List);
            }
            return(resp_List);
        }
        // RFC 185138 - AD Integration CH1 - End - Added the below method to get the list of users from the LDAP server

        // RFC 185138 - AD Integration CH2 - Start - Added the below method to validate the credential against the LDAP server
        /// <summary>
        /// Method which will perfrom query based on combination of username and password
        /// This is used with the login process to validate the user credentials and return the response of the LDAP server validation.
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="Password"></param>
        /// <returns></returns>
        public static string GetUser(string UserName, string Password)
        {
            try
            {
                DirectoryEntry de = GetDirectoryObject(UserName, Password);
                if (de != null)
                {
                    DirectorySearcher deSearch = new DirectorySearcher();
                    deSearch.SearchRoot  = de;
                    deSearch.Filter      = "(&(objectClass=user)(sAMAccountName=" + UserName + "))";
                    deSearch.SearchScope = SearchScope.Subtree;
                    SearchResult results = deSearch.FindOne();

                    if (results != null)
                    {
                        return(CSAAWeb.Constants.AD_AUTH_SUCCESS);
                    }
                    else
                    {
                        return(CSAAWeb.Constants.AD_AUTH_FAILURE);
                    }
                }
                else
                {
                    return(CSAAWeb.Constants.APPLICATION_ERROR);
                }
            }
            catch (DirectoryServicesCOMException ex)
            {
                string ADAuthErrMsg;
                string ADMessage;
                ADMessage = ex.ExtendedErrorMessage;
                if (ADMessage.Contains("52e"))
                {
                    //RFC 185138 - AD Integration start : Defect 226 Made code changes to display different error message for the user whose user id does not exists in Payment tool data base by cognizant on 05/03/2012
                    AuthenticationClasses.WebService.Authentication auth = new AuthenticationClasses.WebService.Authentication();
                    SessionInfo s = new SessionInfo(UserName, "APDS");

                    UserInfo U = auth.GetContactInfo(UserName, 0, s);
                    if (string.IsNullOrEmpty(U.UserId))
                    {
                        ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_NOTFOUND;
                    }
                    else
                    {
                        ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_INVALID;
                    }
                    //RFC 185138 - AD Integration end: Defect 226 Made code changes to display different error message for the user whose user id does not exists in Payment tool data base by cognizant on 05/03/2012
                }
                else if (ADMessage.Contains("775"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_LOCKED;
                }
                else if (ADMessage.Contains("701"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_ACNTEXPIRED;
                }
                else if (ADMessage.Contains("533"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_DISABLED;
                }
                else if (ADMessage.Contains("532"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_PWDEXPIRED;
                }
                else if (ADMessage.Contains("525"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_NOTFOUND;
                }
                else if (ADMessage.Contains("530"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_NOTPERMITTEDATTHISTIME;
                }
                else if (ADMessage.Contains("531"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_NOTPERMITTEDFROMTHISCOMP;
                }
                else if (ADMessage.Contains("773"))
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_RESETPASSWORD;
                }
                else
                {
                    ADAuthErrMsg = CSAAWeb.Constants.AD_ERR_ADAUTH;
                }

                return(ADAuthErrMsg);
            }
        }