예제 #1
0
        private byte[] PacketField48()
        {
            string temp = "C0V2560265200000" + "123456".PadRight(50, ' ') + "000000";

            byte[]     tmp     = Encoding.Default.GetBytes(temp);
            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF29", GetTerminalNo());
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF01", _currentIndex.ToString());
            handler.AddTag("1F2A", PayEntity.CityPowerNo);
            handler.AddTag("1F1A", PayEntity.PowerBusiness.ToString());      //1---智能电卡 预付费; 2---后付费;

            if (_currentIndex == 1)
            {
                handler.AddTag("1F3A", PayEntity.PowerCardData.EF1);
                handler.AddTag("1F4A", PayEntity.PowerCardData.EF2);
                handler.AddTag("1F5A", PayEntity.PowerCardData.EF5);
            }
            else if (_currentIndex == 2)
            {
                handler.AddTag("BF05", PayEntity.QueryTraceNo);
            }

            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            Log.Debug("End PacketField48");
            return(result);
        }
예제 #2
0
        private byte[] PacketField48()
        {
            string temp = "B7V2560265000000" + "".PadLeft(50, ' ') + "000000";

            byte[] tmp = Encoding.Default.GetBytes(temp);

            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());
            handler.AddTag("BF05", PayEntity.PayFlowNo);
            StringBuilder sb = new StringBuilder();

            foreach (var item in PayEntity.UserQueryInfo)
            {
                sb.Append(item.GetCommitValue());
            }
            handler.AddTag("3F1A", sb.ToString());
            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #3
0
        private byte[] PacketField48()
        {
            string temp = "U0V2560265200000" + PayEntity.PowerCardNo.PadRight(50, ' ') + "000000";

            byte[] tmp = Encoding.Default.GetBytes(temp);

            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());
            //handler.AddTag("FF54",PayEntity.EleFeeNum);
            //handler.AddTag("FF55",PayEntity.EleFeeAccountNum);
            //handler.AddTag("FF61",PayEntity.PowerIdentity);//新增2个tag ,提供银商对账用 2015-11-2
            handler.AddTag("BF05", PayEntity.QueryTraceNo);

            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #4
0
        //private byte[] PacketField57()
        //{
        //string temp = "";
        //if (_currentIndex == 1)
        //{
        //    temp = (PayEntity.PowerCardData.EF31 + PayEntity.PowerCardData.EF32).PadRight(999, ' ');
        //}
        //else if (_currentIndex == 2)
        //{
        //    temp = (PayEntity.PowerCardData.EF41 + PayEntity.PowerCardData.EF42).PadRight(999, ' ');
        //}
        //byte[] tmp = Encoding.Default.GetBytes(temp);
        //return tmp;
        //}


        private byte[] PacketField48()
        {
            string temp = "C1V2560265200000" + " ".PadRight(50, ' ') + "000000";

            byte[]     tmp     = Encoding.Default.GetBytes(temp);
            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());

            //Log.Info("PayEntity.PayFlowNo:" + PayEntity.PayFlowNo);
            //handler.AddTag("2F2B", _currentIndex.ToString());//包上送次数
            if (_currentIndex == 1)
            {
                handler.AddTag("1F1A", PayEntity.PowerPayConfirmCode);
            }
            //else if (_currentIndex == 2)
            //{
            //    handler.AddTag("BF05", PayEntity.CheckTraceNo);
            //}
            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #5
0
        private byte[] PacketField48()
        {
            string field48 = "C2v22901510000" + "".PadLeft(40, ' ') + "000000" + "2";

            byte[] tmp = Encoding.Default.GetBytes(field48);

            //Test
            string loginName = LoginName;
            string loginPsd  = LoginPsd;

#if DEBUG
            //loginName = "FW050106Z002010" + loginName;
            //loginName = "FW0100020";
            //loginName = "FW010101Z00501010" + loginName;
            loginName = "FW060101B00901100" + loginName;
            loginPsd  = "ODg4OA==";
#endif
            TLVHandler handler = new TLVHandler();
            handler.AddTag("FF44", loginName);
            handler.AddTag("FF45", loginPsd);
            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);
            return(result);
        }
예제 #6
0
        private byte[] PacketField48()
        {
            string field48 = "C0v22901510000" + UserID.PadLeft(40, ' ') + "000000" + "2";

            byte[]     tmp     = Encoding.Default.GetBytes(field48);
            TLVHandler handler = new TLVHandler();

            handler.AddTag("BF12", SelectRecordInfo[0]);
            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);
            return(result);
        }
