This subprocedure can be used to remove all MERCHANDISE and OFFER line items from the device display using Verifone’s Remove Line Items service.

Subprocedure Prototype

D VFN_RemoveAllLineItems...
D                 PR              N   Extproc('VFN_RemoveAllLineItems')

Returns *OFF if an error occurs during processing, *ON otherwise.

D  pRequestDS                         LikeDS(VFN_RemoveAllLineItemsReqDS_t)
D                                     Const
D  pResponseDS                        LikeDS(VFN_RemoveAllLineItemsRspDS_t)
D  pErrorDS                           LikeDS(VFN_ErrorDS_t)
D                                     Options(*Nopass)

Optional parameter that, if passed, will contain error data returned from the subprocedure.

Example Code

// Example Program: T_RMVLIALL // Description: // This is a test program to illustrate how to use the // VFN_RemoveAllLineItems() subprocedure to remove all existing // LineItems. // // Please refer to T_RMVLNITM to see the process for removing a single // line item in a transaction, or to T_RMLNITMS for removing multiple // line items in one transaction. // // 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 RemoveALllineItemsReqDS LikeDS(VFN_RemoveAllLineItemsReqDS_t) Inz(*LikeDS); // This will store parsed response data from the API call Dcl-Ds RemoveAllLineItemsRspDS LikeDS(VFN_RemoveAllLineItemsRspDS_t) Inz(*LikeDS); reset ErrorDS; reset RemoveALllineItemsReqDS; reset RemoveAllLineItemsRspDS; // This must be a device that has been successfully registered with // VFN_Register() and which exists in VFNDVC. RemoveALllineItemsReqDS.DeviceID = 'test'; // These fields can be assigned a log file path, and will save the // request and response xml data. RemoveALllineItemsReqDS.RequestLog = 'T_RMVLIALL_Request.xml'; RemoveALllineItemsReqDS.ResponseLog = 'T_RMVLIALL_Response.xml'; // if VFN_RemoveAllLineItems() 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_RemoveAllLineItems( RemoveAllLineItemsReqDS : RemoveAllLineItemsRspDS : ErrorDS ); // handle error WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine ); WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine ); *INLR = *On; return; else; WriteToJobLog( 'Response Text: ' + RemoveAllLineItemsRspDS.ResponseText + NewLine); WriteToJobLog( 'Result: ' + RemoveAllLineItemsRspDS.Result + NewLine ); WriteToJobLog( 'Result Code: ' + RemoveAllLineItemsRspDS.ResultCode + NewLine ); WriteToJobLog( 'Termination Status: ' + RemoveAllLineItemsRspDS.TerminationStatus + NewLine ); endif; *INLR = *On; return;