VFN_Status()
This subprocedure is used to query the device status using Verifone’s Status Query 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_STATUS
// Description:
// This is a test program to illustrate how to call the VFN_Status()
// subprocedure. This retrieves the status of the payment device.
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 StatusReqDS LikeDS(VFN_StatusReqDS_t) Inz(*LikeDS);
// This will store parsed response data from the API call
Dcl-Ds StatusRspDS LikeDS(VFN_StatusRspDS_t) Inz(*LikeDS);
reset ErrorDS;
reset StatusReqDS;
reset StatusRspDS;
// This must be a device that has already been successfully registered
// with VFN_Register() and which exists in VFNDVC.
StatusReqDS.DeviceID = 'test';
// if VFN_Status() 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_Status( StatusReqDS : StatusRspDS : ErrorDS );
// handle error
WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine );
WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine );
*INLR = *On;
return;
else;
// Now you can check the response data structure for any status info
// or data returned from the device:
WriteToJobLog( 'Response Text: '
+ StatusRspDS.ResponseText + NewLine );
WriteToJobLog( 'Result: ' + StatusRspDS.Result + NewLine );
WriteToJobLog( 'Response Code: '
+ StatusRspDS.ResultCode + NewLine );
WriteToJobLog( 'Termination Status: '
+ StatusRspDS.TerminationStatus + NewLine );
WriteToJobLog( 'Secondary Data: '
+ StatusRspDS.SecondaryData + NewLine );
WriteToJobLog( 'MAC Label in Session: '
+ StatusRspDS.MACLabelInSession + NewLine );
WriteToJobLog( 'Session Duration: '
+ StatusRspDS.SessionDuration + NewLine );
WriteToJobLog( 'Invoice Session: '
+ StatusRspDS.InvoiceSession + NewLine );
WriteToJobLog( 'Device Name: ' + StatusRspDS.DeviceName + NewLine );
WriteToJobLog( 'Serial Number: ' + StatusRspDS.SerialNumber
+ NewLine );
WriteToJobLog( 'Counter: ' + %Char(StatusRspDS.Counter) + NewLine );
endif;
*INLR = *On;
return;
Data Structures
|
|
|
Required The ID of the payment device, registered in VFNDVC, of which the status is being queried. |
|
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: |
|
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 SECONDARY_DATA in your device's Verifone documentation. |
|
This field corresponds to the field MACLABEL_IN_SESSION in your device's Verifone documentation. |
|
This field corresponds to the field SESSION_DURATION in your device's Verifone documentation. |
|
This field corresponds to the field INVOICE_SESSION in your device's Verifone documentation. |
|
This field corresponds to the field DEVICENAME in your device's Verifone documentation. |
|
This field corresponds to the field SERIALNUMBER in your device's Verifone documentation. |
|
This field corresponds to the field COUNTER in your device's Verifone documentation. |