⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sp010113.cpre

📁 商业银行前置系统
💻 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-09-10 Xiaomin Chen     - create implementation file for cics *            HLW                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";/* * Format constant macros */#ifdef ABISV20 #define FMT_I99 "%9ld%8s%4ld"#else#define FMT_I99 "%7ld%8s%4ld"#endif/* * Main function */void main(){    EXEC SQL BEGIN DECLARE SECTION;    ABISDSTRU abisdstru;    char szOrgSeqNo[AP_LEN_SEQNO + 1];    EXEC SQL END DECLARE SECTION;        CSISTRU csistru;    char szAmt[AP_LEN_AMT + 1];    char szOrgTransCode[AP_LEN_TRANSCODE + 1];    char szManualAuth[1 + 1];         TIASTRU tiastru;    TOASTRU toastru;        PXMLSTRU pxmlstruReq;    PXMLSTRU pxmlstruResp;    memset(&csistru, 0, sizeof(csistru));    if (!VERIFY_NULL(pxmlstruResp = ApScGetRespXml()) ||        !VERIFY_NULL(pxmlstruReq = ApScGetReqXml()))        EXEC CICS RETURN;     if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_ORGSEQNO, szOrgSeqNo)) ||        !VERIFY_NORMAL(AP_DEMAND(AP_PATH_ORGTRANSCODE, szOrgTransCode)))    {        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR);        EXEC CICS RETURN;    }        EXEC SQL SELECT * FROM abisd INTO :abisdstru WHERE seqno = :szOrgSeqNo;        if (!VERIFY_SQL_NORMAL())    {        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_SYSERR);        EXEC CICS RETURN;    }	if (strcmp(szOrgTransCode, AP_TRANSCODE_CS_AUTH) == 0)	{	    if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_MANUALAUTH, szManualAuth)))	    {	        ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR);	        EXEC CICS RETURN;	    }			}        if (strcmp(szOrgTransCode, AP_TRANSCODE_CS_CONSUME) != 0 &&        strcmp(szOrgTransCode, AP_TRANSCODE_CS_AUTHSETTLE) != 0 &&        strcmp(szOrgTransCode, AP_TRANSCODE_CS_AUTH) != 0 ||        strcmp(szOrgTransCode, AP_TRANSCODE_CS_AUTH) == 0 &&        strcmp(szManualAuth, "Y") == 0)    {        memset(&tiastru, 0, sizeof(tiastru));        memset(&toastru, 0, sizeof(toastru));            tiastru.nAppCode = 01;        tiastru.nTransCode = 99;        tprintf(tiastru.szDataA, FMT_I99,                abisdstru.nJrnNo, abisdstru.szVchNo, abisdstru.nTransCode);          LinkAbis(pxmlstruReq, pxmlstruResp, &tiastru, &toastru);            /*         * 如果交易失败,则应答信息中只有应答码有效,可以立即返回。         */            if (!ApIsRespCode(pxmlstruResp, AP_RESPCODE_ACCEPT))            EXEC CICS RETURN;    }    else    {        if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_MERCHNO, csistru.szMerchCode)) ||            !VERIFY_NORMAL(AP_DEMAND(AP_PATH_AMT, szAmt)))        {            ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR);            EXEC CICS RETURN;        }        /*         * 填写Csi 请求信息,并调用公共函数获得Csi 应答信息。         */        csistru.dAmt = atof(szAmt);                if (strcmp(szOrgTransCode, AP_TRANSCODE_CS_AUTH) == 0)        {            /*             * 预授权交易的撤销。             */                csistru.nTransCode = 9;            csistru.dAmt = 0.00;                        if (!VERIFY_NORMAL(AP_DEMAND(AP_PATH_AUTHCODE, csistru.szAuthCode)))            {                ApUpdateRespCode(pxmlstruResp, AP_RESPCODE_LOGERR);                EXEC CICS RETURN;            }        }        else            csistru.nTransCode = 13;        LinkCs(&csistru, pxmlstruReq, pxmlstruResp, TRUE);                if (!ApIsRespCode(pxmlstruResp, AP_RESPCODE_ACCEPT))            EXEC CICS RETURN;        }    EXEC CICS RETURN;}/* End of this file */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -