Beispiel #1
0
        public byte[] GetField55(EC_PBOC pbocl, int type)
        {
            int    iValueLen  = 0;
            string strValue   = "";
            string strField55 = "";

            strField55 += pbocl.App_EMVGetData("9F26", 8, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F27", 1, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F10", ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F37", 4, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F36", 2, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("95", 5, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9A", 3, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9C", 1, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F02", 6, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("5F2A", 2, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("82", 2, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F1A", 2, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F03", 6, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F33", 3, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F34", 3, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F35", 1, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F1E", 8, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("84", 8, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F09", 2, ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F41", ref iValueLen, ref strValue);
            strField55 += pbocl.App_EMVGetData("9F63", ref iValueLen, ref strValue);
            if (type == 1)
            {
                strField55 += pbocl.App_EMVGetData("DF32", 2, ref iValueLen, ref strValue);
                strField55 += pbocl.App_EMVGetData("DF33", 2, ref iValueLen, ref strValue);
                strField55 += pbocl.App_EMVGetData("DF34", 7, ref iValueLen, ref strValue);
            }

            return(Utility.str2Bcd(strField55));
        }
Beispiel #2
0
        public bool CheckIsNoPin(NoPinAndSignParamData gNoPinAndSignParamData)
        {
            Log.Info("Enter CheckIsNoPin");
            int    iValueLen    = 0;
            string strValue9F6C = "";
            string strValue9F51 = "";
            string strValueDF71 = "";

            pboc.App_EMVGetData("9F51", ref iValueLen, ref strValue9F51);
            pboc.App_EMVGetData("DF71", ref iValueLen, ref strValueDF71);
            Log.Info("9F51:" + strValue9F51 + "DF71:" + strValueDF71);
            bool cFlag = string.IsNullOrEmpty(strValue9F51) && string.IsNullOrEmpty(strValueDF71); //取币别代码

            if (gNoPinAndSignParamData.CdcvmIndentity == "1")                                      // 启用CDCVM
            {
                pboc.App_EMVGetData("9F6C", ref iValueLen, ref strValue9F6C);
                Log.Info("9F6C:" + strValue9F6C);
                byte[] value9F6C = Encoding.Default.GetBytes(strValue9F6C);
                if (((value9F6C[0] & 0x80) != 0x80) && ((value9F6C[1] & 0x80) == 0x80)) //卡片不请求PIN,并且CDCVM已执行。
                {
                    return(true);
                }
            }

            if (gNoPinAndSignParamData.QpsIndentity == "1")
            {
                //取货币代码失败,视为内卡;第一或者第二币种其中之一为人民币,即为内卡
                if (cFlag || strValueDF71 == "0156" || strValue9F51 == "0156")
                {
                    if (gNoPinAndSignParamData.BinAIndentity == "1") //启用卡BIN表A
                    {
                        AppLog.Write("CardNo:" + CommonData.BankCardNum, AppLog.LogMessageType.Info);
                        if (gNoPinAndSignParamData.IsContainInCardBinA(CommonData.BankCardNum)) //BIN表A范围内
                        {
                            if (CommonData.Amount <=
                                double.Parse(gNoPinAndSignParamData.QpsLimitAmt) / 100d)
                            {
                                return(true);
                            }
                        }
                    }
                    else if (gNoPinAndSignParamData.BinBIndentity == "1") //启用卡BIN表B
                    {
                        AppLog.Write("gICAid:" + CommonData.BankCardNum, AppLog.LogMessageType.Info);
                        if (gICAid.StartsWith("A000000333010102") || gICAid.StartsWith("A000000333010103"))
                        //非借记卡AID,即为贷记卡
                        {
                            if (CommonData.Amount <=
                                double.Parse(gNoPinAndSignParamData.QpsLimitAmt) / 100d)
                            {
                                return(true);
                            }
                        }
                        else if (gNoPinAndSignParamData.IsContainInCardBinB(CommonData.BankCardNum)) //BIN表B范围内
                        {
                            if (CommonData.Amount <=
                                double.Parse(gNoPinAndSignParamData.QpsLimitAmt) / 100d)
                            {
                                return(true);
                            }
                        }
                    }
                    //else if (gNoPinAndSignParamData.BinCIndentity == "1")
                    //{
                    //    AppLog.Write("gICAid:" + CommonData.BankCardNum, AppLog.LogMessageType.Info);
                    //    if (gNoPinAndSignParamData.IsContainInCardBinC(CommonData.BankCardNum)) //BIN表C范围内
                    //    {
                    //        if (CommonData.Amount <=
                    //            double.Parse(gNoPinAndSignParamData.QpsLimitAmt) / 100d)
                    //        {
                    //            return false;
                    //        }
                    //        else
                    //        {
                    //            return true;
                    //        }
                    //    }
                    //    else
                    //        return true;
                    //}
                    else
                    {
                        return(true);
                    }
                }
                else
                {
                    if (gICAid.StartsWith("A000000333010102") || gICAid.StartsWith("A000000333010103"))
                    //非借记卡AID,即为贷记卡
                    {
                        if (CommonData.Amount <=
                            double.Parse(gNoPinAndSignParamData.QpsLimitAmt) / 100d)
                        {
                            return(true);
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(strValue9F6C))
                            {
                                byte[] value9F6C = Encoding.Default.GetBytes(strValue9F6C);
                                if ((value9F6C[0] & 0x80) != 0x80) //卡片不请求Pin
                                {
                                    return(true);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(strValue9F6C))
                        {
                            byte[] value9F6C = Encoding.Default.GetBytes(strValue9F6C);
                            if ((value9F6C[0] & 0x80) != 0x80) //卡片不请求Pin
                            {
                                return(true);
                            }
                        }
                    }
                }
            }
            return(false);
        }