📄 sp010105.cpre
字号:
/* * This is a part of the Application Preconsole * - Service Provide - ABIS. * 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-05 Xiaomin Chen - create implementation file for cics * program of card service - 授权 */ #include <sybtesql.h>#include "ap.h"#include "apcs.h"#include "apsc.h"#include "apsp.h"EXEC SQL INCLUDE sqlca;EXEC SQL INCLUDE "abis.h";EXEC SQL INCLUDE "abisext.h";EXEC SQL INCLUDE "cs.h";/* * Main function */void main(){ CSISTRU csistru; char szAmt[AP_LEN_AMT + 1]; char szReqType[AP_LEN_REQTYPE + 1]; char szTrackVerify[1 + 1]; char szManualAuth[1 + 1]; PXMLSTRU pxmlstruResp; PXMLSTRU pxmlstruReq; memset(&csistru, 0, sizeof(csistru)); if (!VERIFY_NULL(pxmlstruResp = ApScGetRespXml()) || !VERIFY_NULL(pxmlstruReq = ApScGetReqXml())) EXEC CICS RETURN; /* * 填写Csi 请求信息,并调用公共函数获得Csi 应答信息。 */ if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_REQTYPE, szReqType))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } if (strcmp(szReqType, AP_REQTYPE_ISI) == 0 || strcmp(szReqType, AP_REQTYPE_TERM) == 0) { if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_MANUALAUTH, szManualAuth))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } if (strcmp(szManualAuth, "Y") == 0) { if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_CERTTYPE, csistru.szCertType)) || !VERIFY_NORMAL(AP_DEMAND(AP_PATH_CERTNO, csistru.szCertNo))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } csistru.nTransCode = 17; } else { if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_ACCPWD, csistru.szAccPwd))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } csistru.nTransCode = 8; } } else if (strcmp(szReqType, AP_REQTYPE_POS) == 0) { if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_ACCPWD, csistru.szAccPwd))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } csistru.nTransCode = 8; } else { AP_DEMAND(AP_PATH_ACCPWD, csistru.szAccPwd); csistru.nTransCode = 8; } if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_AMT, szAmt)) || !VERIFY_NORMAL(AP_DEMAND(AP_PATH_TRACKVERIFY, szTrackVerify)) || !VERIFY_NORMAL(AP_DEMAND(AP_PATH_MERCHNO, csistru.szMerchCode))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } csistru.dAmt = atof(szAmt); if (strcmp(szTrackVerify, "Y") == 0) { if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_TRACK2, csistru.szTrack2))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR); EXEC CICS RETURN; } AP_DEMAND(AP_PATH_TRACK3, csistru.szTrack3); csistru.nVerifyFlag = 1; } else csistru.nVerifyFlag = 0; LinkCs(&csistru, pxmlstruReq, pxmlstruResp, TRUE); if (!ApIsRespCode(pxmlstruResp, AP_RESPCODE_ACCEPT)) EXEC CICS RETURN; /* * 填写XML应答报文 */ if (!VERIFY_NORMAL(AP_INSERT(AP_PATH_AUTHCODE, csistru.szAuthCode))) { ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_EXCEPTION); EXEC CICS RETURN; } EXEC CICS RETURN;}/* End of this file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -