T_PAYSBRPT - Payment Submission Detail Report

// Example Program: T_PAYSBRPT // Description: // This program demonstrates the CTI_RunPaySubmissionDetailReport() // subprocedure. This subprocedure retrieves CyberSource's on-demand // payment batch detail report. // // This example demonstrates downloading and saving a report to the IFS // without processing its contents. It will create an associated record // in CTIRPT. // // This program assumes that you have correctly configured your merchant // and environment tables (CTICFGMCH and CTICFGENV) and that you have at // least one valid batch transaction on the given date. Ctl-Opt ActGrp(*Caller) BndDir('CTIBND'); /COPY QRPGLECPY,CTICB // This is included for demo output purposes. Dcl-Pr WriteToJobLog Int(10) Extproc('Qp0zLprintf'); pString Pointer Value Options(*String); End-Pr; Dcl-C NewLine x'15'; // This stores the unique ID for this API call Dcl-S UniqueId Like(CTI_UniqueId_t) Inz; // This holds any error information returned by the API call Dcl-Ds ErrorDS LikeDS(CTI_ErrorDS_t) Inz(*LikeDS); // This holds configuration values for the report request API call Dcl-Ds ReportDS LikeDS(CTI_ReportAPIConfigDS_t) Inz(*LikeDS); // We need a new unique ID so that a record in CTIRPT can be created for // this report. UniqueId = CTI_NextUniqueId(); ReportDS.MerchantId = 'YOUR_MERCHANT_ID'; ReportDS.Operation = CTI_DOWNLOAD_REPORT; ReportDS.ReportDate = %Date( '2017-08-29' ); ReportDS.ReportFormat = CTI_REPORT_FORMAT_XML; // If we do not specify a value here, it will save the report file in // the default download directory set in CTICFGENV. The filename it is // saved under can be found in ReportDS.ReportStmf after the // subprocedure has been called. ReportDS.ReportStmf = '/your/reports/payment_submission_detail_' + %Char(%Int( UniqueId )) + '.xml'; if not CTI_RunPaySubmissionDetailReport( UniqueId : ReportDS : ErrorDS ); WriteToJobLog( 'Error Message Id: ' + ErrorDS.MessageId + NewLine ); WriteToJobLog( 'Error Message: ' + ErrorDS.Message + NewLine ); WriteToJobLog( 'Error Source: ' + ErrorDS.Source + NewLine ); endif; *INLR = *ON; return;