Beispiel #1
0
        private byte[] PacketField48()
        {
            string field48 = "P0v22901510000" + UserID.PadLeft(40, ' ') + "000000" + "2";

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

            handler.AddTag("BF15", QueryTraceNo);
            handler.AddTag("FF44", SelectRecordInfo[3]);
            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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        /// <summary>
        /// 冲正使用的55域
        /// </summary>
        protected byte[] GetICAutoField55(byte[] _field55, int fieldLen)
        {
            //95 9F1E 9F10 9F36 DF31
            var field55 = new byte[fieldLen];

            Array.Copy(_field55, field55, fieldLen);
            var tlv     = new TLVHandler();
            var handler = new TLVHandler();

            handler.ParseTLV(field55);
            var value = new byte[0];

            #region 打包Field55

            if ((value = handler.GetBytesValue("95")) != null)
            {
                tlv.AddTag("95", value);
            }
            if ((value = handler.GetBytesValue("9F1E")) != null)
            {
                tlv.AddTag("9F1E", value);
            }
            if ((value = handler.GetBytesValue("9F10")) != null)
            {
                tlv.AddTag("9F10", value);
            }
            if ((value = handler.GetBytesValue("9F36")) != null)
            {
                tlv.AddTag("9F36", value);
            }
            if ((value = handler.GetBytesValue("DF31")) != null)
            {
                tlv.AddTag("DF31", value);
            }

            #endregion

            return(tlv.GetTLV());
        }
Beispiel #5
0
        private byte[] PacketField48()
        {
            string field48 = "C3v22901510000" + "".PadLeft(40, ' ') + "000000" + "2";

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

            string loginName   = LoginName;
            string loginPsd    = LoginPsd;
            string loginNewPsd = LoginNewPsd;

#if DEBUG
            loginName = "FW010101Z00501010" + LoginName;
#endif
            TLVHandler handler = new TLVHandler();
            handler.AddTag("FF44", loginName);
            handler.AddTag("FF45", loginPsd);
            handler.AddTag("FF46", loginNewPsd);
            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);
        }
Beispiel #6
0
        private byte[] PacketField48()
        {
            string temp = "C2V2571165010000" + "".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("1F1A", PayEntity.LicensePlant);
            handler.AddTag("1F2A", PayEntity.CarType);
            handler.AddTag("1F3A", PayEntity.CarId);
            handler.AddTag("1F4A", _index);//序号

            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);
        }
        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);
        }
Beispiel #8
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);
        }
        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);
        }
Beispiel #10
0
        /// <summary>
        /// 脚本通知的55域
        /// </summary>
        private byte[] GetField55Script(byte[] _field55)
        {
            //9F33 95 9F37 9F1E 9F10 9F26 9F36 82 DF31 9F1A 9A
            TLVHandler tlv     = new TLVHandler();
            TLVHandler handler = new TLVHandler();

            handler.ParseTLV(_field55);
            byte[] value = new byte[0];

            #region 打包Field55

            if ((value = handler.GetBytesValue("9F33")) != null)
            {
                tlv.AddTag("9F33", value);
            }
            if ((value = handler.GetBytesValue("95")) != null)
            {
                tlv.AddTag("95", value);
            }
            if ((value = handler.GetBytesValue("9F37")) != null)
            {
                tlv.AddTag("9F37", value);
            }
            if ((value = handler.GetBytesValue("9F1E")) != null)
            {
                tlv.AddTag("9F1E", value);
            }
            if ((value = handler.GetBytesValue("9F10")) != null)
            {
                tlv.AddTag("9F10", value);
            }
            if ((value = handler.GetBytesValue("9F26")) != null)
            {
                tlv.AddTag("9F26", value);
            }
            if ((value = handler.GetBytesValue("9F36")) != null)
            {
                tlv.AddTag("9F36", value);
            }
            if ((value = handler.GetBytesValue("82")) != null)
            {
                tlv.AddTag("82", value);
            }
            if ((value = handler.GetBytesValue("DF31")) != null)
            {
                tlv.AddTag("DF31", value);
            }
            if ((value = handler.GetBytesValue("9F1A")) != null)
            {
                tlv.AddTag("9F1A", value);
            }
            if ((value = handler.GetBytesValue("9A")) != null)
            {
                tlv.AddTag("9A", value);
            }
            #endregion

            return(tlv.GetTLV());
        }