Beispiel #1
0
        public static void subProcessRefundEPSCC(decimal _decAmt, long _lngCampTrakID, string _strOriginalEPSTransID)
        {
            //Get TransactionSetupID from EPS
            try
            {
                wsEPSTrans.Express EPSExpress = new wsEPSTrans.Express();

                wsEPSTrans.Credentials EPSCred = new wsEPSTrans.Credentials();
                wsEPSTrans.Application EPSApp = new wsEPSTrans.Application();
                wsEPSTrans.Terminal EPSTerminal = new wsEPSTrans.Terminal();
                wsEPSTrans.Transaction EPSTrans = new wsEPSTrans.Transaction();
                wsEPSTrans.ExtendedParameters[] EPSExtParam = new wsEPSTrans.ExtendedParameters[0];

                string strEPSAcceptorID = "";
                string strEPSAccountID = "";
                string strEPSAccountToken = "";
                string strEPSTerminalID = "";

                try
                {
                    using (OleDbConnection conDB = new OleDbConnection(clsAppSettings.GetAppSettings().strCTConn))
                    {
                        conDB.Open();

                        string strSQL = "SELECT strEPSAcceptorID, strEPSAccountID, strEPSAccountToken, strEPSTerminalID " +
                                        "FROM tblCampDefaults";

                        using (OleDbCommand cmdDB = new OleDbCommand(strSQL, conDB))
                        {
                            using (OleDbDataReader drDef = cmdDB.ExecuteReader())
                            {
                                if (drDef.Read())
                                {
                                    strEPSAcceptorID = Convert.ToString(drDef["strEPSAcceptorID"]);
                                    strEPSAccountID = Convert.ToString(drDef["strEPSAccountID"]);
                                    strEPSAccountToken = Convert.ToString(drDef["strEPSAccountToken"]);
                                    strEPSTerminalID = Convert.ToString(drDef["strEPSTerminalID"]);
                                }

                                drDef.Close();
                            }
                        }

                        conDB.Close();
                    }
                }
                catch { }

                EPSCred.AcceptorID = strEPSAcceptorID;
                EPSCred.AccountID = strEPSAccountID;
                EPSCred.AccountToken = strEPSAccountToken;

                EPSApp.ApplicationID = "1190";
                EPSApp.ApplicationName = "CampTrak Software";
                EPSApp.ApplicationVersion = "1.0.0";

                EPSTrans.ReferenceNumber = _lngCampTrakID.ToString();

                EPSTerminal.TerminalID = strEPSTerminalID;

                EPSTrans.TransactionAmount = _decAmt.ToString("C").Replace("$", "");
                EPSTrans.TransactionID = _strOriginalEPSTransID;

                wsEPSTrans.Response EPSResponse = EPSExpress.CreditCardReturn(EPSCred, EPSApp, EPSTerminal, EPSTrans, EPSExtParam);

                System.Windows.Forms.MessageBox.Show("Response: " + EPSResponse.ExpressResponseMessage);
            }
            catch (Exception ex)
            {
            }
        }