Esempio n. 1
0
        /// <summary>
        /// Inserts records for the line items.
        /// </summary>
        /// <param name="PaymentId">The payment id to insert lines for.</param>
        /// <param name="Lines">An array of the lines to insert.</param>
        private void Insert_Lines(int PaymentId, ArrayOfLineItem Lines)
        {
            SqlCommand Cmd = GetCommand("PAY_Insert_Item");

            for (int i = 0; i < Lines.Count; i++)
            {
                Insert_Record(Cmd, PaymentId, Lines[i]);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Inserts Cash/Check Transaction data in Database
        /// </summary>
        /// <param name="user">Encapsulates site user information.</param>
        /// <param name="AppName">The name of the application calling the method.</param>
        /// <param name="PaymentType">The type of payment.</param>
        /// <param name="ReceiptNo">The Receipt number for this Transaction.</param>
        /// <param name="MerchantRefNumber">The Merchant Reference Number for the Transaction</param>
        /// <param name="Items">Represents a collection of line items.</param>
        /// <param name="status">Transaction Status</param>
        /// <returns>Payment ID</returns>
        //MAIG - CH1 - BEGIN - Added the addtional parameter to get the AutoApproved and Accoutn Number details.
        public int pcCashCheck(UserInfo user, string AppName, int PaymentType, string ReceiptNo, string MerchantRefNumber, ArrayOfLineItem Items, string status, string crossSequenceNumber, List <string> InsData, bool IsAutoApproved)
        //MAIG - CH1 - END - Added the addtional parameter to get the AutoApproved and Accoutn Number details.
        {
            decimal TotalAmount = 0;
            int     PaymentId   = 0;

            try
            {
                int        ApplicationID      = 0;
                SqlCommand Cmd_Insert_Payment = GetCommand(CSAAWeb.Constants.PC_SP_Pay_InsertPayment);
                if (AppName.ToUpper().Equals(CSAAWeb.Constants.PC_APPID_PAYMENT_TOOL))
                {
                    ApplicationID = 4;
                }
                else if (AppName.ToUpper().Equals(CSAAWeb.Constants.PC_APPID_SALESX))
                {
                    ApplicationID = 5;
                }
                else
                {
                    ApplicationID = 12;
                }
                Cmd_Insert_Payment.Parameters.AddWithValue("applicationID", ApplicationID);
                Cmd_Insert_Payment.Parameters.AddWithValue("@receiptNumber", ReceiptNo);
                Cmd_Insert_Payment.Parameters.AddWithValue("@merchantRefNumber", MerchantRefNumber);
                Cmd_Insert_Payment.Parameters.AddWithValue("@paymentTypeID", PaymentType);
                foreach (LineItem line in Items)
                {
                    TotalAmount = TotalAmount + line.Amount;
                }
                Cmd_Insert_Payment.Parameters.AddWithValue("@amount", TotalAmount);
                Cmd_Insert_Payment.Parameters.AddWithValue("@userID", user.UserId);
                //MAIG - CH2 - BEGIN - Added the below code to check if the length of the error message does not exceed 20 characters
                if (status.Length >= 20)
                {
                    Cmd_Insert_Payment.Parameters.AddWithValue("@PC_Status", status.Substring(0, 20));
                }
                else
                {
                    Cmd_Insert_Payment.Parameters.AddWithValue("@PC_Status", status);
                }
                //MAIG - CH2 - END - Added the below code to check if the length of the error message does not exceed 20 characters
                Cmd_Insert_Payment.Parameters.AddWithValue("@physicalLocation", user.PhysicalLocation);
                Cmd_Insert_Payment.Parameters.AddWithValue("@financialLocation", user.FinancialLocation);
                //Added crossSequenceNumber in the input parameter list
                Cmd_Insert_Payment.Parameters.AddWithValue("@crossSequenceNumber", crossSequenceNumber);
                //MAIG - CH3 - BEGIN - Added the below code to pass the newly added Auto approval flag
                Cmd_Insert_Payment.Parameters.AddWithValue("@IsAutoApproved", IsAutoApproved);
                //MAIG - CH3 - END - Added the below code to pass the newly added Auto approval flag
                SqlParameter Paymentid = new SqlParameter("@PaymentId", System.Data.SqlDbType.VarChar, 15);
                Paymentid.Direction = ParameterDirection.Output;
                Cmd_Insert_Payment.Parameters.Add(Paymentid);
                Cmd_Insert_Payment.ExecuteNonQuery();
                PaymentId = int.Parse(Paymentid.Value.ToString());

                SqlCommand Cmd_Insert_Item = GetCommand(CSAAWeb.Constants.PC_SP_Pay_Insert_Item);
                for (int i = 0; i < Items.Count; i++)
                {
                    Cmd_Insert_Item.Parameters.AddWithValue("@PaymentId", PaymentId);
                    Cmd_Insert_Item.Parameters.AddWithValue("@LineItemNo", Items[i].LineItemNo);
                    //MAIG - CH4 - BEGIN - Added the below code to pass the Product Code and Company code for IDP Service if the request is from SalesX Interface
                    if (!string.IsNullOrEmpty(Items[i].ProductCode) && Items[i].ProductCode.Equals("10"))
                    {
                        Cmd_Insert_Item.Parameters.AddWithValue("@productCode", "HO");
                    }
                    else if (!string.IsNullOrEmpty(Items[i].ProductCode) && Items[i].ProductCode.Equals("WUA"))
                    {
                        Cmd_Insert_Item.Parameters.AddWithValue("@productCode", "PA");
                    }
                    else
                    {
                        Cmd_Insert_Item.Parameters.AddWithValue("@productCode", Items[i].ProductCode);
                    }
                    //MAIG - CH4 - END - Added the below code to pass the Product Code and Company code for IDP Service if the request is from SalesX Interface
                    Cmd_Insert_Item.Parameters.AddWithValue("@Amount", Items[i].Amount);
                    Cmd_Insert_Item.Parameters.AddWithValue("@lastName", Items[i].LastName);
                    Cmd_Insert_Item.Parameters.AddWithValue("@firstName", Items[i].FirstName);
                    Cmd_Insert_Item.Parameters.AddWithValue("@revenueType", Items[i].RevenueType);

                    //MAIG - CH5 - BEGIN - fetch the value from the List and save the Policy State, prefix, Company Code and Check Number

                    /*
                     * string[] StrSplitPolicy;
                     * string Policystate = "";
                     * string PolicyPrefix = "";
                     * string CompanyID = "";
                     * string AccountNumber = "";
                     * string checkNumber = "";
                     * StrSplitPolicy = Items[i].AccountNumber.Split('-');
                     * // For all PCP Products
                     * if (Config.Setting("PCP.Products").IndexOf(Convert.ToString(Items[i].ProductTypeNew)) > -1)
                     * {
                     *  AccountNumber =StrSplitPolicy[2];
                     *  Policystate = StrSplitPolicy[0];
                     *  PolicyPrefix = StrSplitPolicy[1];
                     *  CompanyID = StrSplitPolicy[3];
                     * }
                     * else
                     * {
                     *  //Payment tool UI - Check Transactions
                     *  if (AppName.ToUpper().Equals(CSAAWeb.Constants.PC_APPID_PAYMENT_TOOL) && (PaymentType == 4))
                     *  {
                     *      AccountNumber = StrSplitPolicy[0];
                     *      CompanyID = StrSplitPolicy[1];
                     *      //Added the below condition for assigning CompanyID - inactive policy and UI check transactions
                     *      if (CompanyID == string.Empty)
                     *      {
                     *          CompanyID = CSAAWeb.Constants.PC_COMPANY_CODE;
                     *      }
                     *      checkNumber = StrSplitPolicy[2];
                     *  }
                     *      //All other Transactions
                     *  else
                     *  {
                     *      AccountNumber = StrSplitPolicy[0];
                     *      if (StrSplitPolicy.Length > 1)
                     *      {
                     *          if (StrSplitPolicy[1] == string.Empty)
                     *          {
                     *              CompanyID = CSAAWeb.Constants.PC_COMPANY_CODE;
                     *          }
                     *          else
                     *          {
                     *              CompanyID = StrSplitPolicy[1];
                     *
                     *          }
                     *      }
                     *
                     *  }
                     * }*/

                    Cmd_Insert_Item.Parameters.AddWithValue("@policyState", InsData[0]);
                    Cmd_Insert_Item.Parameters.AddWithValue("@policyPrefix", InsData[1]);
                    Cmd_Insert_Item.Parameters.AddWithValue("@companyID", InsData[2]);
                    Cmd_Insert_Item.Parameters.AddWithValue("@policyNumber", Items[i].AccountNumber);
                    Cmd_Insert_Item.Parameters.AddWithValue("@checkNumber", InsData[3]);
                    Cmd_Insert_Item.Parameters.AddWithValue("@mailingZip", InsData[4]);
                    //MAIG - CH5 - END - fetch the value from the List and save the Policy State, prefix, Company Code and Check Number
                    Cmd_Insert_Item.Parameters.AddWithValue("@paymentTypeID", PaymentType);
                    Cmd_Insert_Item.ExecuteNonQuery();
                    Cmd_Insert_Item.Parameters.Clear();
                }
            }
            catch (Exception e)
            {
                Logger.Log(e.Message + e.StackTrace + e.InnerException);
                throw e;
            }
            return(PaymentId);
        }
Esempio n. 3
0
 /// <summary>
 /// Inserts Credit/E-Check Transaction data to Database
 /// </summary>
 /// <param name="user">Encapsulates site user information.</param>
 /// <param name="AppName">The name of the application calling the method.</param>
 /// <param name="PaymentType">The type of payment.</param>
 /// <param name="ReceiptNo">The Receipt number for this Transaction.</param>
 /// <param name="MerchantRefNumber">The Merchant Reference Number for the Transaction</param>
 /// <param name="ReturnCode">Response code from Payment Central</param>
 /// <param name="Card">Description for CardInfo.</param>
 /// <param name="Echeck">Capture the echeck information</param>
 /// <param name="Billto">BillToInfo encapsulates all the customer's billing information.</param>
 /// <param name="Items">Represents a collection of line items.</param>
 /// <param name="status">Transaction Status</param>
 //MAIG - CH6 - BEGIN - Added the Additional parameter InsData
 public void pcCreditCard(UserInfo user, string AppName, int PaymentType, string ReceiptNo, string MerchantRefNumber, string ReturnCode, CardInfo Card, eCheckInfo Echeck, BillToInfo Billto, ArrayOfLineItem Items, string status, string crossReferenceNumber, List <string> InsData)
 //MAIG - CH6 - END - Added the Additional parameter InsData
 {
     try
     {
         int PaymentId = 0;
         //MAIG - CH7 - BEGIN - Added the Policy State, prefix, Company Code details as a parameter.
         PaymentId = pcCashCheck(user, AppName, PaymentType, ReceiptNo, MerchantRefNumber, Items, status, crossReferenceNumber, InsData, false);
         //MAIG - CH7 - END - Added the Policy State, prefix, Company Code details as a parameter.
         SqlCommand Cmd_Insert_Card = GetCommand(CSAAWeb.Constants.PC_SP_Pay_InsertCardCheck);
         Cmd_Insert_Card.Parameters.AddWithValue("@paymentId", PaymentId);
         Cmd_Insert_Card.Parameters.AddWithValue("@Result_Code", "");
         Cmd_Insert_Card.Parameters.AddWithValue("@ReAuth", "");
         Cmd_Insert_Card.Parameters.AddWithValue("@BillToAddress", Billto.ToString());
         Cmd_Insert_Card.Parameters.AddWithValue("@Items", Items.ToString());
         Cmd_Insert_Card.Parameters.AddWithValue("@VerbalAuthorization", "");
         if (PaymentType == 5)
         {
             Cmd_Insert_Card.Parameters.AddWithValue("@RequestID", "");
             Cmd_Insert_Card.Parameters.AddWithValue("@Auth_Code", "");
             Cmd_Insert_Card.Parameters.AddWithValue("@BankId", Echeck.BankId);
             Cmd_Insert_Card.Parameters.AddWithValue("@signature", Echeck.signature);
             Cmd_Insert_Card.Parameters.AddWithValue("@BankAcntType", Echeck.BankAcntType);
             Cmd_Insert_Card.Parameters.AddWithValue("@CustomerName", Echeck.CustomerName);
             Cmd_Insert_Card.Parameters.AddWithValue("@CCType", 0);
             Cmd_Insert_Card.Parameters.AddWithValue("@CCExpYear", 0);
             Cmd_Insert_Card.Parameters.AddWithValue("@CCExpMonth", 0);
         }
         else
         {
             Cmd_Insert_Card.Parameters.AddWithValue("@RequestID", "");
             Cmd_Insert_Card.Parameters.AddWithValue("@Auth_Code", ReturnCode);
             Cmd_Insert_Card.Parameters.AddWithValue("@CCType", int.Parse(Card.CCType));
             Cmd_Insert_Card.Parameters.AddWithValue("@CCExpYear", Card.CCExpYear);
             Cmd_Insert_Card.Parameters.AddWithValue("@CCExpMonth", Card.CCExpMonth);
             Cmd_Insert_Card.Parameters.AddWithValue("@BankId", "");
             Cmd_Insert_Card.Parameters.AddWithValue("@signature", Card.Signature);
             Cmd_Insert_Card.Parameters.AddWithValue("@BankAcntType", "");
             Cmd_Insert_Card.Parameters.AddWithValue("@CustomerName", "");
         }
         Cmd_Insert_Card.ExecuteNonQuery();
     }
     catch (Exception e)
     {
         Logger.Log(e.Message + e.StackTrace + e.InnerException);
         throw e;
     }
 }
Esempio n. 4
0
 public CCResponse Auth(UserInfo User, string AppId, string MerchantRefNum, CardInfo Card, BillToInfo BillTo, ArrayOfLineItem Items)
 {
     return((CCResponse)Invoke(new object[] { User, AppId, MerchantRefNum, Card, BillTo, Items })[0]);
 }
Esempio n. 5
0
 public void UpdateLines(UserInfo User, string AppId, PaymentTypes PaymentType, string ReceiptNumber, string Reference, ArrayOfLineItem Items)
 {
     Invoke(new object[] { User, AppId, PaymentType, ReceiptNumber, Reference, Items });
 }
Esempio n. 6
0
 public CCResponse RecordPayment(UserInfo User, string AppId, PaymentTypes PaymentType, string ReceiptNumber, ArrayOfLineItem Items)
 {
     return((CCResponse)Invoke(new object[] { User, AppId, PaymentType, ReceiptNumber, Items })[0]);
 }
Esempio n. 7
0
 public CCResponse Auth(UserInfo User, string AppId, string MerchantRefNum, CardInfo Card, BillToInfo BillTo, ArrayOfLineItem Items)
 {
     return(DoAuth(new Payment(ServiceOperation.Auth, AppId, MerchantRefNum, "", "", Card, BillTo, Items, User)));
 }
Esempio n. 8
0
        public void UpdateLines(UserInfo User, string AppId, PaymentTypes PaymentType, string ReceiptNumber, string Reference, ArrayOfLineItem Items)
        {
            Payment P = new Payment(PaymentType, AppId, ReceiptNumber, Items, User);

            P.Reference = Reference;
            Data.UpdateLines(P);
        }
Esempio n. 9
0
 public CCResponse RecordPayment(UserInfo User, string AppId, PaymentTypes PaymentType, string ReceiptNumber, ArrayOfLineItem Items)
 {
     return(new CCResponse(Data.Begin_Transaction(new Payment(PaymentType, AppId, ReceiptNumber, Items, User))));
 }