public paymentAccountMaintainResponse MaintainPaymentAccount(paymentAccountMaintainRequest MaintainPaymentAccountRequest1)
    {
        MaintainPaymentAccountRequest inValue = new MaintainPaymentAccountRequest();

        inValue.MaintainPaymentAccountRequest1 = MaintainPaymentAccountRequest1;
        MaintainPaymentAccountResponse retVal = ((RecordFinancialAccount)(this)).MaintainPaymentAccount(inValue);

        return(retVal.MaintainPaymentAccountResponse1);
    }
        /// <summary>
        /// Update credit card details when the update button is clicked.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImgBtnUpdate_Click(object sender, ImageClickEventArgs e)
        {
            PlaceHolder PH_PolicyDetail = (PlaceHolder)this.NamingContainer.FindControl(Constants.PC_CNTRL_NAME);

            if (PH_PolicyDetail != null)
            {
                PH_PolicyDetail.Visible = true;
            }
            string PC_ProductCode = string.Empty;

            //MAIG - CH13 - BEGIN - Modified the below logic to check if the Page is Valid
            if (_isValid && Page.IsValid)
            //MAIG - CH13 - END - Modified the below logic to check if the Page is Valid
            {
                try
                {
                    //MAIG - CH4 - BEGIN - Logic to set the Update button Enabled property to false
                    ImgBtnUpdate.Enabled = false;
                    //OrderClasses.Service.Order authUserObj = new OrderClasses.Service.Order();
                    //UserInfo userInfoObj = new UserInfo();

                    //userInfoObj = authUserObj.Authenticate(HttpContext.Current.User.Identity.Name, string.Empty, CSAAWeb.Constants.PC_APPID_PAYMENT_TOOL);
                    //MAIG - CH4 - END - Logic to set the Update button Enabled property to false
                    if (!string.IsNullOrEmpty(hdnPaymentToken.Value))
                    {
                        List <string>             response    = new List <string>();
                        OrderClasses.OrderInfo    ordderInfo  = new OrderClasses.OrderInfo();
                        SessionInfo               sessionInfo = new SessionInfo();
                        IssueDirectPaymentWrapper actObj      = new IssueDirectPaymentWrapper();
                        string token = string.Empty;
                        ordderInfo.S                  = new SessionInfo();
                        ordderInfo.S.AppName          = CSAAWeb.Constants.PC_APPID_PAYMENT_TOOL;
                        ordderInfo.User               = new UserInfo();
                        ordderInfo.User.UserId        = HttpContext.Current.User.Identity.Name;
                        ordderInfo.Card               = new OrderClasses.CardInfo();
                        ordderInfo.Card.CCExpMonth    = _ExpireMonth.SelectedValue.ToString();
                        ordderInfo.Card.CCExpYear     = _ExpireYear.SelectedValue.ToString();
                        ordderInfo.Card.CCNumber      = lblCardNumberLast4Digit.Text;
                        ordderInfo.Detail             = new OrderClasses.OrderDetailInfo();
                        ordderInfo.Detail.PaymentType = 1;
                        OrderClasses.AddressInfo addressInfo = new OrderClasses.AddressInfo();
                        addressInfo.FirstName   = _Name.Text;
                        addressInfo.LastName    = " ";
                        addressInfo.Zip         = _txtZipCode.Text;
                        addressInfo.City        = " ";
                        addressInfo.State       = " ";
                        addressInfo.AddressType = OrderClasses.AddressInfoType.BillTo;
                        ordderInfo.Addresses.Add(addressInfo);

                        MaintainPaymentAccountRequest  inputRequest  = new MaintainPaymentAccountRequest();
                        MaintainPaymentAccountResponse tokenResponse = new MaintainPaymentAccountResponse();
                        inputRequest = actObj.Tokenmapping(ordderInfo, sessionInfo, hdnPaymentToken.Value);
                        inputRequest.MaintainPaymentAccountRequest1.saveForFuture = true;
                        if (inputRequest != null)
                        {
                            //Invokes the Payment Token Service
                            tokenResponse = actObj.InvokePaymentTokenService(inputRequest);
                        }
                        if (tokenResponse != null)
                        {
                            token = tokenResponse.MaintainPaymentAccountResponse1.paymentAccountToken;
                        }
                        else
                        {
                            //Added the below code to set Error flag if response object is null
                            Logger.Log(CSAAWeb.Constants.PC_ERR_RESPONSE_NULL);
                            lblErrMessage.Visible = true;
                            lblErrMessage.Text    = CSAAWeb.Constants.PC_ERR_RUNTIME_EXCEPTION;
                        }

                        PCEnrollmentMapping pCEnroll = new PCEnrollmentMapping();
                        //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Renamed the Autpay Enrollment request to Payment Enrollment request
                        RecordPaymentEnrollment.recordPaymentEnrollmentStatusRequest statusRequest = new RecordPaymentEnrollment.recordPaymentEnrollmentStatusRequest();
                        statusRequest = CreatePaymentStatusRequest(token);
                        //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Renamed the Autpay Enrollment request to Payment Enrollment request

                        //MAIG - CH5 - BEGIN -  Including Agent & Agency ID to the Enrollment Request
                        if (string.IsNullOrEmpty(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoAgencyID) || ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoAgencyID.ToString().Equals("0"))
                        {
                            statusRequest.agency = string.Empty;
                        }
                        else
                        {
                            statusRequest.agency = ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoAgencyID.ToString();
                        }

                        //////if (string.IsNullOrEmpty(userInfoObj.RepId.ToString()) || userInfoObj.RepId.ToString().Equals("0"))
                        //////    statusRequest.agentIdentifier = string.Empty;
                        //////else
                        //////    statusRequest.agentIdentifier = userInfoObj.RepId.ToString();

                        if (this.Page.User.Identity.Name.Length > 9)
                        {
                            statusRequest.agentIdentifier = Convert.ToString(this.Page.User.Identity.Name).Substring(1);
                        }
                        else if (string.IsNullOrEmpty(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoRepID) || !((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoRepID.ToString().Equals("0"))
                        {
                            statusRequest.agentIdentifier = Convert.ToString(((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._UserInfoRepID);
                        }
                        else
                        {
                            statusRequest.agentIdentifier = null;
                        }
                        //MAIG - CH5 - END -  Including Agent & Agency ID to the Enrollment Request

                        //CHG0112662 - BEGIN - Record Payment Enrollment SOA Service changes - Renamed the method
                        response = pCEnroll.PCPaymentEnrollService(statusRequest);
                        //CHG0112662 - END - Record Payment Enrollment SOA Service changes - Renamed the method

                        if (response[0].Equals(CSAAWeb.Constants.PC_SUCESS.ToUpper()))
                        {
                            Logger.Log(Constants.PC_LOG_STATUS_REQUEST_SUCCESS + statusRequest.policyInfo.policyNumber + Constants.PC_LOG_CNFRM_NUMBER + response[1].ToString());
                            Context.Items.Add(Constants.PC_CNFRMNUMBER, response[1].ToString());

                            //MAIG - CH6 - BEGIN -  Logic to set the Invalid Unenroll flag passed to Confirmation page and removing PUP Prefix
                            ////// Removing the logic to prefix the PUP for PUP Policies - start
                            ////////if (statusRequest.policyInfo.type == Constants.PC_TYPE_PUP)
                            ////////{
                            ////////    Context.Items.Add(Constants.PC_POLICYNUMBER, Constants.PC_PUP + statusRequest.policyInfo.policyNumber.ToString());
                            ////////}
                            ////////else
                            ////////{
                            Context.Items.Add(Constants.PC_POLICYNUMBER, statusRequest.policyInfo.policyNumber.ToString());
                            ////////}
                            ///// Removing the logic to prefix the PUP for PUP Policies - end

                            ////// Context.Items.Add("PC_INVALID_POLICY_FLOW_FLAG", false);
                            if (((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._InvalidUnEnrollFlow != null)
                            {
                                Context.Items.Add("PC_INVALID_UNENROLL_FLOW_FLAG", true);
                                Context.Items.Add("PC_INVALID_POLICY_FLOW_FLAG", false);
                            }
                            else
                            {
                                Context.Items.Add("PC_INVALID_UNENROLL_FLOW_FLAG", false);
                                Context.Items.Add("PC_INVALID_POLICY_FLOW_FLAG", false);
                            }
                            //MAIG - CH6 - END -  Logic to set the Invalid Unenroll flag passed to Confirmation page and removing PUP Prefix

                            Context.Items.Add(Constants.PC_CCNumber, Constants.PC_MASK_TXT + statusRequest.paymentItem.card.number);
                            //MAIG - CH15 - BEGIN - Added logic to add the condition for Amex and Discover
                            if (statusRequest.paymentItem.card.type.ToUpper().Equals(CSAAWeb.Constants.PC_CRD_TYPE_MASTER))
                            {
                                statusRequest.paymentItem.card.type = CSAAWeb.Constants.PC_CRD_TYPE_MASTER_EXPANSION;
                            }
                            else if (statusRequest.paymentItem.card.type.ToUpper().Equals(CSAAWeb.Constants.PC_CRD_TYPE_AMEX))
                            {
                                statusRequest.paymentItem.card.type = CSAAWeb.Constants.PC_CRD_TYPE_AMEX_EXPANSION;
                            }
                            else if (statusRequest.paymentItem.card.type.ToUpper().Equals(CSAAWeb.Constants.PC_CRD_TYPE_DISC))
                            {
                                statusRequest.paymentItem.card.type = CSAAWeb.Constants.PC_CRD_TYPE_DISC_EXPANSION;
                            }
                            //MAIG - CH15 - END - Added logic to add the condition for Amex and Discover
                            Context.Items.Add(Constants.PC_CCType, statusRequest.paymentItem.card.type.ToUpper());
                            //MAIG - CH7 - BEGIN -  Condition added to check if the policy is an valid policy
                            if (((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._InvalidUnEnrollFlow == null)
                            {
                                Context.Items.Add(Constants.PC_BILL_PLAN, ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page)).BillingPlan);
                                Context.Items.Add(Constants.PC_IS_ENROLLED, ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._IsEnrolled);
                                Context.Items.Add(Constants.PC_VLD_MDFY_ENROLLMENT, ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_Modifyenrollment);
                                Context.Items.Add(Constants.PC_VLD_ENROLLMENT, ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page))._ValidationService_enrollment);
                            }
                            //MAIG - CH7 - END -  Condition added to check if the policy is an valid policy
                            if ((_ExpireMonth.SelectedValue.Length) != 2)
                            {
                                Context.Items.Add(Constants.PC_CCEXP, "0" + _ExpireMonth.SelectedValue + "/" + _ExpireYear.SelectedValue);
                            }
                            else
                            {
                                Context.Items.Add(Constants.PC_CCEXP, _ExpireMonth.SelectedValue + "/" + _ExpireYear.SelectedValue);
                            }
                            Context.Items.Add(Constants.PC_PAYMT_TYPE, Constants.PC_CC);
                            Context.Items.Add(Constants.PC_CUST_NAME, _Name.Text);
                            Context.Items.Add(Constants.PC_EMAIL_ID, _txtEmailAddress.Text.ToString());
                            Context.Items.Add(Constants.PC_EDIT_CC, Constants.PC_EDIT_CC);
                            Context.Items.Add(Constants.PC_EDIT_CONST_RESPONSE, Constants.PC_EDIT_RESPONSE);
                            Server.Transfer(Constants.PC_RECURR_CNFRM_URL);
                        }
                        else
                        {
                            Logger.Log(Constants.PC_LOG_FAIL + statusRequest.policyInfo.policyNumber);
                            lblErrMessage.Visible = true;
                            //MAIG - CH14 - BEGIN - Modified code to display the Error Code only once
                            //lblErrMessage.Text = response[1].ToString() + " (" + response[0].ToString() + ")";
                            lblErrMessage.Text = response[1].ToString();
                            //MAIG - CH14 - END - Modified code to display the Error Code only once
                        }
                    }
                    else
                    {
                        lblErrMessage.Visible = true;
                        lblErrMessage.Text    = CSAAWeb.Constants.PC_ERR_RUNTIME_EXCEPTION;
                        Logger.Log(Constants.PC_UPCC_PToken_Empty + ((MSC.Forms.ManageEnrollment)(((SiteTemplate)Page).OrderService.Page)).PolicyNumber);
                    }
                }
                catch (FaultException faultExp)
                {
                    DisplayException(faultExp);
                    //MAIG - CH8 - BEGIN -  Condition added to enable the Update Button
                    ImgBtnUpdate.Enabled = true;
                    //MAIG - CH8 - END -  Condition added to enable the Update Button
                }
            }
        }