예제 #7
0
        private byte[] PacketField48()
        {
            string temp = "B0V2560265200000" + PayEntity.PowerCardNo.PadRight(50, ' ') + "000000";

            byte[]     tmp     = Encoding.Default.GetBytes(temp);
            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");

            if (m_process == 1)
            {
                handler.AddTag("FF28", GetMerchantNo());
                handler.AddTag("FF29", GetTerminalNo());
                handler.AddTag("1F3A", PayEntity.PowerCardData.EF1);
                handler.AddTag("1F4A", PayEntity.PowerCardData.EF2);
                handler.AddTag("1F5A", PayEntity.PowerCardData.EF5);
            }
            else if (m_process == 2)
            {
                handler.AddTag("BF05", PayEntity.ConfirmTraceNo);
                //handler.AddTag("1F4A", PayEntity.PowerCardData.EF5);
            }
            handler.AddTag("BF15", PayEntity.PayFlowNo);
            handler.AddTag("FF01", m_process.ToString());
            handler.AddTag("1F1A", PayEntity.PowerBusiness.ToString());
            handler.AddTag("1F2A", PayEntity.CityPowerNo);


            //handler.AddTag("FF54", PayEntity.EleFeeNum);
            //handler.AddTag("FF55", PayEntity.EleFeeAccountNum);
            //handler.AddTag("1F20", Utility.AmountToString(CommonData.Amount.ToString()));
            //handler.AddTag("1F21", DateTime.Now.ToString("yyyyMMdd"));
            //handler.AddTag("1F22", PayEntity.PowerCardData.CardNo);
            //handler.AddTag("1F23", PayEntity.PowerCardData.Random);
            //handler.AddTag("1F24", PayEntity.PowerCardData.CardInfo);
            //handler.AddTag("1F25", PayEntity.PowerIdentity);
            //handler.AddTag("FF30", GetBranchNo());
            //handler.AddTag("FF31",GetOperatorNo());

            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #8
0
        private byte[] PacketField48()
        {
            byte[]     tmp     = HeandField48();
            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());

            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #9
0
        private byte[] PacketField48()
        {
            string temp = "B1V2560265200000" + PayEntity.PowerCardNo.PadRight(50, ' ') + "000000";

            byte[]     tmp     = Encoding.Default.GetBytes(temp);
            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());
            //handler.AddTag("3F2B", "51401");

            handler.AddTag("3F2B", PayEntity.PowerPayConfirmCode);
            if (_mProcess == 1)
            {
                handler.AddTag("1F3A", PayEntity.PowerCardData.EF1);
                handler.AddTag("1F4A", PayEntity.PowerCardData.EF2);
                handler.AddTag("1F5A", PayEntity.PowerCardData.EF5);
                //handler.AddTag("1F3A", "680100270280000000010000000000120000500000000000000001000001000000647890000445177640029316");
                //handler.AddTag("1F4A", "0000006400000007");
                //handler.AddTag("1F5A", "6811002B02000001000001000000647890000445177640000075F800000007000000000100040100000015010218016D16");
            }
            else if (_mProcess == 2)
            {
                handler.AddTag("BF05", PayEntity.ReWriteCardTraceNo1);
            }
            //else if (_mProcess == 3)
            //{
            //    handler.AddTag("BF05", PayEntity.ReWriteCardTraceNo2);
            //}
            handler.AddTag("FF01", _mProcess.ToString());
            handler.AddTag("1F1A", PayEntity.PowerBusiness.ToString());
            handler.AddTag("1F2A", PayEntity.CityPowerNo);
            //handler.AddTag("1F2A", "51401");

            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #10
0
        private byte[] PacketField48()
        {
            string temp = "U6V2560265000000" + PayEntity.DBNo.PadLeft(50, ' ') + "000000";

            byte[] tmp = Encoding.Default.GetBytes(temp);

            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());
            handler.AddTag("BF05", PayEntity.QueryTraceNo);
            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #11
0
        private byte[] PacketField48()
        {
            string temp = "C3V2571165010000" + "".PadLeft(50, ' ') + "000000";

            byte[]     tmp     = Encoding.Default.GetBytes(temp);
            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());
            handler.AddTag("2F1A", _index);
            handler.AddTag("2F2A", _cjjgid);
            handler.AddTag("2F3A", PayEntity.LicenseNo);

            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }
예제 #12
0
        private byte[] PacketField48()
        {
            byte[] tmp = HeandField48();

            TLVHandler handler = new TLVHandler();

            handler.AddTag("1F50", "0004");
            handler.AddTag("FF28", GetMerchantNo());
            handler.AddTag("FF29", GetTerminalNo());
            handler.AddTag("BF05", PayEntity.QueryTraceNo);
            if (PayEntity.PublishPayType == Entity.YaPublishPayType.TV)
            {
                handler.AddTag("2F1A", PayEntity.SelectMonth.ToString());
                handler.AddTag("2F2A", Utility.AmountToString(PayEntity.SelectPrice.ToString()).TrimStart('0'));
            }
            byte[] content = handler.GetTLVWithLength(3);
            byte[] result  = new byte[tmp.Length + content.Length + 1];
            Array.Copy(tmp, result, tmp.Length);
            Array.Copy(content, 0, result, tmp.Length, content.Length);

            Array.Copy(Encoding.Default.GetBytes("#"), 0, result, tmp.Length + content.Length, 1);

            return(result);
        }