public string VoidCreditCardTransaction(string requestId, string merchantReferenceCode, string siteName)
        {
            try
            {
                string _siteName = siteName;
                string _merchantId = "";
                string _transactionKey = "";

                sb.Append("CyberSource Class:\r\n");

                //call to get correct merchant id based on site name
                if (!String.IsNullOrEmpty(_siteName))
                {
                    _merchantId = Util.ConvertSiteNameToMerchantId(_siteName);
                }

                //call to get transaction key based on site name
                if (!String.IsNullOrEmpty(_siteName))
                {
                    _transactionKey = Util.GetTransactionKeyBySiteName(_siteName);
                }

                sb.Append("SiteName: " + _siteName + "\r\n");
                sb.Append("Merchant ID = " + _merchantId + "\r\n");

                var transaction_key = AppSettingsCheck.AppSettings("transaction_key");
                var address = AppSettingsCheck.AppSettings("endpoint");
                var _requestId = requestId;
                var _merchantReferenceCode = merchantReferenceCode;

                var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
                binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
                binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
                binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
                binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
                binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;

                var endpoint = new EndpointAddress(address);
                var proc = new CyberSourceClient.TransactionProcessorClient(binding, endpoint);
                _replyMessage = new CyberSourceClient.ReplyMessage();

                if (_requestMessage != null)
                {
                    if (!String.IsNullOrEmpty(_merchantId))
                    {

                    TODO: //Before doing a void call, we need to see if the merchant reference code exists within CyberSource table.
                        //If the reference code doesn't exist, throw an exception that prevents the void from completing on the site.
                        _requestMessage.merchantID = _merchantId;
                        _requestMessage.merchantReferenceCode = _merchantReferenceCode;
                        _requestMessage.voidService = new CyberSourceClient.VoidService
                        {
                            run = "true",
                            voidRequestID = _requestId
                        };
                    }

                    //assign merchant id
                    _requestMessage.merchantID = _merchantId;

                    if (proc.ChannelFactory.Credentials != null && !String.IsNullOrEmpty(_merchantId))
                    {
                        proc.ChannelFactory.Credentials.UserName.UserName = _merchantId;
                    }

                    if (proc.ChannelFactory.Credentials != null && !String.IsNullOrEmpty(_transactionKey))
                    {
                        proc.ChannelFactory.Credentials.UserName.Password = _transactionKey;
                    }

                    if (_replyMessage != null && proc != null)
                    {
                        //output void request value right before calling void
                        sb.Append("void request object right before calling cybersource void\r\n");
                        sb.Append("MerchantID = " + _requestMessage.merchantID + "\r\n RequestID = " + _requestMessage.voidService.voidRequestID + "\r\n");

                        _replyMessage = proc.runTransaction(_requestMessage);
                        sb.Append("Reply message from calling void. Void reply reason code: " + _replyMessage.voidReply.reasonCode + "\r\n");
                        TraceToVoidLog(sb.ToString());
                    }
                }
            }
            catch (TimeoutException e)
            {
                throw new TimeoutException("TimeoutException: " + e.Message + "\n" + e.StackTrace);
            }
            catch (SystemException e)
            {
                throw new SystemException("FaultException: " + e.Message + "\n" + e.StackTrace);
            }

            return _replyMessage.voidReply.reasonCode;
        }
        /// <summary>
        /// SendRequest constructs a CyberSource request object with 
        /// required parameters, and makes an authentication request to
        /// CyberSource. The reply message contains authorization code, token,
        /// and merchant request id
        /// </summary>
        /// <param name="siteName"></param>
        /// <returns></returns>
        public CyberSourceClient.ReplyMessage SendRequest(string siteName)
        {
            try
            {
                string _siteName = siteName;
                string _merchantId = "";
                string _transactionKey = "";

                sb.Append("CyberSource Class:\r\n");

                //call to get correct merchant id based on site name
                if (!String.IsNullOrEmpty(_siteName))
                {
                    _merchantId = Util.ConvertSiteNameToMerchantId(_siteName);
                }

                //call to get transaction key based on site name
                if (!String.IsNullOrEmpty(_siteName))
                {
                    _transactionKey = Util.GetTransactionKeyBySiteName(_siteName);
                }

                sb.Append("SiteName: " + _siteName + "\r\n");
                sb.Append("Merchant ID = " + _merchantId + "\r\n");

                TraceToLog(sb.ToString());

                var address = AppSettingsCheck.AppSettings("endpoint");

                var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
                binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue;
                binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue;
                binding.ReaderQuotas.MaxDepth = Int32.MaxValue;
                binding.ReaderQuotas.MaxNameTableCharCount = Int32.MaxValue;
                binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue;

                var endpoint = new EndpointAddress(address);
                var proc = new CyberSourceClient.TransactionProcessorClient(binding, endpoint);
                _replyMessage = new CyberSourceClient.ReplyMessage();

                //Authorization service setting
                _requestMessage.ccAuthService = new CyberSourceClient.CCAuthService();
                _requestMessage.ccAuthService.run = "true";

                //assign merchant id
                _requestMessage.merchantID = _merchantId;

                //toggle for ignoring the AVS response

                sb.Append("Entering AVS ignoring code block\r\n");
                // var avsResponse = true//ConfigurationManager.AppSettings["AVSResponse"];
                _requestMessage.businessRules = new CyberSourceClient.BusinessRules();

                if (_requestMessage.businessRules != null)
                {
                    _requestMessage.businessRules.ignoreAVSResult = "true";
                    sb.Append("Ignoring AVS response.");
                    TraceToLog(sb.ToString());
                }

                if (proc.ChannelFactory.Credentials != null && !String.IsNullOrEmpty(_merchantId))
                {
                    proc.ChannelFactory.Credentials.UserName.UserName = _merchantId;
                }

                if (proc.ChannelFactory.Credentials != null && !String.IsNullOrEmpty(_transactionKey))
                {
                    proc.ChannelFactory.Credentials.UserName.Password = _transactionKey;
                }

                if (_replyMessage != null && proc != null)
                {
                    _replyMessage = proc.runTransaction(_requestMessage);
                }

                return _replyMessage;
            }
            catch (TimeoutException e)
            {
                throw new TimeoutException("TimeoutException: " + e.Message + "\n" + e.StackTrace);
            }
            catch (SystemException e)
            {
                throw new SystemException("FaultException: " + e.Message + "\n" + e.StackTrace);
            }
        }