Exemplo n.º 1
0
        public EnquiryOutput load(string Target, Int32 Amount, int Counter)
        {
            EnquiryOutput outputObj = new EnquiryOutput();
            Security      secObj    = new Security();

            outputObj.status  = "1";
            outputObj.message = "not ok";

            string sessionid = string.Empty;

            if (SrvProviderSessionManager.GetSessionInstance().IsExistedSession("VinaphoneSession"))
            {
                sessionid = SrvProviderSessionManager.GetSessionInstance().GetSession("VinaphoneSession");
            }
            else
            {
                sessionid = login();
                SrvProviderSessionManager.GetSessionInstance().DelSession("VinaphoneSession");
                SrvProviderSessionManager.GetSessionInstance().AddSession(sessionid, "VinaphoneSession");
            }

            try
            {
                TransactionInput tranObj = new TransactionInput();
                tranObj.username = AppConfiguration.VinaPhoneUserName;
                //tranObj.password = secObj.TripleDES_Encrypt(secObj.Epay_Decrypt(Password, PasswordKey), sessionid);
                tranObj.password     = secObj.TripleDES_Encrypt(AppConfiguration.VinaPhoneAgentMPIN, sessionid); //
                tranObj.agentMsIsdn  = AppConfiguration.VinaPhoneAgentMsIsdl;
                tranObj.targetMsIsdn = Target;
                tranObj.amount       = Amount;
                tranObj.counter      = Counter;

                outputObj = eloadObj.load(tranObj);
                //Thread.Sleep(Timeout);

                return(outputObj);
            }
            catch
            {
                logout(sessionid);
                return(outputObj);
            }

            return(outputObj);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }