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
|
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_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
|
|
|
Required The ID of the payment device, registered in VFNDVC, on which line items are being displayed. |
|
Specifies the file name or path of the request log file. Will have no effect if logging is not enabled. Example: |
|
Specifies the file name or path of the response log file. Will have no effect if logging is not enabled. Example: |
|
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. |
|
|
|
Required Default Value: |
|
Required Default Value: |
|
Override the default value set in VFN_Register() or REGVFNDVC. Default Value: |
|
Override the default value set in VFN_Register() or REGVFNDVC. Default Value: |
|
Override the default value set in VFN_Register() or REGVFNDVC. Default Value: |
|
|
|
This field corresponds to the field RESPONSE_TEXT in your device's Verifone documentation. |
|
This field corresponds to the field RESULT in your device's Verifone documentation. |
|
This field corresponds to the field RESULT_CODE in your device's Verifone documentation. |
|
This field corresponds to the field TERMINATION_STATUS in your device's Verifone documentation. |
|
This field corresponds to the field COUNTER in your device's Verifone documentation. |