public ActionResult Exchange(ExchangeModel model)
        {
            VirtualWS.VirtualSoapClient vs = new VirtualWS.VirtualSoapClient();
            StageVirtualWs.VirtualSoapClient stageVs = new StageVirtualWs.VirtualSoapClient();
            DevVirtualWs.VirtualSoapClient devVs = new DevVirtualWs.VirtualSoapClient();

            string XMLData = "";
            string EnXMLData = "";

            string EnData = "";
            string DeData = "";

           

            //string MerchantID = "1000139";
            //string MerchantTradeNo = "20120820222153";
            //string TradeNo = "20120820222201995707";
            //string ItemNo = "A001";
            //string Amount = "5";
            //string SNO = "NTMG-YCDT-ZJUB-SRUF";
            //string TimeStamp = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString();

            string MerchantID = model.MerchantID;
            string MerchantTradeNo = model.MerchantTradeNo;
            string TradeNo = model.TradeNo;
            string ItemNo = model.ItemNo;
            string Amount = model.Amount;
            string SNO = model.SNO;
            string PWD = model.PWD;
            string TimeStamp = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000).ToString();



            //BasePaymentService basePaymentService = new BasePaymentService();
            //MerchantFunction merchantFunctionData = basePaymentService.GetMerchantHashKey(Convert.ToInt64(MerchantID));

            XMLData += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
            XMLData += "<Root>";
            XMLData += "<Data>";
            XMLData += "<MerchantID>" + MerchantID + "</MerchantID>";
            XMLData += "<MerchantTradeNo>" + MerchantTradeNo + "</MerchantTradeNo>";
            XMLData += "<TradeNo>" + TradeNo + "</TradeNo>";
            XMLData += "<ItemNo>" + ItemNo + "</ItemNo>";
            XMLData += "<Amount>" + Amount + "</Amount>";
            XMLData += "<SNO>" + SNO + "</SNO>";
            XMLData += "<PWD>" + PWD + "</PWD>";
            XMLData += "<TimeStamp>" + TimeStamp + "</TimeStamp>";
            XMLData += "</Data>";
            XMLData += "</Root>";


            ViewBag.XMLData = XMLData;
            EnXMLData = new AllPay.ShareLib.Crypt().AES_EnCrypt(hashKey, hashIv, XMLData);
            ViewBag.EnXMLData = EnXMLData;

            //DevVirtualWs.VirtualSoapClient devvs = new DevVirtualWs.VirtualSoapClient();
            //EnData = devvs.Exchange(MerchantID, EnXMLData);

           

            if (currentEnv == "prod")
            {
                EnData = vs.Exchange(MerchantID, EnXMLData);
                ViewBag.EnData = EnData;
            }
            else if (currentEnv == "stage")
            {
                EnData = stageVs.Exchange(MerchantID, EnXMLData);
                ViewBag.EnData = EnData;
            }
            else if (currentEnv == "dev")
            {
                EnData = devVs.Exchange(MerchantID, EnXMLData);
                ViewBag.EnData = EnData;
            }

            DeData = new AllPay.ShareLib.Crypt().AES_DeCrypt(hashKey, hashIv, EnData);
            ViewBag.DeData = DeData;

            return View("ChargeBackConfirm");
        }
        public ActionResult Exchange()
        {

            ExchangeModel exchangeModel = new ExchangeModel();

            return View();
        }