Esempio n. 1
0
 protected override void Packet()
 {
     if (SendPackage.ExistBit(55))
     {
         byte[] bSend55 = SendPackage.GetArrayData(55);
         byte[] field55 = GetICAutoField55(bSend55, bSend55.Length);//IC卡55域有变动
         SendPackage.SetArrayData(55, field55, 0, field55.Length);
     }
     PackReverse(Reason);
 }
Esempio n. 2
0
        //protected override void Packet()
        //{
        //    if (SendPackage.ExistBit(55))
        //    {
        //        byte[] bSend55 = SendPackage.GetArrayData(55);
        //        byte[] field55 = GetICAutoField55(bSend55, bSend55.Length);//IC卡55域有变动
        //        SendPackage.SetArrayData(55, field55, 0, field55.Length);
        //    }
        //    PackReverse(Reason);
        //}

        protected override void Packet()
        {
            bool bIsIC = false;

            if (CommonData.UserCardType == UserBankCardType.ICCard ||
                CommonData.UserCardType == UserBankCardType.IcMagCard)
            {
                bIsIC = true;
            }

            SendPackage.SetString(0, "0400");
            if (!string.IsNullOrEmpty(CommonData.BankCardNum) && CommonData.BankCardNum.Length != 0)
            {
                SendPackage.SetString(2, CommonData.BankCardNum);
            }
            SendPackage.SetString(3, "190000");
            SendPackage.SetString(4, Utility.AmountToString(CommonData.Amount.ToString()));
            //PayEntity.PayTraceNo = GetTraceNo();
            //SendPackage.SetString(11, PayEntity.PayTraceNo);
            if (!string.IsNullOrEmpty(CommonData.BankCardExpDate) && CommonData.BankCardExpDate.Length != 0)//卡有效期
            {
                SendPackage.SetString(14, CommonData.BankCardExpDate);
            }
            if (bIsIC)//22
            {
                SendPackage.SetString(22, "051");
            }
            else
            {
                SendPackage.SetString(22, "021");
            }
            //if (!string.IsNullOrEmpty(CommonData.BankCardSeqNum) && CommonData.BankCardSeqNum.Length != 0)//卡序列号
            //{
            //    SendPackage.SetString(23, CommonData.BankCardSeqNum);
            //}
            SendPackage.SetString(25, "81"); //服务点条件代码
            //SendPackage.SetString(26, "06");
            if (!string.IsNullOrEmpty(CommonData.Track2) && CommonData.Track2.Length != 0)
            {
                SendPackage.SetString(35, CommonData.Track2.Replace('=', 'D'));
            }
            if (!string.IsNullOrEmpty(CommonData.Track3) && CommonData.Track3.Length != 0)
            {
                SendPackage.SetString(36, CommonData.Track3.Replace('=', 'D'));
            }
            SendPackage.SetString(41, GetTerminalNo());
            SendPackage.SetString(42, GetMerchantNo());
            SendPackage.SetArrayData(48, PacketField48());
            SendPackage.SetString(49, "156");
            if (SendPackage.ExistBit(55))
            {
                byte[] bSend55 = SendPackage.GetArrayData(55);
                byte[] field55 = GetICAutoField55(bSend55, bSend55.Length);//IC卡55域有变动
                SendPackage.SetArrayData(55, field55, 0, field55.Length);
            }
            PackReverse(Reason);

            //SendPackage.SetArrayData(52, Utility.str2Bcd(CommonData.BankPassWord));
            //switch (DType)
            //{
            //    case DesType.Des:
            //        SendPackage.SetString(53, "2000000000000000");
            //        break;
            //    case DesType.TripleDes:
            //        SendPackage.SetString(53, "2600000000000000");
            //        break;
            //}
            ////55
            //if (bIsIC && PayEntity.SendField55 != null && PayEntity.SendField55.Length != 0)
            //{
            //    SendPackage.SetArrayData(55, PayEntity.SendField55);
            //}
            //if (bIsIC)
            //    SendPackage.SetString(60, "22" + GetBatchNo() + "00050");
            //else
            //    SendPackage.SetString(60, "22" + GetBatchNo());

            ////创建冲正文件 98 96 06
            //CReverse_PowerPay cr = new CReverse_PowerPay(this);
            //cr.CreateReverseFile("98");
        }