Esempio n. 1
0
        /// <summary>
        /// EMV卡片交互
        /// </summary>
        /// <param name="field55"></param>
        /// <param name="AuthNo"></param>
        /// <returns></returns>
        public int EMVTransEnd(byte[] field55, string AuthNo)
        {
            int ret = 0;

            try
            {
                string temp = PubFunc.ByteArrayToHexString(field55, field55.Length);
                ret = pboc.App_EMVOnlineDataProcess(0, Encoding.Default.GetBytes(temp), temp.Length,
                                                    PubFunc.HexStringToByteArray(AuthNo), AuthNo.Length);
                if (ret == 0)
                {
                    byte[] field551   = new byte[1024];
                    int    field55Len = 0;
                    pboc.App_EMVGetField55(field551, ref field55Len);
                    EMVInfo.EndField55 = new byte[field55Len];
                    Array.Copy(field551, EMVInfo.EndField55, field55Len);
                }
            }
            catch (System.Exception ex)
            {
                Log.Error("App_EMVOnlineDataProcess Error!", ex);
                ret = -1;
            }
            finally
            {
                CardReader.CardPowerDown();
            }
            return(ret);
        }
Esempio n. 2
0
        /// <summary>
        /// EMV卡片交互
        /// </summary>
        /// <param name="field55"></param>
        /// <param name="AuthNo"></param>
        /// <returns></returns>
        public int EMVTransEnd(byte[] field55, string AuthNo)
        {
            int ret = 0;

            try
            {
                string temp = PubFunc.ByteArrayToHexString(field55, field55.Length);
                ret = pboc.App_EMVOnlineDataProcess(0, Encoding.Default.GetBytes(temp), temp.Length,
                                                    PubFunc.HexStringToByteArray(AuthNo), AuthNo.Length);
            }
            catch (System.Exception ex)
            {
                Log.Error("App_EMVOnlineDataProcess Error!", ex);
                ret = -1;
            }
            finally
            {
                CardReader.CardPowerDown();
            }
            return(ret);
        }
Esempio n. 3
0
        /// <summary>
        /// 交易完后与IC进行交互
        /// </summary>
        /// <param name="sendField55"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        private bool ICTransFunc(ref int state)
        {
            bool bRet = false;

            try
            {
                CR.CreateReverseFile();//建立冲正文件
                string temp = PubFunc.ByteArrayToHexString(EMVInfo.RecvField55, EMVInfo.RecvField55.Length);
                state = pboc.App_EMVOnlineDataProcess(0, Encoding.Default.GetBytes(temp),
                                                      temp.Length, PubFunc.HexStringToByteArray(EMVInfo.RecvField38),
                                                      EMVInfo.RecvField38.Length);
                CR.ClearReverseFile();//清除冲正文件
                bRet = true;
            }
            catch (System.Exception ex)
            {
                CR.DoReverseFile();//发起冲正
                CardReader.CardPowerDown();
                Log.Error("App_EMVOnlineDataProcess Error!", ex);
            }

            return(bRet);
        }