VFN_OverrideLineItem()
This subprocedure can be used to override a MERCHANDISE line item by calling Verifone’s Override Line Item 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_OVRLNITM
// Description:
// This is a test program to illustrate how to use the
// VFN_OverrideLineItem() subprocedure to change the values for an
// existing MERCHANDISE line item.
//
// 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 OverrideLineItemReqDS LikeDS(VFN_OverrideLineItemReqDS_t)
Inz(*LikeDS);
// This will store parsed response data from the API call
Dcl-Ds OverrideLineItemRspDS LikeDS(VFN_OverrideLineItemRspDS_t)
Inz(*LikeDS);
reset ErrorDS;
reset OverrideLineItemReqDS;
reset OverrideLineItemRspDS;
// This must be a device that has been successfully registered with
// VFN_Register() and which exists in VFNDVC.
OverrideLineItemReqDS.DeviceID = 'test';
// These fields can be assigned a log file path, and will save the
// request and response xml data.
OverrideLineItemReqDS.RequestLog = 'T_OVRLNITM_Request.xml';
OverrideLineItemReqDS.ResponseLog = 'T_OVRLNITM_Response.xml';
// These fields are required for all line item transactions.
OverrideLineItemReqDS.RunningTaxAmount = 0.42;
OverrideLineItemReqDS.RunningTransAmount = 27.42;
// This is the ID of the LineItem to be overriden. This must be a line
// item that has already been transmitted to the payment device. This
// cannot be an OFFER line item.
OverrideLineItemReqDS.LineItemId = '1';
OverrideLineItemReqDS.Description = 'New Description';
OverrideLineItemReqDS.Quantity = 1;
OverrideLineItemReqDS.UnitPrice = 10;
OverrideLineItemReqDS.ExtendedPrice = 10;
// If VFN_OverrideLineItem() 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_OverrideLineItem( OverrideLineItemReqDS
: OverrideLineItemRspDS : ErrorDS );
// handle error
WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine );
WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine );
*INLR = *On;
return;
else;
WriteToJobLog( 'Response Text: ' + OverrideLineItemRspDS.ResponseText
+ NewLine);
WriteToJobLog( 'Result: ' + OverrideLineItemRspDS.Result + NewLine );
WriteToJobLog( 'Result Code: ' + OverrideLineItemRspDS.ResultCode
+ NewLine );
WriteToJobLog( 'Termination Status: '
+ OverrideLineItemRspDS.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: |
|
|
|
Required Default Value: |
|
Required Default Value: |
|
Required The ID of the previously-added line item to be overridden. |
|
|
|
|
|
|
|
|
|
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. |