Subject: RE: Payflow Pro API
Dimitris, Would you mind sharing the script you used to invoke the .dll? I’m at loggerheads with the pfproSubmitTransaction() call – it assigns junk to the transactionResponse variable.
My declaration is:
Declare Function pfproSubmitTransaction Lib “pfpro.dll” (context As Long, Byval strParm As String, Byval IParmLen As Integer, Byval strResp As String) As Integer
Dim strResp As String*256
My call is:
Call pfproSubmitTransaction(context, strParm, IParmLen, Byval strResp)
When run, strResp is assigned various garble. I’ve tried using the Long pointer instead, but then am at a loss on how to retrieve the String stored at this pointer.
We’re attempting to implement this for a non-profit (https://www.sempercomm.org) to receive donations in support of service members stationed at remote locations overseas. Any details you’d be willing to share would really help us help them.
Thanks!
Scott
sboyer@csci-va.com
/////The Full Code/////
—(Declarations)----
Declare Function pfproInit Lib “pfpro.dll” () As Integer
Declare Sub pfproCleanup Lib “pfpro.dll” ()
Declare Function pfproCreateContext Lib “pfpro.dll” (context As Long, Byval host_addr As String, Byval host_port As Long, Byval time_out As Long, Byval proxy_addr As String, Byval proxy_port As Long, Byval proxy_logon As String, Byval proxy_pass As String) As Integer
Declare Function pfproDestroyContext Lib “pfpro.dll” (context As Long) As Integer
Declare Function pfproSubmitTransaction Lib “pfpro.dll” (context As Long, Byval strParm As String, Byval IParmLen As Integer, Byval strResp As String) As Integer
Declare Sub pfproCompleteTransaction Lib “pfpro.dll” (Byval strResp As String)
Declare Function pfproVersion Lib “pfpro.dll” () As String
Dim Context As Long
Dim hostAddress As String
Dim portNum As Long
Dim timeout As Long
Dim strResp As String*256
------Initialize-----
Sub Initialize
hostAddress = "test-payflow.verisign.com"
portNum = 443
timeout = 30
strParm = "TRXTYPE=S&TENDER=C&USER=user&VENDOR=user&PARTNER=partner&PWD=password&ACCT=5555555555554444&ExpDate=1209&AMT=24.21"
If(pfproInit()) Then
Print "PFProDLL -- Failed to properly initialize PFPro"
Exit Sub
End If
If(pfproCreateContext(context, hostAddress, portNum, timeout, proxyAddress, proxyPort, proxyLogon, proxyPassword)) Then
Print "PFProDLL -- Failed to propery create Context"
Exit Sub
End If
IParmLen = Len(strParm)
Call pfproSubmitTransaction(context, strParm, IParmLen, strResp)
Call pfproCompleteTransaction(strResp)
Call pfproDestroyContext(context)
Call pfproCleanup()
Msgbox "done"
End Sub