|
@@ -6700,28 +6700,7 @@ bool CCardIssuerFSM::ToRegistCaptureCardInfo(CSimpleStringA currCardNo)
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
|
|
|
return true;
|
|
|
}
|
|
|
-//bool CCardIssuerFSM::IfUseRf()
|
|
|
-//{
|
|
|
-// if (m_bStopUseRF)
|
|
|
-// return false;
|
|
|
-//
|
|
|
-// //加入szmodel非接字段属性判断
|
|
|
-// if (m_csRF.Compare("Y") == 0) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("szModel,RF=%s", m_csRF.GetData());
|
|
|
-// return true;
|
|
|
-// }
|
|
|
-// CAutoArray<CSimpleStringA> arr = m_rfVendorList.Split('|');
|
|
|
-//
|
|
|
-//
|
|
|
-// for (int i = 0; i < arr.GetCount(); ++i)
|
|
|
-// {
|
|
|
-// if (m_adapterInfo.adapterFilePath.IndexOf(arr[i].GetData()) > 0) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s,%s", arr[i].GetData(), m_adapterInfo.adapterFilePath.GetData());
|
|
|
-// return true;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// return false;
|
|
|
-//}
|
|
|
+
|
|
|
|
|
|
void CCardIssuerFSM::CheckSupportRf()
|
|
|
{
|
|
@@ -8942,1099 +8921,6 @@ int CCardIssuerFSM::PreOnlineJS_ICDataProcess(SpReqAnsContext<CardIssuerStoreSer
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-//int CCardIssuerFSM::ReadMag(SpReqAnsContext<CardIssuerStoreService_ReadJS_Req, CardIssuerStoreService_ReadJS_Ans>::Pointer ctx, bool& bReadCardInfo, bool& bReadMag, CSimpleStringA& t2Account)
|
|
|
-//{
|
|
|
-//
|
|
|
-// m_currCardNo = "";
|
|
|
-// ctx->Ans.magStatus = 0; //读磁硬件状态默认值
|
|
|
-//
|
|
|
-// ErrorCodeEnum eErr, eMagReadErr;
|
|
|
-// int activeCardType;
|
|
|
-// bool bIC(false);
|
|
|
-// long l_beginTime, l_endTime;
|
|
|
-// CSimpleString errMsg("");
|
|
|
-// errMsg = CSimpleString::Format("ReadCard, inParam: m_issueStatus:%d, m_currentHopper:%d", m_issueStatus, m_currentHopper);
|
|
|
-// //LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_ReadCard_Process, errMsg.GetData());
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(errMsg.GetData());
|
|
|
-//
|
|
|
-// MagTracks magTracks;
|
|
|
-// memset(magTracks.track[0].data, 0, sizeof(magTracks.track[0].data));
|
|
|
-// memset(magTracks.track[1].data, 0, sizeof(magTracks.track[1].data));
|
|
|
-// memset(magTracks.track[2].data, 0, sizeof(magTracks.track[2].data));
|
|
|
-// magTracks.eRange = CI_TRACK_RANGE_2_3;
|
|
|
-//
|
|
|
-// int readTries = 0;
|
|
|
-// do {
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// eMagReadErr = m_hDevHelper->MagRead(magTracks);
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (Error_Succeed == eMagReadErr) {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MagRead").setCostTime(l_endTime - l_beginTime)("ReadMag::MagRead t1Status:%d, t2Status:%d, t3Status:%d, t1Len:%d, t2Len:%d, t3Len:%d",
|
|
|
-// magTracks.track[0].eStatus, magTracks.track[1].eStatus, magTracks.track[2].eStatus, magTracks.track[0].dwSize, magTracks.track[1].dwSize, magTracks.track[2].dwSize);
|
|
|
-// bReadMag = true;//读卡成功
|
|
|
-// ctx->Ans.magStatus = 1;//成功
|
|
|
-// ctx->Ans.track1 = (char*)magTracks.track[0].data;
|
|
|
-// ctx->Ans.track2 = (char*)magTracks.track[1].data;
|
|
|
-// ctx->Ans.track3 = (char*)magTracks.track[2].data;
|
|
|
-// ctx->Ans.track1Size = magTracks.track[0].dwSize;
|
|
|
-// ctx->Ans.track2Size = magTracks.track[1].dwSize;
|
|
|
-// ctx->Ans.track3Size = magTracks.track[2].dwSize;
|
|
|
-// ctx->Ans.track1Status = (int)magTracks.track[0].eStatus;
|
|
|
-// ctx->Ans.track2Status = (int)magTracks.track[1].eStatus;
|
|
|
-// ctx->Ans.track3Status = (int)magTracks.track[2].eStatus;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("ReadMag::MagRead fail");
|
|
|
-// SetErrorAndLog(eMagReadErr, MEC_DEVAPI_CARDISSUER_MagRead, "DevAdapter::MagRead", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-// bReadMag = false;//读卡失败
|
|
|
-// ctx->Ans.magStatus = 0;//失败
|
|
|
-// ctx->Ans.track1 = "";
|
|
|
-// ctx->Ans.track2 = "";
|
|
|
-// ctx->Ans.track3 = "";
|
|
|
-// ctx->Ans.track1Size = 0;
|
|
|
-// ctx->Ans.track2Size = 0;
|
|
|
-// ctx->Ans.track3Size = 0;
|
|
|
-// ctx->Ans.track1Status = 1;
|
|
|
-// ctx->Ans.track2Status = 1;
|
|
|
-// ctx->Ans.track3Status = 1;
|
|
|
-// }
|
|
|
-// readTries++;
|
|
|
-//
|
|
|
-// //判断返回值长度
|
|
|
-// if (magTracks.track[1].dwSize > sizeof(magTracks.track[1].data) || magTracks.track[2].dwSize > sizeof(magTracks.track[2].data))
|
|
|
-// {
|
|
|
-// errMsg = CSimpleString::Format("MagRead, trackSize maybe wrong:t2Size:%d(%d), t3Size:%d(%d)",
|
|
|
-// magTracks.track[1].dwSize, sizeof(magTracks.track[1].data),
|
|
|
-// magTracks.track[2].dwSize, sizeof(magTracks.track[2].data));
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_TrackSize_Wrong, errMsg.GetData());
|
|
|
-// bReadMag = false;//读卡失败
|
|
|
-// ctx->Ans.magStatus = 0;//失败
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (Error_Succeed == eMagReadErr && magTracks.track[1].eStatus == CI_DATA_OK)
|
|
|
-// {
|
|
|
-// LogEvent(Severity_Middle, LOG_EVT_CARDISSUER_STORE_OP, "CardIssuer op.");
|
|
|
-// if (magTracks.track[1].dwSize > 40)
|
|
|
-// {
|
|
|
-// errMsg = CSimpleString::Format("MagRead, track2Size maybe wrong:t2Size:%d", magTracks.track[1].dwSize);
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_Track2Size_Wrong, errMsg.GetData());
|
|
|
-// //ctx->Ans.magStatus = 0;//失败
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// //ctx->Ans.track2 = (char*)magTracks.track[1].data;
|
|
|
-// bool bT3OK = false;
|
|
|
-// if (magTracks.track[2].eStatus == CI_DATA_OK)
|
|
|
-// {
|
|
|
-// bT3OK = true;
|
|
|
-// //ctx->Ans.track3 = (char*)magTracks.track[2].data;
|
|
|
-// }
|
|
|
-// Track2Data track2Data;
|
|
|
-// track2Data.status = 0;
|
|
|
-// track2Data.t2Account = "";
|
|
|
-// char* tmpMag2 = new char[256];
|
|
|
-// ZeroMemory(tmpMag2, 256);
|
|
|
-// DecodeTracksData((const char*)magTracks.track[1].data, magTracks.track[1].dwSize, (const char*)magTracks.track[2].data, magTracks.track[2].dwSize, tmpMag2, true, bT3OK);
|
|
|
-//
|
|
|
-// int pos = 0;
|
|
|
-// for (int i = 0; i < magTracks.track[1].dwSize; ++i, ++pos)
|
|
|
-// {
|
|
|
-// if (magTracks.track[1].data[i] == 0x3d || magTracks.track[1].data[i] == 0x3e || magTracks.track[1].data[i] == 0x44)// fixpoint (3d是=,3e是 >), 运通卡要考虑分隔符为D的情况
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleString::Format("<ReadMag::MagRead>, split pos:%d", pos));
|
|
|
-// if (pos <= 0 || pos == magTracks.track[1].dwSize)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<ReadMag::MagRead>, split track is err, pos:%d", pos);
|
|
|
-// //ctx->Ans.magStatus = 0;//失败
|
|
|
-// if (tmpMag2 != NULL)
|
|
|
-// {
|
|
|
-// delete[]tmpMag2;
|
|
|
-// tmpMag2 = NULL;
|
|
|
-// }
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//
|
|
|
-// char* ddd = new char[40];
|
|
|
-// memset(ddd, 0, 40);
|
|
|
-// memcpy(ddd, magTracks.track[1].data, pos);
|
|
|
-//
|
|
|
-// if (SplitTrack2(tmpMag2, track2Data) == 0)
|
|
|
-// {
|
|
|
-//
|
|
|
-// //ctx->Ans.magStatus = 1;//成功
|
|
|
-// //ctx->Ans.t2Account = track2Data.t2Account;
|
|
|
-// //ctx->Ans.t2Region = track2Data.t2Region;
|
|
|
-// //ctx->Ans.t2CardSerial = track2Data.t2CardSerial;
|
|
|
-// //ctx->Ans.t2CVC = track2Data.t2CVC;
|
|
|
-// //ctx->Ans.t2ExpireDate = track2Data.t2ExpireDate;
|
|
|
-// bReadCardInfo = true;//成功
|
|
|
-// m_currCardNo = track2Data.t2Account;
|
|
|
-// t2Account = track2Data.t2Account;
|
|
|
-// if (m_issueStatus)
|
|
|
-// {
|
|
|
-// //设置为mixed从读卡失败恢复为成功时才触发同步计数和写运行时
|
|
|
-// SetDevState(DEVICE_STATUS_NORMAL);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (_strnicmp(track2Data.t2Account, ddd, strlen(ddd)) && (track2Data.t2Account.GetLength() != 8))
|
|
|
-// {
|
|
|
-//
|
|
|
-// //ctx->Ans.magStatus = 1;//成功
|
|
|
-// //ctx->Ans.t2Account = (char*)ddd;
|
|
|
-// //ctx->Ans.t2Region = "";
|
|
|
-// //ctx->Ans.t2CardSerial = "";
|
|
|
-// //ctx->Ans.t2CVC = "";
|
|
|
-// //ctx->Ans.t2ExpireDate = "";
|
|
|
-// bReadCardInfo = true;//成功
|
|
|
-// m_currCardNo = (char*)ddd;
|
|
|
-// t2Account = (char*)ddd;
|
|
|
-// delete[]ddd;
|
|
|
-//
|
|
|
-// }
|
|
|
-// if (tmpMag2 != NULL)
|
|
|
-// {
|
|
|
-// delete[]tmpMag2;
|
|
|
-// tmpMag2 = NULL;
|
|
|
-// }
|
|
|
-// CSimpleString maskCardno = MaskCardno(m_currCardNo.GetData());
|
|
|
-//
|
|
|
-// CSimpleStringA cardInfo(true);
|
|
|
-// cardInfo = CSimpleStringA::Format("cardBin:%s , len:%d", maskCardno.GetData(), m_currCardNo.GetLength());
|
|
|
-// LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_CardBin, cardInfo.GetData());
|
|
|
-//
|
|
|
-// //if (!ctx->Ans.track2.IsNullOrEmpty() && (pos + 8) < magTracks.track[1].dwSize)
|
|
|
-// //{
|
|
|
-// // cardInfo = CSimpleStringA::Format("cardServiceCode:%s", (ctx->Ans.track2.SubString(pos + 1, 7)).GetData());
|
|
|
-// // LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_Track2_ServiceCode, cardInfo.GetData());
|
|
|
-// //}
|
|
|
-//
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// } while (readTries < READ_TRY_NUM);
|
|
|
-//
|
|
|
-// return 0;
|
|
|
-//}
|
|
|
-
|
|
|
-//int CCardIssuerFSM::CheckCardType(CSimpleStringA cardNo, bool bReadMag, int& ICtype)
|
|
|
-//{
|
|
|
-// LOG_FUNCTION();
|
|
|
-// long l_beginTime, l_endTime;
|
|
|
-// ErrorCodeEnum eErr;
|
|
|
-// //oilyang@20230331
|
|
|
-// //1、发卡且读磁成功,不再继续检测IC,一律ICType=1,以便读取IC
|
|
|
-// //2、其他情况(发卡未读到磁条或前端插卡),先查询户口系统进行卡片介质判定:
|
|
|
-// // 2a:户口系统返回非纯磁条介质类型,ICType以户口为准(ICType影响后续IC读取,即:都会读IC)
|
|
|
-// // 2b:其他情况(户口系统访问错(未走户口系统查或访问微服务失败或未返回介质类型或返回纯磁条卡),一律探测是否芯片卡
|
|
|
-// if (m_issueStatus && bReadMag)//发卡默认给芯片卡,且读到磁道(考虑卡片放错)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType>, issueStatus is true and read mag OK");
|
|
|
-// ICtype = 1;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// int cardTypeFromHost = 0;
|
|
|
-// bool bMismatch = false;
|
|
|
-// //开关控制是否主机查询cardtype
|
|
|
-// if (m_eacQueryFlag == 1) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType>, begin query host to check cardType");
|
|
|
-// cardTypeFromHost = JudgeCardType(cardNo, bMismatch);//0:失败 1:复合 2:磁条 3:ic
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType>, cardTypeFromHost=%d", cardTypeFromHost);
|
|
|
-// }
|
|
|
-// if (cardTypeFromHost > 0 && cardTypeFromHost != 2)//户口系统返回非纯磁条介质类型
|
|
|
-// {
|
|
|
-// ICtype = cardTypeFromHost;
|
|
|
-// //卡号不同则直接返回报错
|
|
|
-// if (m_bUseCardnoMismatch && bMismatch)
|
|
|
-// {
|
|
|
-// return 1;//账户和户口系统的最新账户不匹配
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType>, begin detect cardType");
|
|
|
-// //主动探测
|
|
|
-// int activeCardType;
|
|
|
-// int icRetryTimes = 0;
|
|
|
-// bool bIC(false);
|
|
|
-// while (1)
|
|
|
-// {//for poor mag only card,we always retry...
|
|
|
-// l_beginTime = RVCGetTickCount();
|
|
|
-// bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
-// l_endTime = RVCGetTickCount();
|
|
|
-// if (!bIC)
|
|
|
-// icRetryTimes++;
|
|
|
-// else
|
|
|
-// break;
|
|
|
-// Sleep(500);
|
|
|
-// if (icRetryTimes >= m_ICRetryTimes)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType::DetectIfICCard>, bIC:%d", bIC);
|
|
|
-// if (!bIC) {
|
|
|
-// ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
-// CSimpleStringA ApiName = "";
|
|
|
-// CSimpleStringA alarmMsg = "";
|
|
|
-// CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
-// GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WCT")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, 0x2200000a, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-//
|
|
|
-// //ic探测成功,0.无磁条IC 1.复合 2.磁条 3.纯IC
|
|
|
-// if (bIC) {
|
|
|
-// if (bReadMag){
|
|
|
-// ICtype = 1;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// ICtype = 3;
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_MaybeIC_Only, "<CheckCardType>, maybe IC only.");
|
|
|
-// }
|
|
|
-// //释放资源
|
|
|
-// l_beginTime = RVCGetTickCount();
|
|
|
-// eErr = m_hDevHelper->DeactivateICCard();
|
|
|
-// l_endTime = RVCGetTickCount();
|
|
|
-//
|
|
|
-// if (eErr != Error_Succeed) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CheckCardType::DeactivateICCard err");
|
|
|
-// SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_DeactivateICCard, "DevAdapter::DeactivateICCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-// } else {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DeactivateICCard").setCostTime(l_endTime - l_beginTime)("CheckCardType::DeactivateICCard");
|
|
|
-// }
|
|
|
-//
|
|
|
-// l_beginTime = RVCGetTickCount();
|
|
|
-// eErr = m_hDevHelper->ReleaseIC();
|
|
|
-// l_endTime = RVCGetTickCount();
|
|
|
-//
|
|
|
-// if (eErr != Error_Succeed) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CheckCardType::ReleaseIC err");
|
|
|
-// SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_ReleaseIC, "DevAdapter::ReleaseIC", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-// } else {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ReleaseIC").setCostTime(l_endTime - l_beginTime)("CheckCardType::ReleaseIC");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// //判断是否支持非接
|
|
|
-// if (!m_bSupportRF){
|
|
|
-// m_bUseRFTillNext = false;//无非接
|
|
|
-// if (bReadMag) {
|
|
|
-// ICtype = 2;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// ICtype = 0;
|
|
|
-// //既没有读到磁条,又不是IC,很大概率是插反了
|
|
|
-// LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_Maybe_InsertCard_InWrongStyle, "<CheckCardType>, 既没读到磁条,又没检测到IC,可能插反了");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// m_bUseRFTillNext = true;//使用非接
|
|
|
-//
|
|
|
-// l_beginTime = RVCGetTickCount();
|
|
|
-// eErr = m_hDevHelper->MoveCard(CI_MOVECARD_RF_POSITION);
|
|
|
-// l_endTime = RVCGetTickCount();
|
|
|
-//
|
|
|
-// if (eErr != Error_Succeed)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CheckCardType::MoveCard err");
|
|
|
-// SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime)("CheckCardType::MoveCard, (CI_MOVECARD_RF_POSITION)");
|
|
|
-// }
|
|
|
-//
|
|
|
-// icRetryTimes = 0;
|
|
|
-// bool bICRF(false);
|
|
|
-// while (1)
|
|
|
-// {//for poor mag only card,we always retry...
|
|
|
-// bICRF = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, activeCardType);
|
|
|
-// if (!bICRF)
|
|
|
-// icRetryTimes++;
|
|
|
-// else
|
|
|
-// break;
|
|
|
-// Sleep(500);
|
|
|
-// if (icRetryTimes >= m_ICRetryTimes)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType::DetectIfICCard_RF>, bIC:%d", bICRF);
|
|
|
-// if (!bICRF) {
|
|
|
-// ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
-// CSimpleStringA ApiName = "";
|
|
|
-// CSimpleStringA alarmMsg = "";
|
|
|
-// CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
-// GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WC6")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, 0x22000017, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (!(bICRF && activeCardType == 'A')) {
|
|
|
-// bICRF = false;
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (bICRF) {
|
|
|
-// if (bReadMag) {
|
|
|
-// ICtype = 1;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// ICtype = 3;
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_MaybeIC_Only, "<CheckCardType>, maybe IC only.");
|
|
|
-// }
|
|
|
-// //释放资源
|
|
|
-// l_beginTime = RVCGetTickCount();
|
|
|
-// eErr = m_hDevHelper->DeactContactlessICCard();
|
|
|
-// l_endTime = RVCGetTickCount();
|
|
|
-//
|
|
|
-// if (eErr != Error_Succeed) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("CheckCardType::DeactContactlessICCard err");
|
|
|
-// SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_DeactContactlessICCard, "DevAdapter::DeactContactlessICCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::DeactContactlessICCard").setCostTime(l_endTime - l_beginTime)("ReadCard_RF::DeactContactlessICCard");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// if (bReadMag) {
|
|
|
-// ICtype = 2;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// ICtype = 0;
|
|
|
-// //既没有读到磁条,又不是IC,很大概率是插反了
|
|
|
-// LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_Maybe_InsertCard_InWrongStyle, "<CheckCardType>, 既没读到磁条,又没检测到IC,可能插反了");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// CSimpleStringA cardType = CSimpleStringA::Format("cardType:%d", ICtype);
|
|
|
-// //LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_CardType, cardType.GetData());
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(cardType.GetData());
|
|
|
-// return 0;
|
|
|
-//}
|
|
|
-
|
|
|
-//int CCardIssuerFSM::PreOnlineJS_Contact(SpReqAnsContext<CardIssuerStoreService_ReadJS_Req, CardIssuerStoreService_ReadJS_Ans>::Pointer ctx, bool& bICOK, bool& bContinue)
|
|
|
-//{
|
|
|
-// LOG_FUNCTION();
|
|
|
-// long l_beginTime, l_endTime;
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("(PreOnlineJS_Contact) IC接触读卡");
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("PreOnlineJS_Contact, aid[%s], business data[%s]", ctx->Req.aid.GetData(), ctx->Req.businessData.GetData());
|
|
|
-//
|
|
|
-// m_pCardProcess->DataInit();
|
|
|
-// //数据已读出,开始pmoc流程
|
|
|
-// m_pCardProcess->SplitBusinessData(ctx->Req.businessData, ctx->Req.businessData.GetLength());
|
|
|
-// m_pCardProcess->SplitBusinessData("DF690101", strlen("DF690101"));
|
|
|
-// int activeCardType;
|
|
|
-// //oilyang@20201014 add emv card support
|
|
|
-// int retDetectAndRead = -1;
|
|
|
-// ICData aidFromBus(false, 0x4f, 0x00);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_BUS, aidFromBus, false, 0) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, the front BusinessData have not provide aid data.");
|
|
|
-// int icRetryTimes = 0;
|
|
|
-// while (1)
|
|
|
-// {
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (retDetectAndRead == -1)//only retry for active ic card failed!
|
|
|
-// icRetryTimes++;
|
|
|
-// else
|
|
|
-// break;
|
|
|
-// Sleep(500);
|
|
|
-// if (icRetryTimes >= m_ICRetryTimes)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// char* pAIDTmp = new char[64];
|
|
|
-// memset(pAIDTmp, 0, 64);
|
|
|
-// HexBuf2StrBuf(aidFromBus.value, &pAIDTmp, aidFromBus.lenth);
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, the aid from business is[%s],len:%d .", pAIDTmp, strlen(pAIDTmp));
|
|
|
-// CAutoArray<CSimpleString> preAIDs;
|
|
|
-// preAIDs.Init(1);
|
|
|
-// preAIDs[0] = (CSimpleStringA)pAIDTmp;
|
|
|
-// int icRetryTimes = 0;
|
|
|
-// while (1)
|
|
|
-// {
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (retDetectAndRead == -1)//only retry for active ic card failed!
|
|
|
-// icRetryTimes++;
|
|
|
-// else
|
|
|
-// break;
|
|
|
-// Sleep(500);
|
|
|
-// if (icRetryTimes >= m_ICRetryTimes)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// if (pAIDTmp != NULL)
|
|
|
-// delete[]pAIDTmp;
|
|
|
-// }
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, After invoke DetectAndReadICData, retDetectAndRead:%d, activeCardType:%d", retDetectAndRead, activeCardType);
|
|
|
-//
|
|
|
-// if (retDetectAndRead < 0)
|
|
|
-// {
|
|
|
-// ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
-// CSimpleStringA ApiName = "";
|
|
|
-// CSimpleStringA alarmMsg = "";
|
|
|
-// CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
-//
|
|
|
-// if (IfUseRf()) {
|
|
|
-// bContinue = true; //继续后面的非接流程
|
|
|
-// if (retDetectAndRead == -1) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败");
|
|
|
-// GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-//
|
|
|
-// if (m_issueStatus) {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else if (retDetectAndRead == -2) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
|
|
|
-// SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-// else if (retDetectAndRead == -3) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
|
|
|
-// SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// if (retDetectAndRead == -1) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败");
|
|
|
-// GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-//
|
|
|
-// if (m_issueStatus) {
|
|
|
-// if (IsInBusiness()) {
|
|
|
-// DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed);
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// if (IsInBusiness()) {
|
|
|
-// DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else if (retDetectAndRead == -2) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
|
|
|
-// DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
-// }
|
|
|
-// else if (retDetectAndRead == -3) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
|
|
|
-// DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// bICOK = false;
|
|
|
-// return 0;//上电读卡失败
|
|
|
-// }
|
|
|
-//
|
|
|
-// m_pCardProcess->TermRiskManage();
|
|
|
-// CSimpleStringA taaResult;
|
|
|
-// BYTE bt9f27 = 0;
|
|
|
-// int retTAA = m_pCardProcess->TermActionAnalyze(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, taaResult, true, m_bCDA, bt9f27);
|
|
|
-// if (retTAA != 0) {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, TermActionAnalyze, retTAA:%d, taaResult:%s", retTAA, taaResult.GetData());
|
|
|
-// }
|
|
|
-// switch (retTAA)
|
|
|
-// {//to be added oiltmp 20140929
|
|
|
-// case -1: //some data may be wrong
|
|
|
-// break;
|
|
|
-// case 1: //terminal trans
|
|
|
-// break;
|
|
|
-// case 2: //to do trans end "TransEnd"
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// ctx->Ans.result = taaResult;
|
|
|
-//
|
|
|
-// if (ctx->Ans.result.GetLength() == 0)
|
|
|
-// {
|
|
|
-// if (IfUseRf()) {
|
|
|
-// bContinue = true; //继续后面的非接流程
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>,TermActionAnalyze result len = 0");
|
|
|
-// ctx->Ans.icState = 0;
|
|
|
-// ctx->Answer(Error_Succeed);
|
|
|
-// }
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-//
|
|
|
-// string tmpResult, actionType, result = "", baseICData = "";
|
|
|
-// tmpResult = ctx->Ans.result;
|
|
|
-// char* pSomeICData = new char[ONE_K];
|
|
|
-// ZeroMemory(pSomeICData, ONE_K);
|
|
|
-// int lenRet = m_pCardProcess->ConstructARQCData(tmpResult.substr(6, 4).c_str(), m_pDataToARQC, pSomeICData);
|
|
|
-// baseICData = pSomeICData;
|
|
|
-// if (pSomeICData != NULL) {
|
|
|
-// delete[]pSomeICData;
|
|
|
-// }
|
|
|
-// char arqcLen[8];
|
|
|
-// ZeroMemory(arqcLen, sizeof(arqcLen));
|
|
|
-// _itoa(lenRet, arqcLen, 10);
|
|
|
-//
|
|
|
-// ICData track2(false, 0x57, 0x00), ICCardSerial(false, 0x5f, 0x34), appExpiryDate(false, 0x5f, 0x24);
|
|
|
-// ErrorCodeEnum eErr = Error_Unexpect;
|
|
|
-// string t2ICAccount(""), t2ICCardSerial(""), t2ICCVC(""), t2ICTrack2(""), cardType("0"), t2ICExpireDate("");
|
|
|
-//
|
|
|
-// char* pExpireDate = new char[12];//获取ic有效期
|
|
|
-// ZeroMemory(pExpireDate, 12);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, appExpiryDate, false, 0) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WF3")("<PreOnlineJS_Contact>, can't find expire date");
|
|
|
-// if (IfUseRf()) {
|
|
|
-// bContinue = true; //继续后面的非接流程
|
|
|
-// delete[] pExpireDate;
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// HexBuf2StrBuf(appExpiryDate.value, &pExpireDate, appExpiryDate.lenth);
|
|
|
-// t2ICExpireDate = pExpireDate;
|
|
|
-// }
|
|
|
-// delete[] pExpireDate;
|
|
|
-//
|
|
|
-//
|
|
|
-// char* pICCardSerial = new char[4];//获取ic序号
|
|
|
-// ZeroMemory(pICCardSerial, 4);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, ICCardSerial, false) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WF3")("<PreOnlineJS_Contact>, can't find card serial.");
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// HexBuf2StrBuf(ICCardSerial.value, &pICCardSerial, ICCardSerial.lenth);
|
|
|
-// t2ICCardSerial = pICCardSerial;
|
|
|
-// }
|
|
|
-// delete[] pICCardSerial;
|
|
|
-//
|
|
|
-//
|
|
|
-// char* pICTrack2 = new char[128];//获取等效磁条2
|
|
|
-// ZeroMemory(pICTrack2, 128);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, track2, false, 0) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WF3")("<PreOnlineCrossJS_Contact>, ic no track2 data");
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// eErr = m_hDevHelper->ReleaseIC();
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (eErr != Error_Succeed) {
|
|
|
-// SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ReleaseIC, "DevAdapter::ReleaseIC", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ReleaseIC").setCostTime(l_endTime - l_beginTime)("PreOnlineJS_Contact::ReleaseIC");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// HexBuf2StrBuf(track2.value, &pICTrack2, track2.lenth);
|
|
|
-// t2ICTrack2 = pICTrack2;
|
|
|
-//
|
|
|
-// int pos = FindHexCharPosition(track2.value, 0x0d, track2.lenth);
|
|
|
-// pICTrack2[37] = '\0';
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, ic.track2, split pos:%d", pos);
|
|
|
-// char* ddd = new char[40];
|
|
|
-// memset(ddd, 0, 40);
|
|
|
-// memcpy(ddd, pICTrack2, pos - 1);
|
|
|
-//
|
|
|
-// char icTrack2Data[128];
|
|
|
-// ZeroMemory(icTrack2Data, sizeof(icTrack2Data));
|
|
|
-//
|
|
|
-// Track2Data track2Data;
|
|
|
-// track2Data.status = 0;
|
|
|
-// track2Data.t2Account = "";
|
|
|
-// cmdDecodeMag2(pICTrack2, icTrack2Data);
|
|
|
-// if (SplitTrack2(icTrack2Data, track2Data) == 0)
|
|
|
-// {
|
|
|
-// t2ICAccount = track2Data.t2Account;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// LogWarn(Severity_Low, Error_Succeed, CardIssuerStore_UserErrorCode_Split_ICTrack2_Failed, CSimpleStringA::Format("<PreOnlineJS_Contact> SplitTrack2 fail,ic pTrack2.len:%d", strlen(icTrack2Data)));
|
|
|
-// }
|
|
|
-// if (_strnicmp(track2Data.t2Account, ddd, strlen(ddd)))
|
|
|
-// {
|
|
|
-// t2ICAccount = (char*)ddd;
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("count:%s,%s", t2ICAccount.substr(0, 6).c_str(), t2ICAccount.substr(t2ICAccount.length() - 4, 4).c_str());
|
|
|
-// }
|
|
|
-// delete[]ddd;
|
|
|
-// }
|
|
|
-// delete[]pICTrack2;
|
|
|
-//
|
|
|
-// //80 1e 80 0008 328ab54bfc986b85 07010103a0b000010a010000000000754048769000
|
|
|
-// if (m_pCardProcess->GetP1() == 0x1) {
|
|
|
-// actionType = "ARQC";
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline>, actionType is empty");
|
|
|
-// actionType = "";
|
|
|
-// }
|
|
|
-// //【55域】
|
|
|
-// // 基本域:
|
|
|
-// // 9F26 8b 应用密文AC
|
|
|
-// // 9F27 1b 密文信息数据
|
|
|
-// // 9F10 max.32b 发卡行应用数据IAD
|
|
|
-// // 9F37 4b 不可预知数
|
|
|
-// // 9F36 2b 应用交易计数器ATC
|
|
|
-// // 95 5b 终端验证结果TVR
|
|
|
-// // 9A 3cn 交易日期(6位有效数字,YYMMDD)
|
|
|
-// // 9C 1cn 交易类型(2位有效数字)
|
|
|
-// // 9F02 6cn 授权金额(12位有效数字)
|
|
|
-// // 5F2A 2cn 交易货币代码(3位有效数字)
|
|
|
-// // 82 2b 应用交互特征AIP
|
|
|
-// // 9F1A 2cn 终端国家代码(3位有效数字)
|
|
|
-// // 9F03 6cn 其他金额(12位有效数字)
|
|
|
-// // 9F33 3b 终端性能 "E0C900"
|
|
|
-//
|
|
|
-// // 可选域:
|
|
|
-// //添加9F26,9F27,9F10,9F33的数据
|
|
|
-// char* pCID = new char[4];
|
|
|
-// ZeroMemory(pCID, 4);
|
|
|
-// HexBuf2StrBuf(&bt9f27, &pCID, 1);
|
|
|
-// char* pIssueBankLen = new char[4];
|
|
|
-// ZeroMemory(pIssueBankLen, 4);
|
|
|
-// int len9f10 = tmpResult.length() - 26 - 4;
|
|
|
-// int lenHigh, lenLow;
|
|
|
-// len9f10 = len9f10 / 2;
|
|
|
-// lenHigh = len9f10 / 16;
|
|
|
-// lenLow = len9f10 % 16;
|
|
|
-// BYTE bt9f10;
|
|
|
-// bt9f10 = (lenHigh << 4) + lenLow;
|
|
|
-// HexBuf2StrBuf(&bt9f10, &pIssueBankLen, 1);
|
|
|
-// baseICData += "9F2608" + tmpResult.substr(10, 16) + "9F2701" + pCID + "9F10" + pIssueBankLen + tmpResult.substr(26, tmpResult.length() - 26 - 4) + "9F3303" + "E0C900";
|
|
|
-//
|
|
|
-//
|
|
|
-// //result = "ACTION," + actionType + "|" + "ATCCODE," + tmpResult.substr(6, 4) + "|" + "ARQCCODE," + tmpResult.substr(10, 16) + "|"
|
|
|
-// // + "MAC," + tmpResult.substr(26, tmpResult.length() - 26 - 4) + "|" + "ARQCSIZE," + string(arqcLen) + "|"
|
|
|
-// // + "ARQCDATA," + m_pDataToARQC + "|EXPIREDATE," + pExpireDate + "|T2ACCOUNT," + t2ICAccount + "|T2CARDSERIAL," + t2ICCardSerial
|
|
|
-// // + "|T2CVC," + t2ICCVC + "|T2TRACK2," + t2ICTrack2 + "|CARDCAT," + cardType + "|ICTAGS," + baseICData + "|MAGT2," + (const char*)csMagT2Track
|
|
|
-// // + "|MAGT3," + (const char*)csMagT3Track + "|MAGACCOUNT," + (const char*)csMagAccout + "|MAGREGION," + (const char*)csMagRegion
|
|
|
-// // + "|MAGCARDSERIAL," + (const char*)csMagCardSerial + "|MAGCVC," + (const char*)csMagCVC + "|MAGEXPIREDATAE," + (const char*)csMagExpireDate;
|
|
|
-//
|
|
|
-// //json格式返回
|
|
|
-// std::map<std::string, std::string> msgInfo;
|
|
|
-// msgInfo["ACTION"] = actionType.c_str();
|
|
|
-// msgInfo["ATC_CODE"] = tmpResult.substr(6, 4).c_str();
|
|
|
-// msgInfo["ARQC_CODE"] = tmpResult.substr(10, 16).c_str();
|
|
|
-// msgInfo["MAC"] = tmpResult.substr(26, tmpResult.length() - 26 - 4).c_str();
|
|
|
-// CSimpleStringA arqcLenStr = arqcLen;
|
|
|
-// msgInfo["ARQC_SIZE"] = arqcLenStr.GetData();
|
|
|
-// CSimpleStringA arqcData = m_pDataToARQC;
|
|
|
-// msgInfo["ARQC_DATA"] = arqcData.GetData();
|
|
|
-// msgInfo["T2TRACK2_DATA"] = t2ICTrack2.c_str();
|
|
|
-// msgInfo["EXPIRE_DATE"] = t2ICExpireDate.c_str();
|
|
|
-// msgInfo["T2CARD_SERIAL"] = t2ICCardSerial.c_str();
|
|
|
-// msgInfo["CARD_CAT"] = cardType.c_str();
|
|
|
-// msgInfo["IC_TAGS"] = baseICData.c_str();
|
|
|
-//
|
|
|
-// std::pair<bool, std::string> strResult;
|
|
|
-// strResult = generateJsonStr(msgInfo);
|
|
|
-// result = strResult.second.c_str();
|
|
|
-//
|
|
|
-// //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("data to host result=%s,len=%d", result.c_str(), result.length());
|
|
|
-//
|
|
|
-// string txtresult = "ACTION," + actionType + "|" + "ATCCODE," + tmpResult.substr(6, 4) + "|" + "ARQCCODE," + tmpResult.substr(10, 16) + "|"
|
|
|
-// + "MAC," + tmpResult.substr(26, tmpResult.length() - 26 - 4) + "|" + "ARQCSIZE," + string(arqcLen) + "|ARQCDATA, " + m_pDataToARQC + "|"
|
|
|
-// + "T2TRACK2(len)," + CSimpleStringA::Format("%d", t2ICTrack2.length()).GetData() + "|"
|
|
|
-// + "EXPIREDATE(len)," + CSimpleStringA::Format("%d", t2ICExpireDate.length()).GetData() + "|"
|
|
|
-// + "T2CARDSERIAL(len), " + CSimpleStringA::Format("%d", t2ICCardSerial.length()).GetData() + "|"
|
|
|
-// + "CARDCAT, " + cardType + "|"
|
|
|
-// + "ICTAGS, " + CSimpleStringA::Format("%d", baseICData.length()).GetData();
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, data to host(less)[%s]", txtresult.c_str());
|
|
|
-//
|
|
|
-// m_currCardNo = t2ICAccount.c_str();
|
|
|
-// //LogWarn(Severity_Low, Error_Unexpect, CardIssuerStore_UserErrorCode_CardBin, cardInfo.GetData());
|
|
|
-//
|
|
|
-// if (pCID != NULL)
|
|
|
-// delete[]pCID;
|
|
|
-// if (pIssueBankLen != NULL)
|
|
|
-// delete[]pIssueBankLen;
|
|
|
-//
|
|
|
-// if (m_pDataToARQC != NULL)
|
|
|
-// {
|
|
|
-// delete[]m_pDataToARQC;
|
|
|
-// m_pDataToARQC = NULL;
|
|
|
-// }
|
|
|
-//
|
|
|
-// ctx->Ans.result = result.c_str();
|
|
|
-// ctx->Ans.icState = 1;//成功
|
|
|
-// bICOK = true;
|
|
|
-// bContinue = false;
|
|
|
-// ctx->Answer(Error_Succeed);
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040222040")();
|
|
|
-// return 0;//不再继续后面的非接流程
|
|
|
-//}
|
|
|
-
|
|
|
-//int CCardIssuerFSM::PreOnlineJS_RF(SpReqAnsContext<CardIssuerStoreService_ReadJS_Req, CardIssuerStoreService_ReadJS_Ans>::Pointer ctx)
|
|
|
-//{
|
|
|
-// LOG_FUNCTION();
|
|
|
-// long l_beginTime, l_endTime;
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("(PreOnlineJS_RF) IC非接读卡");
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// ErrorCodeEnum eErr = m_hDevHelper->MoveCard(CI_MOVECARD_RF_POSITION);
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (eErr == Error_Succeed) {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime)("PreOnlineJS_RF::MoveCard, (CI_MOVECARD_RF_POSITION)");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("PreOnlineJS_RF, aid[%s], business data[%s]", ctx->Req.aid.GetData(), ctx->Req.businessData.GetData());
|
|
|
-//
|
|
|
-// m_pCardProcess->DataInit();
|
|
|
-// //数据已读出,开始pmoc流程
|
|
|
-// m_pCardProcess->SplitBusinessData(ctx->Req.businessData, ctx->Req.businessData.GetLength());
|
|
|
-// m_pCardProcess->SplitBusinessData("DF690101", strlen("DF690101"));
|
|
|
-//
|
|
|
-// int activeCardType;
|
|
|
-// //oilyang@20201014 add emv card support
|
|
|
-// int retDetectAndRead = -1;
|
|
|
-// ICData aidFromBus(false, 0x4f, 0x00);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_BUS, aidFromBus, false, 0) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_RF>, the front BusinessData have not provide aid data.");
|
|
|
-// int icRetryTimes = 0;
|
|
|
-// while (1)
|
|
|
-// {
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (retDetectAndRead == -1)//only retry for active ic card failed!
|
|
|
-// icRetryTimes++;
|
|
|
-// else
|
|
|
-// break;
|
|
|
-// Sleep(500);
|
|
|
-// if (icRetryTimes >= m_ICRetryTimes)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// char* pAIDTmp = new char[64];
|
|
|
-// memset(pAIDTmp, 0, 64);
|
|
|
-// HexBuf2StrBuf(aidFromBus.value, &pAIDTmp, aidFromBus.lenth);
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnlineJS_RF>, the aid from business is[%s],len:%d .", pAIDTmp, strlen(pAIDTmp));
|
|
|
-// CAutoArray<CSimpleString> preAIDs;
|
|
|
-// preAIDs.Init(1);
|
|
|
-// preAIDs[0] = (CSimpleStringA)pAIDTmp;
|
|
|
-// int icRetryTimes = 0;
|
|
|
-// while (1)
|
|
|
-// {
|
|
|
-// l_beginTime = GetTickCountRVC();
|
|
|
-// retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
|
|
|
-// l_endTime = GetTickCountRVC();
|
|
|
-// if (retDetectAndRead == -1)//only retry for active ic card failed!
|
|
|
-// icRetryTimes++;
|
|
|
-// else
|
|
|
-// break;
|
|
|
-// Sleep(500);
|
|
|
-// if (icRetryTimes >= m_ICRetryTimes)
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// if (pAIDTmp != NULL)
|
|
|
-// delete[]pAIDTmp;
|
|
|
-// }
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_RF>, After invoke DetectAndReadICData, retDetectAndRead:%d, activeCardType:%d", retDetectAndRead, activeCardType);
|
|
|
-//
|
|
|
-// if (retDetectAndRead < 0)
|
|
|
-// {
|
|
|
-// ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
-// CSimpleStringA ApiName = "";
|
|
|
-// CSimpleStringA alarmMsg = "";
|
|
|
-// CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
-//
|
|
|
-// if (retDetectAndRead == -1) {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败(非接)");
|
|
|
-// GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-//
|
|
|
-// if (m_issueStatus) {
|
|
|
-// if (IsInBusiness())
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W27")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W27")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-//
|
|
|
-// ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed);
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// if (IsInBusiness())
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
|
|
|
-// LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
|
|
|
-// }
|
|
|
-//
|
|
|
-// ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// else if (retDetectAndRead == -2) {
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
|
|
|
-// DWORD dwTmpUserErrCode = 0;
|
|
|
-// if (m_issueStatus) {
|
|
|
-// dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-// ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
-// }
|
|
|
-// else if (retDetectAndRead == -3) {
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
|
|
|
-// DWORD dwTmpUserErrCode = 0;
|
|
|
-// if (m_issueStatus) {
|
|
|
-// dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
-// }
|
|
|
-// ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
-// }
|
|
|
-// return 0;//上电读卡失败
|
|
|
-// }
|
|
|
-//
|
|
|
-// m_pCardProcess->TermRiskManage();
|
|
|
-// CSimpleStringA taaResult;
|
|
|
-// BYTE bt9f27 = 0;
|
|
|
-// int retTAA = m_pCardProcess->TermActionAnalyze(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, taaResult, true, m_bCDA, bt9f27);
|
|
|
-// if (retTAA != 0) {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnlineJS_RF>, TermActionAnalyze, retTAA:%d, taaResult:%s", retTAA, taaResult.GetData());
|
|
|
-// }
|
|
|
-// switch (retTAA)
|
|
|
-// {//to be added oiltmp 20140929
|
|
|
-// case -1: //some data may be wrong
|
|
|
-// break;
|
|
|
-// case 1: //terminal trans
|
|
|
-// break;
|
|
|
-// case 2: //to do trans end "TransEnd"
|
|
|
-// break;
|
|
|
-// default:
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// ctx->Ans.result = taaResult;
|
|
|
-//
|
|
|
-// if (ctx->Ans.result.GetLength() == 0)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("<PreOnlineJS_RF>,TermActionAnalyze result len = 0");
|
|
|
-// ctx->Ans.icState = 0;
|
|
|
-// ctx->Answer(Error_Succeed);
|
|
|
-// return 0;
|
|
|
-// }
|
|
|
-//
|
|
|
-// string tmpResult, actionType, result = "", baseICData = "";
|
|
|
-// tmpResult = ctx->Ans.result;
|
|
|
-// char* pSomeICData = new char[ONE_K];
|
|
|
-// ZeroMemory(pSomeICData, ONE_K);
|
|
|
-// int lenRet = m_pCardProcess->ConstructARQCData(tmpResult.substr(6, 4).c_str(), m_pDataToARQC, pSomeICData);
|
|
|
-// baseICData = pSomeICData;
|
|
|
-// if (pSomeICData != NULL)
|
|
|
-// delete[]pSomeICData;
|
|
|
-// char arqcLen[8];
|
|
|
-// ZeroMemory(arqcLen, sizeof(arqcLen));
|
|
|
-// _itoa(lenRet, arqcLen, 10);
|
|
|
-//
|
|
|
-//
|
|
|
-// ICData track2(false, 0x57, 0x00), ICCardSerial(false, 0x5f, 0x34), appExpiryDate(false, 0x5f, 0x24);
|
|
|
-// string t2ICAccount(""), t2ICCardSerial(""), t2ICCVC(""), t2ICTrack2(""), cardType("0"), t2ICExpireDate("");
|
|
|
-//
|
|
|
-// char* pExpireDate = new char[12];//获取ic有效期
|
|
|
-// ZeroMemory(pExpireDate, 12);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, appExpiryDate, false, 0) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WF3")("<PreOnlineJS_RF>, can't find expire date");
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// HexBuf2StrBuf(appExpiryDate.value, &pExpireDate, appExpiryDate.lenth);
|
|
|
-// t2ICExpireDate = pExpireDate;
|
|
|
-// }
|
|
|
-// delete[] pExpireDate;
|
|
|
-//
|
|
|
-//
|
|
|
-// char* pICCardSerial = new char[4];//获取ic序号
|
|
|
-// ZeroMemory(pICCardSerial, 4);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, ICCardSerial, false) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WF3")("<PreOnlineJS_RF>, can't find card serial.");
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// HexBuf2StrBuf(ICCardSerial.value, &pICCardSerial, ICCardSerial.lenth);
|
|
|
-// t2ICCardSerial = pICCardSerial;
|
|
|
-// }
|
|
|
-// delete[] pICCardSerial;
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// char* pICTrack2 = new char[128];//获取等效磁条2
|
|
|
-// ZeroMemory(pICTrack2, 128);
|
|
|
-// if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, track2, false, 0) == -1)
|
|
|
-// {
|
|
|
-// DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2WF3")("<PreOnlineJS_RF>, ic no track2 data");
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// HexBuf2StrBuf(track2.value, &pICTrack2, track2.lenth);
|
|
|
-// t2ICTrack2 = pICTrack2;
|
|
|
-//
|
|
|
-// int pos = FindHexCharPosition(track2.value, 0x0d, track2.lenth);
|
|
|
-// pICTrack2[37] = '\0';
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("<PreOnlineJS_RF>, ic.track2, split pos:%d", pos));
|
|
|
-// char* ddd = new char[40];
|
|
|
-// memset(ddd, 0, 40);
|
|
|
-// memcpy(ddd, pICTrack2, pos - 1);
|
|
|
-//
|
|
|
-// char icTrack2Data[128];
|
|
|
-// ZeroMemory(icTrack2Data, sizeof(icTrack2Data));
|
|
|
-//
|
|
|
-// Track2Data track2Data;
|
|
|
-// track2Data.status = 0;
|
|
|
-// track2Data.t2Account = "";
|
|
|
-// cmdDecodeMag2(pICTrack2, icTrack2Data);
|
|
|
-// if (SplitTrack2(icTrack2Data, track2Data) == 0)
|
|
|
-// {
|
|
|
-// t2ICAccount = track2Data.t2Account;
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// LogWarn(Severity_Low, Error_Succeed, CardIssuerStore_UserErrorCode_Split_ICTrack2_Failed, CSimpleStringA::Format("<PreOnlineJS_RF> SplitTrack2 fail,ic pTrack2.len:%d", strlen(icTrack2Data)));
|
|
|
-// }
|
|
|
-// if (_strnicmp(track2Data.t2Account, ddd, strlen(ddd)))
|
|
|
-// {
|
|
|
-// t2ICAccount = (char*)ddd;
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("count:%s,%s", t2ICAccount.substr(0, 6).c_str(), t2ICAccount.substr(t2ICAccount.length() - 4, 4).c_str());
|
|
|
-// }
|
|
|
-// delete[]ddd;
|
|
|
-// }
|
|
|
-// delete[]pICTrack2;
|
|
|
-//
|
|
|
-// //80 1e 80 0008 328ab54bfc986b85 07010103a0b000010a010000000000754048769000
|
|
|
-// if (m_pCardProcess->GetP1() == 0x1) {
|
|
|
-// actionType = "ARQC";
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline_RF>, actionType is empty");
|
|
|
-// actionType = "";
|
|
|
-// }
|
|
|
-// //【55域】
|
|
|
-// // 基本域:
|
|
|
-// // 9F26 8b 应用密文AC
|
|
|
-// // 9F27 1b 密文信息数据
|
|
|
-// // 9F10 max.32b 发卡行应用数据IAD
|
|
|
-// // 9F37 4b 不可预知数
|
|
|
-// // 9F36 2b 应用交易计数器ATC
|
|
|
-// // 95 5b 终端验证结果TVR
|
|
|
-// // 9A 3cn 交易日期(6位有效数字,YYMMDD)
|
|
|
-// // 9C 1cn 交易类型(2位有效数字)
|
|
|
-// // 9F02 6cn 授权金额(12位有效数字)
|
|
|
-// // 5F2A 2cn 交易货币代码(3位有效数字)
|
|
|
-// // 82 2b 应用交互特征AIP
|
|
|
-// // 9F1A 2cn 终端国家代码(3位有效数字)
|
|
|
-// // 9F03 6cn 其他金额(12位有效数字)
|
|
|
-// // 9F33 3b 终端性能 "E0C900"
|
|
|
-//
|
|
|
-// // 可选域:
|
|
|
-// //添加9F26,9F27,9F10,9F33的数据
|
|
|
-// char* pCID = new char[4];
|
|
|
-// ZeroMemory(pCID, 4);
|
|
|
-// HexBuf2StrBuf(&bt9f27, &pCID, 1);
|
|
|
-// char* pIssueBankLen = new char[4];
|
|
|
-// ZeroMemory(pIssueBankLen, 4);
|
|
|
-// int len9f10 = tmpResult.length() - 26 - 4;
|
|
|
-// int lenHigh, lenLow;
|
|
|
-// len9f10 = len9f10 / 2;
|
|
|
-// lenHigh = len9f10 / 16;
|
|
|
-// lenLow = len9f10 % 16;
|
|
|
-// BYTE bt9f10;
|
|
|
-// bt9f10 = (lenHigh << 4) + lenLow;
|
|
|
-// HexBuf2StrBuf(&bt9f10, &pIssueBankLen, 1);
|
|
|
-// baseICData += "9F2608" + tmpResult.substr(10, 16) + "9F2701" + pCID + "9F10" + pIssueBankLen + tmpResult.substr(26, tmpResult.length() - 26 - 4) + "9F3303" + "E0C900";
|
|
|
-//
|
|
|
-// //result = "ACTION," + actionType + "|" + "ATCCODE," + tmpResult.substr(6, 4) + "|" + "ARQCCODE," + tmpResult.substr(10, 16) + "|"
|
|
|
-// // + "MAC," + tmpResult.substr(26, tmpResult.length() - 26 - 4) + "|" + "ARQCSIZE," + string(arqcLen) + "|"
|
|
|
-// // + "ARQCDATA," + m_pDataToARQC + "|EXPIREDATE," + pExpireDate + "|T2ACCOUNT," + t2ICAccount + "|T2CARDSERIAL," + t2ICCardSerial
|
|
|
-// // + "|T2CVC," + t2ICCVC + "|T2TRACK2," + t2ICTrack2 + "|CARDCAT," + cardType + "|ICTAGS," + baseICData + "|MAGT2," + (const char*)csMagT2Track
|
|
|
-// // + "|MAGT3," + (const char*)csMagT3Track + "|MAGACCOUNT," + (const char*)csMagAccout + "|MAGREGION," + (const char*)csMagRegion
|
|
|
-// // + "|MAGCARDSERIAL," + (const char*)csMagCardSerial + "|MAGCVC," + (const char*)csMagCVC + "|MAGEXPIREDATAE," + (const char*)csMagExpireDate;
|
|
|
-//
|
|
|
-// //json格式返回
|
|
|
-// std::map<std::string, std::string> msgInfo;
|
|
|
-// msgInfo["ACTION"] = actionType.c_str();
|
|
|
-// msgInfo["ATC_CODE"] = tmpResult.substr(6, 4).c_str();
|
|
|
-// msgInfo["ARQC_CODE"] = tmpResult.substr(10, 16).c_str();
|
|
|
-// msgInfo["MAC"] = tmpResult.substr(26, tmpResult.length() - 26 - 4).c_str();
|
|
|
-// CSimpleStringA arqcLenStr = arqcLen;
|
|
|
-// msgInfo["ARQC_SIZE"] = arqcLenStr.GetData();
|
|
|
-// CSimpleStringA arqcData = m_pDataToARQC;
|
|
|
-// msgInfo["ARQC_DATA"] = arqcData.GetData();
|
|
|
-// msgInfo["T2TRACK2_DATA"] = t2ICTrack2.c_str();
|
|
|
-// msgInfo["EXPIRE_DATE"] = t2ICExpireDate.c_str();
|
|
|
-// msgInfo["T2CARD_SERIAL"] = t2ICCardSerial.c_str();
|
|
|
-// msgInfo["CARD_CAT"] = cardType.c_str();
|
|
|
-// msgInfo["IC_TAGS"] = baseICData.c_str();
|
|
|
-//
|
|
|
-// std::pair<bool, std::string> strResult;
|
|
|
-// strResult = generateJsonStr(msgInfo);
|
|
|
-// result = strResult.second.c_str();
|
|
|
-//
|
|
|
-// //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("data to host result=%s,len=%d", result.c_str(), result.length());
|
|
|
-//
|
|
|
-// string txtresult = "ACTION," + actionType + "|" + "ATCCODE," + tmpResult.substr(6, 4) + "|" + "ARQCCODE," + tmpResult.substr(10, 16) + "|"
|
|
|
-// + "MAC," + tmpResult.substr(26, tmpResult.length() - 26 - 4) + "|" + "ARQCSIZE," + string(arqcLen) + "|ARQCDATA, " + m_pDataToARQC + "|"
|
|
|
-// + "T2TRACK2(len)," + CSimpleStringA::Format("%d", t2ICTrack2.length()).GetData() + "|"
|
|
|
-// + "EXPIREDATE(len)," + CSimpleStringA::Format("%d", t2ICExpireDate.length()).GetData() + "|"
|
|
|
-// + "T2CARDSERIAL(len), " + CSimpleStringA::Format("%d", t2ICCardSerial.length()).GetData() + "|"
|
|
|
-// + "CARDCAT, " + cardType + "|"
|
|
|
-// + "ICTAGS, " + CSimpleStringA::Format("%d", baseICData.length()).GetData();
|
|
|
-//
|
|
|
-// DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, data to host(less)[%s]", txtresult.c_str());
|
|
|
-//
|
|
|
-// m_currCardNo = t2ICAccount.c_str();
|
|
|
-//
|
|
|
-// if (pCID != NULL)
|
|
|
-// delete[]pCID;
|
|
|
-// if (pIssueBankLen != NULL)
|
|
|
-// delete[]pIssueBankLen;
|
|
|
-//
|
|
|
-// if (m_pDataToARQC != NULL)
|
|
|
-// {
|
|
|
-// delete[]m_pDataToARQC;
|
|
|
-// m_pDataToARQC = NULL;
|
|
|
-// }
|
|
|
-//
|
|
|
-// ctx->Ans.result = result.c_str();
|
|
|
-// ctx->Ans.icState = 1;//成功
|
|
|
-// ctx->Answer(Error_Succeed);
|
|
|
-// LogWarn(Severity_Low, Error_Succeed, CardIssuerStore_UserErrorCode_ReadByRF, "PreOnlineJS_RF ok");
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040222040")();
|
|
|
-// return 0;
|
|
|
-//}
|
|
|
|
|
|
bool CCardIssuerFSM::AfterPreOnlineCrossJS(const int slot,CSimpleStringA cardNo)
|
|
|
{
|