VFN_RemoveLineItem()

This subprocedure can be used to remove one or more line items from the device display using Verifone’s Remove Line Items service.

Subprocedure Prototype

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

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

D  pRequestDS                         LikeDS(VFN_RemoveLineItemReqDS_t)
D                                     Const
 
D  pResponseDS                        LikeDS(VFN_RemoveLineItemRspDS_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_RMVLNITM // Description: // This is a test program to illustrate how to use the // VFN_RemoveLineItem() subprocedure to remove a single existing // LineItem. // // Please refer to T_RMLNITMS to see the process for removing multiple // line items in a single 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 RemoveLineItemReqDS LikeDS(VFN_RemoveLineItemReqDS_t) Inz(*LikeDS); Dcl-Ds RemoveLineItemRspDS LikeDS(VFN_RemoveLineItemRspDS_t) Inz(*LikeDS); reset ErrorDS; reset RemoveLineItemReqDS; reset RemoveLineItemRspDS; // This must be a device that has been successfully registered with // VFN_Register() and which exists in VFNDVC. RemoveLineItemReqDS.DeviceID = 'test'; // These fields can be assigned a log file path, and will save the // request and response xml data. RemoveLineItemReqDS.RequestLog = 'T_RMVLNITM_Request.xml'; RemoveLineItemReqDS.ResponseLog = 'T_RMVLNITM_Response.xml'; // These fields are required for all line item transactions. RemoveLineItemReqDS.RunningTaxAmount = 1.42; RemoveLineItemReqDS.RunningTransAmount = 17.42; // VFN_RemoveLineItemReqDS_t is configured to allow removal of up to // 10 line items in a single transaction. The target LineItemIds must // be stored in the dimensional array, even if only a single line // item is being removed. RemoveLineItemReqDS.LineItemId(1) = '1'; // if VFN_RemoveLineItem() 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_RemoveLineItem( RemoveLineItemReqDS : RemoveLineItemRspDS : ErrorDS ); // handle error WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine ); WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine ); *INLR = *On; return; else; WriteToJobLog( 'Response Text: ' + RemoveLineItemRspDS.ResponseText + NewLine); WriteToJobLog( 'Result: ' + RemoveLineItemRspDS.Result + NewLine ); WriteToJobLog( 'Result Code: ' + RemoveLineItemRspDS.ResultCode + NewLine ); WriteToJobLog( 'Termination Status: ' + RemoveLineItemRspDS.TerminationStatus + NewLine ); endif; *INLR = *On; return;

// Example Program: T_RMLNITMS // Description: // This is a test program to illustrate how to use the VFN_RemoveLineItem() // subprocedure to remove a multiple existing LineItems. // // Please refer to T_RMVLNITM to see the process for removing a single // line item in a 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 RemoveLineItemReqDS LikeDS(VFN_RemoveLineItemReqDS_t) Inz(*LikeDS); Dcl-Ds RemoveLineItemRspDS LikeDS(VFN_RemoveLineItemRspDS_t) Inz(*LikeDS); reset ErrorDS; reset RemoveLineItemReqDS; reset RemoveLineItemRspDS; // This must be a device that has been successfully registered with // VFN_Register() and which exists in VFNDVC. RemoveLineItemReqDS.DeviceID = 'test'; // These fields can be assigned a log file path, and will save the // request and response xml data. RemoveLineItemReqDS.RequestLog = 'T_RMLNITMS_Request.xml'; RemoveLineItemReqDS.ResponseLog = 'T_RMLNITMS_Response.xml'; // These fields are required for all line item transactions. RemoveLineItemReqDS.RunningTaxAmount = 5.42; RemoveLineItemReqDS.RunningTransAmount = 32.42; // VFN_RemoveLineItemReqDS_t is configured to allow removal of up to // 10 line items in a single transaction. RemoveLineItemReqDS.LineItemId(1) = '2'; RemoveLineItemReqDS.LineItemId(2) = '3'; RemoveLineItemReqDS.LineItemId(3) = '4'; RemoveLineItemReqDS.LineItemId(4) = '5'; // if VFN_RemoveLineItem() 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_RemoveLineItem( RemoveLineItemReqDS : RemoveLineItemRspDS : ErrorDS ); // handle error WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine ); WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine ); *INLR = *On; return; else; WriteToJobLog( 'Response Text: ' + RemoveLineItemRspDS.ResponseText + NewLine); WriteToJobLog( 'Result: ' + RemoveLineItemRspDS.Result + NewLine ); WriteToJobLog( 'Result Code: ' + RemoveLineItemRspDS.ResultCode + NewLine ); WriteToJobLog( 'Termination Status: ' + RemoveLineItemRspDS.TerminationStatus + NewLine ); endif; *INLR = *On; return;

Data Structures

D VFN_RemoveLineItemReqDS_t...
D                 DS                  Qualified Template Inz
 
D  DeviceID                           Like(VFN_DeviceId_t)

Required

The ID of the payment device, registered in VFNDVC, on which line items are being displayed.

D  RequestLog                         Like(VFN_Var1Kv_t)

Specifies the file name or path of the request log file. Will have no effect if logging is not enabled.

Example: "req_log.txt","/tmp/logs/request.txt"

D  ResponseLog                        Like(VFN_Var1Kv_t)

Specifies the file name or path of the response log file. Will have no effect if logging is not enabled.

Example: "rsp_log.txt","/tmp/logs/response.txt"

D  LineItemID                   10A   Varying Dim(10)

The ID of the line item(s) to be removed.

Some device firmware versions are only able to remove a single line item per request.

D  RunningSubTotal...
D                                8P 2
 
D  RunningTaxAmount...
D                                8P 2

Required

Default Value: 0.00

D  RunningTransAmount...
D                                8P 2

Required

Default Value: 0.00

D  ConnectTimeout...
D                                3P 0 Inz(-1)

Override the default value set in VFN_Register() or REGVFNDVC.

Default Value: -1

D  WriteTimeout...
D                                3P 0 Inz(-1)

Override the default value set in VFN_Register() or REGVFNDVC.

Default Value: -1

D  ReadTimeout...
D                                3P 0 Inz(-1)

Override the default value set in VFN_Register() or REGVFNDVC.

Default Value: -1

D VFN_RemoveLineItemRspDS_t...
D                 DS                  Qualified Template Inz
 
D  ResponseText                       Like(VFN_Var1Kv_t)

This field corresponds to the field RESPONSE_TEXT in your device's Verifone documentation.

D  Result                             Like(VFN_Var1Kv_t)

This field corresponds to the field RESULT in your device's Verifone documentation.

D  ResultCode                   10A   Varying

This field corresponds to the field RESULT_CODE in your device's Verifone documentation.

D  TerminationStatus...
D                                     Like(VFN_Var1Kv_t)

This field corresponds to the field TERMINATION_STATUS in your device's Verifone documentation.

D  Counter                      10P 0

This field corresponds to the field COUNTER in your device's Verifone documentation.