This is some old code i had sitting around to use the old ICVerify file interface. No warranties this will work. Has not been used in eons.
Function DoRequest_C1 String sClerk String sComment String sAccount Integer iExpMonth Integer iExpYear Number nAmt String sZip String sAddress Returns Integer
Local String sReqFileName sAnsFileName sCancelFileName sStationNum sAnswer sAnscode sAuth sRef
Local Integer bExists StatPnl lcount
Local String sExpDate
Move (Right("00"+Trim(String(iExpYear)),2)) TO sExpDate
Append sExpDate (Right("00"+Trim(String(iExpMonth)),2))
Set psAuthorizationCode TO ""
Set psReferenceNumber TO ""
Set psDeclineMessage TO ""
Move (Right("000"+Trim(string(piStationNumber(Self))),3)) TO sStationNum
Move (psICVerifyPath(Self)+"ICVER"+sStationNum+".REQ") TO sReqFileName
Move (psICVerifyPath(Self)+"ICVER"+sStationNum+".ANS") TO sAnsFileName
Get szFileExists sReqFileName TO bExists
if bExists Begin
Send Info_Box "Transaction in progress"
Function_Return ICVERRESULT_TRANSACTION_IN_PROGRESS
End
Direct_Output sReqFileName
Write '"C1",'
Write '"' sClerk '",'
Write '"' sComment '",'
Write '"' sAccount '",'
Write '"' sExpDate '",'
Write '"' nAmt '"'
if (pbDoAddressVerification(Self)) Begin
if (Trim(sZip)) NE "" begin
Write ','
Write '"' sZip '",'
Write '"' sAddress '"'
End
End
Writeln ""
Close_Output
Move (False) TO bExists
Move (Status_Panel(Current_Object)) to StatPnl
Send Initialize_StatusPanel to StatPnl "Processing Transaction" "Processing Transaction" "Please Wait..."
Send Start_StatusPanel to StatPnl
Repeat
Get szFileExists sAnsFileName TO bExists
For lcount From 1 to 5000
Loop
Until (bExists)
Send Stop_StatusPanel to StatPnl
Direct_Input sAnsFileName
Read sAnswer
Close_Input
Move (Left(sAnswer,1)) TO sAnsCode
case begin
Case (sAnscode = "Y")
Move (Mid(sAnswer,6,2)) TO sAuth
Move (Mid(sAnswer,8,8)) TO sRef
Set psAuthorizationCode TO sAuth
Set psReferenceNumber TO sRef
Function_Return ICVERRESULT_OK
case break
case (sAnsCode = "N")
Set psDeclineMessage TO (Right(sAnswer,Length(sAnsCode)-1))
Function_Return ICVERRESULT_DECLINED
case break
Case End
End_Function