VFN_ShowLineItem()
This subprocedure calls Verifone’s Show Line Items service.
Subprocedure Prototype
|
Returns *OFF if an error occurs during processing, *ON otherwise. |
|
|
|
|
|
Optional parameter that, if passed, will contain error data returned from the subprocedure. |
Example Code
// Example Program: T_SHLNITM
// Description:
// This is a test program to illustrate how to use the
// VFN_ShowLineItem() subprocedure.
//
// This program assumes you have already called VFN_StartSession() to
// open a session with your device, and that you will call
// VFN_EndSession() afterwards.
Ctl-Opt DftActGrp(*No) ActGrp(*Caller) BndDir('PTTIBND');
/COPY QRPGLECPY,VFNCB
// 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 will capture returned error information
Dcl-Ds ErrorDS LikeDS(VFN_ErrorDS_t) Inz(*LikeDS);
// This will be used to pass request information to the API call
Dcl-Ds ShowLineItemReqDS LikeDS(VFN_ShowLineItemReqDS_t) Inz(*LikeDS);
// This will store parsed response data from the API call
Dcl-Ds ShowLineItemRspDS LikeDS(VFN_ShowLineItemRspDS_t) Inz(*LikeDS);
reset ErrorDS;
reset ShowLineItemReqDS;
reset ShowLineItemRspDS;
// This must be a device that has been successfully registered with
// VFN_Register() and which exists in VFNDVC.
ShowLineItemReqDS.DeviceID = 'test';
// These fields can be assigned a log file path, and will save the
// request and response xml data.
ShowLineItemReqDS.RequestLog = 'T_SHLNITM_Request.xml';
ShowLineItemReqDS.ResponseLog = 'T_SHLNITM_Response.xml';
// if VFN_ShowLineItem() returns *Off, it means that an error occurred
// as part of the overall communication process, and the information
// will be in ErrorDS - ErrorDS.Message is the main field to look at
// for troubleshooting.
if not VFN_ShowLineItem( ShowLineItemReqDS : ShowLineItemRspDS
: ErrorDS );
// handle error
WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine );
WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine );
*INLR = *On;
return;
else;
WriteToJobLog( 'Response Text: ' + ShowLineItemRspDS.ResponseText
+ NewLine);
WriteToJobLog( 'Result: ' + ShowLineItemRspDS.Result + NewLine );
WriteToJobLog( 'Result Code: ' + ShowLineItemRspDS.ResultCode
+ NewLine );
WriteToJobLog( 'Termination Status: '
+ ShowLineItemRspDS.TerminationStatus + NewLine );
endif;
*INLR = *On;
return;