📄 sp020104.cpre
字号:
/* * This is a part of the Application Preconsole * - Service Provide - DSI. * Copyright (C) 2000-2000 ABC.SDC. * All rights reserved. * * This source code is only intended as a supplement to the * Application Preconsole Reference and related * electronic documentation provided with the library. * See these sources for detailed information regarding the * Application Preconsole product. * * Update record: * 2001-08-30 Shuming Pang - create implementation file for * pos refund */#include <sybtesql.h> #include "ap.h"#include "apsp.h"#include "apsc.h"EXEC SQL INCLUDE sqlca;EXEC SQL INCLUDE "dsi.h";EXEC SQL INCLUDE "dsiext.h";#define RETURN_RESP(pszRespCode) \ { \ ApUpdateRespCode(pxmlstruResp, pszRespCode); \ DeleteIso8583(&iso8583stru); \ EXEC CICS RETURN; \ }#define ASSURE_NORMAL(r) \ { \ if (!VERIFY_NORMAL(rTemp = (r))) \ { \ if (rTemp == INVALID) \ RETURN_RESP(AP_RESPCODE_LOGERR) \ else \ RETURN_RESP(AP_RESPCODE_SYSERR) \ } \ }void main(){ ISO8583STRU iso8583stru; PXMLSTRU pxmlstruReq; PXMLSTRU pxmlstruResp; RESULT rTemp; char szRespSeqNo[AP_LEN_SEQNO + 1]; UCHAR cPinKey[SIZE_KEY]; UCHAR cMacKey[SIZE_KEY]; memset(&iso8583stru, 0, sizeof(iso8583stru)); if (!VERIFY_NULL(pxmlstruReq = ApScGetReqXml()) || !VERIFY_NULL(pxmlstruResp = ApScGetRespXml())) EXEC CICS RETURN; AP_DEMAND_EXT(AP_PATH_RESPSEQNO, szRespSeqNo); if (!IsReady()) RETURN_RESP(AP_RESPCODE_SYS_INTERMIT) ASSURE_NORMAL(SetSmId()) ASSURE_NORMAL(GetKey(cPinKey, cMacKey)) ASSURE_NORMAL(CreateIso8583(&iso8583stru, ifistruDsi)) ASSURE_NORMAL(SetBitInIso8583(&iso8583stru, BIT_MSGID, "0220", SIZE_MSGID)) ASSURE_NORMAL(SetBitInIso8583(&iso8583stru, BIT_PROCESSCODE, "200000", SIZE_PROCESSCODE)) ASSURE_NORMAL(GetPan(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetTransAmt(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetTransmissDateTime(&iso8583stru)) ASSURE_NORMAL(GetTraceNo(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetLocalTransDate(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetLocalTransTime(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetMerchType(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetEntryMode(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetConditionCode(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetPinCaptureCode(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetAcqId(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetForwardId(&iso8583stru)) ASSURE_NORMAL(GetTrack2(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetTrack3(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetRetrievalRefNo(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetTermId(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetAcceptorId(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetAcceptorName(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(GetCurrCode(pxmlstruReq, &iso8583stru)) VERIFY_NORMAL(GetPin(pxmlstruReq, &iso8583stru, cPinKey)); VERIFY_NORMAL(GetAuthResp(pxmlstruReq, &iso8583stru)); ASSURE_NORMAL(GetSecurityCtrlInfo(pxmlstruReq, &iso8583stru)) ASSURE_NORMAL(SetMac(&iso8583stru, cTransMac, cMacKey)) rTemp = LinkDsi(&iso8583stru, szRespSeqNo); if (!VERIFY(rTemp != EXCEPTION)) RETURN_RESP(AP_RESPCODE_SYSERR) if (!VERIFY(rTemp != UNKNOWN) || !VERIFY_NORMAL(SetRespCode(pxmlstruResp, &iso8583stru))) RETURN_RESP(AP_RESPCODE_EXCEPTION) if (ApIsRespCode(pxmlstruResp, AP_RESPCODE_ACCEPT)) { if (!VERIFY_NORMAL(VerifyMac(&iso8583stru, cTransMac, cMacKey)) || !VERIFY_NORMAL(SetSettleDate(pxmlstruResp, &iso8583stru))) RETURN_RESP(AP_RESPCODE_EXCEPTION) } DeleteIso8583(&iso8583stru); EXEC CICS RETURN;}/* End of this file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -