예제 #1
0
        //process stock transfer for MobiFone MobiEz system
        //ChungNN 08/2008
        private EPaySoap.OutputInfo MobiLoad(string MerchantID, string targetMsIsdn, decimal amount)
        {
            EPaySoap.OutputInfo retObj  = new EPaySoap.OutputInfo();
            Mobifone            mobiObj = new Mobifone();

            mobiEz.buyResponse loadObj = new buyResponse();

            try
            {
                loadObj = mobiObj.load(targetMsIsdn, amount);
                if (loadObj.buyReturn.result == 0)
                {
                    retObj.status  = "0";
                    retObj.message = "ok";
                    WriteLog("load on Mobifone successfull. ( MerchantID=" + MerchantID + ",  targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " )");
                }
                else
                {
                    retObj.status  = "1";
                    retObj.message = "not ok";
                    WriteLog("load on Mobifone failure. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " ), buyReturn.result=" + loadObj.buyReturn.result.ToString() + ", buyReturn.result_namespace=" + loadObj.buyReturn.result_namespace);
                }
            }
            catch (Exception ex)
            {
                retObj.status  = "1";
                retObj.message = "not ok";
                WriteLog("load on Mobifone failure, Exception =" + ex.ToString());
                throw (ex);
            }

            return(retObj);
        }
예제 #2
0
        //process stock transfer for VinaPhone e-load system
        //ChungNN 08/2008
        private EPaySoap.OutputInfo ViettelLoad(string MerchantID, string targetMsIsdn, Int32 amount, OutputVTload OutputVTObj)
        {
            EPaySoap.OutputInfo retObj = new EPaySoap.OutputInfo();
            EPaySoap.Security   secObj = new Security();

            Random random = new Random();
            //int nCounter = random.Next(9000000);
            string strCounter = DateTime.Now.ToString("yyyyMMddHHMMss");

            //Login to Viettel eload system
            try
            {
                Viettel      viettelObj = new Viettel();
                OutputVTload loadObj    = new OutputVTload();
                loadObj     = viettelObj.load(targetMsIsdn, amount, strCounter);
                OutputVTObj = loadObj;

                //If load seccessfull
                if (loadObj.status == "0")
                {
                    retObj.status  = loadObj.status;
                    retObj.message = loadObj.message;
                    WriteLog("load on Viettel successfull. ( MerchantID=" + MerchantID + ",  targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " )");
                }
                else
                {
                    //status = "1"
                    retObj.status  = "1";
                    retObj.message = loadObj.message;
                    WriteLog("load on Viettel failure. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " ) ");
                }
            }
            catch (Exception ex)
            {
                WriteLog("load on Viettel failure, Exception=" + ex.ToString());
                throw (ex);
            }

            return(retObj);
        }
예제 #3
0
        //process stock transfer from agent to agent
        //ChungNN 03/2009
        private EPaySoap.OutputInfo VinaStockTransfer(string MerchantID, string targetMsIsdn, Int32 amount)
        {
            EPaySoap.OutputInfo retObj = new EPaySoap.OutputInfo();
            EPaySoap.Security   secObj = new Security();

            Random random   = new Random();
            int    nCounter = random.Next(9000000);

            //stock transfer from agent to agent
            try
            {
                Vinaphone     vinaObj          = new Vinaphone();
                EnquiryOutput stocktransferObj = new EnquiryOutput();
                stocktransferObj = vinaObj.stock_transfer(targetMsIsdn, amount, nCounter);

                //If transfer seccessfull
                if (stocktransferObj.status == "0")
                {
                    retObj.status  = stocktransferObj.status;
                    retObj.message = stocktransferObj.message;
                    WriteLog("stock transfer on VinaPhone successfull. ( MerchantID=" + MerchantID + ",  targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " )");
                }
                else
                {
                    //VinaPhone fix status = "1"
                    retObj.status  = "1";
                    retObj.message = stocktransferObj.message;
                    WriteLog("stock transfer on VinaPhone failure. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " ) ");
                }
            }
            catch (Exception ex)
            {
                WriteLog("stock transfer on VinaPhone failure, Exception=" + ex.ToString());
                throw (ex);
            }

            return(retObj);
        }
예제 #4
0
        //process load for VinaPhone e-load system
        //ChungNN 08/2008
        private EPaySoap.OutputInfo VinaLoad(string MerchantID, string targetMsIsdn, Int32 amount)
        {
            EPaySoap.OutputInfo retObj = new EPaySoap.OutputInfo();
            EPaySoap.Security   secObj = new Security();

            Random random   = new Random();
            int    nCounter = random.Next(9000000);

            //load to Vinaphone mobie user
            try
            {
                Vinaphone     vinaObj = new Vinaphone();
                EnquiryOutput loadObj = new EnquiryOutput();
                loadObj = vinaObj.load(targetMsIsdn, amount, nCounter);

                //If load seccessfull
                if (loadObj.status == "0")
                {
                    retObj.status  = loadObj.status;
                    retObj.message = loadObj.message;
                    WriteLog("load on VinaPhone successfull. ( MerchantID=" + MerchantID + ",  targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " )");
                }
                else
                {
                    //VinaPhone fix status = "1"
                    retObj.status  = "1";
                    retObj.message = loadObj.message;
                    WriteLog("load on VinaPhone failure. ( MerchantID=" + MerchantID + ", targetMsIsdn=" + targetMsIsdn + ", amount=" + amount.ToString() + " ) ");
                }
            }
            catch (Exception ex)
            {
                WriteLog("load on VinaPhone failure, Exception=" + ex.ToString());
                throw (ex);
            }

            return(retObj);
        }