VFN_GetEmail()
This subprocedure can be used to retrieve a customer-entered email using Verifone’s Get Email 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. |
|
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: |
Example Code
// Example Program: T_EMAIL
// Description:
// This is a test program to illustrate how to call the VFN_GetEmail()
// subprocedure.
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 EmailReqDS LikeDS(VFN_GetEmailReqDS_t) Inz(*LikeDS);
// This will store parsed response data from the API call
Dcl-Ds EmailRspDS LikeDS(VFN_GetEmailRspDS_t) Inz(*LikeDS);
reset ErrorDS;
reset EmailReqDS;
reset EmailRspDS;
// This must correspond to a device that has already been registered
// and is in VFNDVC.
EmailReqDS.DeviceID = 'test';
// This is an optional parameter to pre-populate the email address.
// Here we assign an empty string, but we could also assign an email
// address that would appear on the capture email display.
EmailReqDS.EmailData = '';
// These are the file names for the request and response log files.
EmailReqDS.RequestLog = 'T_EMAIL_Request.xml';
EmailReqDS.ResponseLog = 'T_EMAIL_Response.xml';
if not VFN_GetEmail( EmailReqDS : EmailRspDS : ErrorDS );
// Handle error
WriteToJobLog( 'Message ID: ' + ErrorDS.MessageID + NewLine );
WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine );
*INLR = *ON;
return;
else;
WriteToJobLog( 'EMAIL CAPTURE RESPONSE' + NewLine );
WriteToJobLog( 'Response Text: ' + EmailRspDS.ResponseText
+ NewLine );
WriteToJobLog( 'Result: ' + EmailRspDS.Result + NewLine );
WriteToJobLog( 'Result Code: ' + EmailRspDS.ResultCode + NewLine );
WriteToJobLog( 'Termination Status: ' + EmailRspDS.TerminationStatus
+ NewLine );
WriteToJobLog( 'Counter: ' + %Char(EmailRspDS.Counter)
+ NewLine );
WriteToJobLog( 'Email Data: ' + EmailRspDS.EmailData + NewLine );
endif;
*INLR = *On;
return;
// Example Program: T_EMAILPPT
// Description:
// This is a test program to illustrate how to call the VFN_GetEmail()
// subprocedure with a pre-populated email address.
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 EmailReqDS LikeDS(VFN_GetEmailReqDS_t) Inz(*LikeDS);
// This will store parsed response data from the API call
Dcl-Ds EmailRspDS LikeDS(VFN_GetEmailRspDS_t) Inz(*LikeDS);
reset ErrorDS;
reset EmailReqDS;
reset EmailRspDS;
// This must correspond to a device that has already been registered
// and is in VFNDVC.
EmailReqDS.DeviceID = 'test';
// Populating this field will fill in the email field on the display.
EmailReqDS.EmailData = 'test@example.com';
// These are the file names for the request and response log files.
EmailReqDS.RequestLog = 'T_EMAIL_Request.xml';
EmailReqDS.ResponseLog = 'T_EMAIL_Response.xml';
if not VFN_GetEmail( EmailReqDS : EmailRspDS : ErrorDS );
// Handle error
WriteToJobLog( 'Message ID: ' + ErrorDS.MessageID + NewLine );
WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine );
*INLR = *ON;
return;
else;
WriteToJobLog( 'EMAIL CAPTURE RESPONSE' + NewLine );
WriteToJobLog( 'Response Text: ' + EmailRspDS.ResponseText
+ NewLine );
WriteToJobLog( 'Result: ' + EmailRspDS.Result + NewLine );
WriteToJobLog( 'Result Code: ' + EmailRspDS.ResultCode + NewLine );
WriteToJobLog( 'Termination Status: ' + EmailRspDS.TerminationStatus
+ NewLine );
WriteToJobLog( 'Counter: ' + %Char(EmailRspDS.Counter)
+ NewLine );
WriteToJobLog( 'Email Data: ' + EmailRspDS.EmailData + NewLine );
endif;
*INLR = *On;
return;
Data Structures
|
|
|
Required The ID of the payment device, registered in VFNDVC, on which email is to be captured. |
|
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: |
|
Used to pre-populate the email capture screen. |
|
|
|
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. |
|
This field corresponds to the field EMAILDATA in your device's Verifone documentation. |