VFN_Capture()

This subprocedure calls Verifone’s Capture service.

Subprocedure Prototype

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

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

D  pRequestDS                         LikeDS(VFN_CaptureReqDS_t) Const
 
D  pResponseDS                        LikeDS(VFN_CaptureRspDS_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_CAP // Description: // This is a test program to illustrate how to call the VFN_Capture() // subprocedure to collect payment authorization for settlement. // // This program assumes you have already called VFN_StartSession(), // and 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 CaptureReqDS LikeDS(VFN_CaptureReqDS_t) Inz(*LikeDS); // This will store parsed response data from the API call Dcl-Ds CaptureRspDS LikeDS(VFN_CaptureRspDS_t) Inz(*LikeDS); reset ErrorDS; reset CaptureReqDS; reset CaptureRspDS; // This must be a device that has already been successfully registered // with VFN_Register() and which exists in VFNDVC. CaptureReqDS.DeviceID = 'test'; // These fields can be assigned a log file name, and will write the // request and response xml data to the logging directory. CaptureReqDS.RequestLog = 'T_CAP_Request.xml'; CaptureReqDS.ResponseLog = 'T_CAP_Response.xml'; // These fields were chosen to simulate a card-swipe transaction. // Specifying the Payment Type is optional here. CaptureReqDS.TransAmount = 47.72; //CaptureReqDS.PaymentType = 'CREDIT'; CaptureReqDS.TaxInd = '0'; // if VFN_Capture() 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_Capture( CaptureReqDS : CaptureRspDS : ErrorDS ); // handle error WriteToJobLog( 'Message ID: ' + ErrorDS.MessageId + NewLine ); WriteToJobLog( 'Message: ' + ErrorDS.Message + NewLine ); *INLR = *On; return; else; // These are a selection of fields that would likely be returned // from a successful swiped credit card transaction. WriteToJobLog( 'Response Text: ' + CaptureRspDS.ResponseText + NewLine ); WriteToJobLog( 'Result: ' + CaptureRspDS.Result + NewLine ); WriteToJobLog( 'Result Code: ' + CaptureRspDS.ResultCode + NewLine ); WriteToJobLog( 'Termination Status: ' + CaptureRspDS.TerminationStatus + NewLine ); WriteToJobLog( 'Counter: ' + %Char(CaptureRspDS.Counter) + NewLine ); WriteToJobLog( 'Payment Type: ' + CaptureRspDS.PaymentType + NewLine ); WriteToJobLog( 'Payment Media: ' + CaptureRspDS.PaymentMedia + NewLine ); WriteToJobLog( 'Approved Amount: ' + CaptureRspDS.ApprovedAmount + NewLine ); WriteToJobLog( 'Original Transaction Amount: ' + CaptureRspDS.OrigTransAmount + NewLine ); WriteToJobLog( 'Card Entry Mode: ' + CaptureRspDS.CardEntryMode + NewLine ); WriteToJobLog( 'Cardholder: ' + CaptureRspDS.Cardholder + NewLine ); // Please see QRPGLECPY,VFNCB for the other fields // in VFN_CaptureReqDS_t and VFN_CaptureRspDS_t endif; *INLR = *On; return;

Data Structures

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

Required

The ID of the payment device, registered in VFNDVC, that is processing the transaction.

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  TransAmount                   8P 2

Required

For VX Devices, this value is limited to a 7P 2 field.

D  TipAmount                     8P 2
 
D  EbtCashEligible...
D                                8P 2
 
D  EbtSnapEligible...
D                                8P 2
 
D  PaymentType                        Like(VFN_Var1Kv_t)
 
D  PaymentSubtype...
D                                     Like(VFN_Var1Kv_t)
 
D  EbtType                            Like(VFN_Var1Kv_t)
 
D  AuthCode                     16A   Varying
 
D  ManualEntry                    N
 
D  CustomerStreet...
D                               20A   Varying
 
D  CustomerZip                   9A   Varying
 
D  ManualPromptOptions...
D                               50A   Varying
 
D  PaymentTypes                       Like(VFN_Var1Kv_t)

MX Solutions Devices only

D  POS_Tender1                   8A
 
D  Tender1Action                      Like(VFN_Var1Kv_t)
 
D  POS_Tender2                   8A
 
D  Tender2Action                      Like(VFN_Var1Kv_t)
 
D  POS_Tender3                   8A
 
D  Tender3Action                      Like(VFN_Var1Kv_t)
 
D  RefTroutd                    10A   Varying
 
D  CTroutd                      10A   Varying
 
D  BillPay                        N
 
D  ForceFlag                      N
 
D  TaxAmount                     8P 2
 
D  TaxInd                        1A
 
D  CmrclFlag                     1A
 
D  DiscountAmount...
D                                8P 2
 
D  FreightAmount...
D                                8P 2
 
D  DutyAmount                    8P 2
 
D  ShipFromZipCode...
D                                9A   Varying
 
D  RetailItemDesc1...
D                               40A   Varying
 
D  DestPostalCode...
D                                9A   Varying
 
D  AltTaxID                     15A   Varying
 
D  DestCountryCode...
D                                3A   Varying
 
D  CustomerCode                 25A   Varying
 
D  AcctNum                      40A   Varying
 
D  Encrypt                        N
 
D  BarCode                     100A   Varying
 
D  PinCode                      10A   Varying
 
D  CVV2                         10A   Varying
 
D  CreditPlanNbr                 5A   Varying

MX Solutions Devices only

D  PurchaseAPR                  12A   Varying

MX Solutions Devices only

D  PromoCode                    10A   Varying

MX Solutions Devices only

D  OrderDateTime                  Z   Inz(*LOVAL)

MX Solutions Devices only

This timestamp field will be formatted internally in order to match Verifone's requirements.

D  Reference                    40A   Varying

MX Solutions Devices only

D  AmountHealthcare...
D                                8P 2
 
D  AmountPrescription...
D                                8P 2
 
D  AmountVision...
D                                8P 2
 
D  AmountClinic...
D                                8P 2
 
D  AmountDental...
D                                8P 2
 
D  Micr                        128A   Varying
 
D  AbaNum                       10A
 
D  CheckNum                     10A
 
D  CheckType                     1A
 
D  DLState                       2A
 
D  DLNumber                     12A   Varying
 
D  CustomerDOB                   8A
 
D  CardToken                    40A   Varying
 
D  CardExpMonth                  2A
 
D  CardExpYear                   2A
 
D  BankUserData                       Like(VFN_Var1Kv_t)
 
D  AllowDupTran                  6A   Varying

MX Solutions Devices only

D  MerchantIndex                10A   Varying

MX Solutions Devices only

D  CustData                     20A   Varying

MX Solutions Devices only

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_CaptureRspDS_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.

D  TransSeqNum                        Like(VFN_Var1Kv_t)
 
D  IntrnSeqNum                        Like(VFN_Var1Kv_t)
 
D  Troutd                             Like(VFN_Var1Kv_t)
 
D  CTroutd                            Like(VFN_Var1Kv_t)
 
D  LPToken                            Like(VFN_Var1Kv_t)
 
D  PaymentType                        Like(VFN_Var1Kv_t)
 
D  PaymentMedia                       Like(VFN_Var1Kv_t)
 
D  PPCV                               Like(VFN_Var1Kv_t)
 
D  EbtType                            Like(VFN_Var1Kv_t)
 
D  AcctNum                            Like(VFN_Var1Kv_t)
 
D  AuthCode                           Like(VFN_Var1Kv_t)
 
D  AvailableBalance...
D                                     Like(VFN_Var1Kv_t)
 
D  ApprovedAmount...
D                                     Like(VFN_Var1Kv_t)
 
D  OrigTransAmount...
D                                     Like(VFN_Var1Kv_t)
 
D  DiffAmountDue...
D                                     Like(VFN_Var1Kv_t)
 
D  FSAAmount                          Like(VFN_Var1Kv_t)
 
D  CashbackAmnt                       Like(VFN_Var1Kv_t)
 
D  TipAmount                          Like(VFN_Var1Kv_t)
 
D  FSAvailBalance...
D                                     Like(VFN_Var1Kv_t)
 
D  CBAvailBalance...
D                                     Like(VFN_Var1Kv_t)
 
D  CardEntryMode                      Like(VFN_Var1Kv_t)
 
D  Cardholder                         Like(VFN_Var1Kv_t)
 
D  CardExpMonth                  2A
 
D  CardExpYear                   2A
 
D  AVSCode                            Like(VFN_Var1Kv_t)
 
D  Cvv2Code                           Like(VFN_Var1Kv_t)
 
D  MerchDecl                          Like(VFN_Var1Kv_t)
 
D  MerchRef                           Like(VFN_Var1Kv_t)
 
D  CustomerZip                        Like(VFN_Var1Kv_t)
 
D  Preswiped                          Like(VFN_Var1Kv_t)
 
D  AuthRespCode                       Like(VFN_Var1Kv_t)
 
D  BankUserdata                       Like(VFN_Var1Kv_t)
 
D  EmbossedAcctNum...
D                                     Like(VFN_Var1Kv_t)
 
D  SAFNum                             Like(VFN_Var1Kv_t)
 
D  MerchID                            Like(VFN_Var1Kv_t)
 
D  TermID                             Like(VFN_Var1Kv_t)
 
D  ReceiptData                        Like(VFN_Var1Kv_t)
 
D  TransDate                          Like(VFN_Var1Kv_t)
 
D  TransTime                          Like(VFN_Var1Kv_t)
 
D  BatchTraceID                       Like(VFN_Var1Kv_t)
 
D  TrainingMode                       Like(VFN_Var1Kv_t)
 
D  VspCode                            Like(VFN_Var1Kv_t)
 
D  VspResultDesc...
D                                     Like(VFN_Var1Kv_t)
 
D  VspTrxID                           Like(VFN_Var1Kv_t)
 
D  DenialRecNum                       Like(VFN_Var1Kv_t)
 
D  ReturnCheckFee...
D                                     Like(VFN_Var1Kv_t)
 
D  ReturnCheckNote...
D                                     Like(VFN_Var1Kv_t)
 
D  LtyAcctNum                         Like(VFN_Var1Kv_t)
 
D  LtyPhone                           Like(VFN_Var1Kv_t)
 
D  LtyEmail                           Like(VFN_Var1Kv_t)
 
D  LtyTokenID                         Like(VFN_Var1Kv_t)
 
D  RewardReceiptText...
D                                     Like(VFN_Var1Kv_t)
 
D  RewardID                           Like(VFN_Var1Kv_t)
 
D  RewardAmount                       Like(VFN_Var1Kv_t)
 
D  LoyaltyVAS                         Like(VFN_Var1Kv_t)
 
D  Publisher                          Like(VFN_Var1Kv_t)
 
D  LoyaltyPayload...
D                                     Like(VFN_Var1Kv_t)
 
D  SignatureData...
D                                     Like(VFN_Var1Kv_t)
 
D  MimeType                           Like(VFN_Var1Kv_t)
 
D  DuplicateTransaction...
D                                     Like(VFN_Var1Kv_t)
 
D  POS_Tender1Data...
D                                     Like(VFN_Var1Kv_t)
 
D  POS_Tender2Data...
D                                     Like(VFN_Var1Kv_t)
 
D  POS_Tender3Data...
D                                     Like(VFN_Var1Kv_t)
 
D  CardToken                          Like(VFN_Var1Kv_t)
 
D  DupAcctNum...
D                                     Like(VFN_Var1Kv_t)
 
D  DupAuthCode...
D                                     Like(VFN_Var1Kv_t)
 
D  DupAVSCode                         Like(VFN_Var1Kv_t)
 
D  DupCTroutd...
D                                     Like(VFN_Var1Kv_t)
 
D  DupCvv2Code                        Like(VFN_Var1Kv_t)
 
D  DupInvoice...
D                                     Like(VFN_Var1Kv_t)
 
D  DupPaymentMedia...
D                                     Like(VFN_Var1Kv_t)
 
D  DupTransAmount...
D                                     Like(VFN_Var1Kv_t)
 
D  DupTransDate...
D                                     Like(VFN_Var1Kv_t)
 
D  DupTransTime...
D                                     Like(VFN_Var1Kv_t)
 
D  DupTroutd...
D                                     Like(VFN_Var1Kv_t)
 
D  HostRespCode                       Like(VFN_Var1Kv_t)
 
D  Lane                               Like(VFN_Var1Kv_t)
 
D  TxnPosEntryMode...
D                                     Like(VFN_Var1Kv_t)