Payflow Pro API

I am attempting to integrate the Payflow Pro API into a Lotus Domino database so I can conduct real-time Credit Card transactions with our Verisign Payflow Pro account.

I began by attempting to integrate the Java API but was told today by Verisign that Lotus’ 1.3.1 JVM is out-dated (the API requires 1.4).

I moved on to the pfpro.dll integration but am having issues with it as well. Basically, the .dll returns garble when it should be returning a string indicating the success/failure of the submission.

My question – has anyone successfully integrated the Payflow Pro API with Lotus Domino and would you be willing to share some insight on how it was accomplished.

TIA,

Scott

Subject: Payflow Pro API

Hi Scott,

I have successfully implemented the Payflow Pro with a domino application. I used the COM Objects (basically the .dll). It is working fine. No problems.

Subject: RE: Payflow Pro API

Which API did you use? I know SPJ mentioned using ASP – is that what you used?

TIA,

Scott

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

Subject: RE: Payflow Pro API

Scott:

I, too, have implemented this using ASP. Your return variable (as noted above) for the function in question is an integer. Your documentation should have what each integer means in relation to whatever the returned string is.

SPJ

Subject: RE: Payflow Pro API

SPJ, I just re-read your post. So you did this all in ASP – have you had any luck running this in Domino? We don’t run ASP here in our environment.

TIA,

Scott

Subject: RE: Payflow Pro API

SPJ,

Thanks for your help. So there’s no valuable information in the pointer returned? I simply key off the integer returned by the pfproSubmitTransaction call?

i.e.: code = pfproSubmitTransaction(context, strParm, IParmLen, termResp) and then lookup the corresponding value for code in some table?

The reason I ask is that there was an example piece of C++ code in the SDK (pfpro.c) that the function returned a string that could be searched for the “RESULT=” flag. I’m under the impression that there’s useful information placed in that pointer that’s the last parameter passed to the pfproSubmitTransaction() function.

TIA,

s

Subject: RE: Payflow Pro API

Scott:

within your code, a good way to get the value is to use a “Print” statement for the response. You will be able to see what the value of the return string is. Also, yes, it works for both ASP, PHP, Domino, etc. The value you really want is the returned integer value. Your documentation should have what each value means and you can either create a table with those values or use the returned string “termResp” to compare it against the integer value to get the correct “readable” response.

Subject: RE: Payflow Pro API

SPJ,The code returns a general piece of information about it’s level of success or type of failure, the value assigned to the pointer by the pfproSubmitTransaction provides a lot more information that is especially useful when debugging. An example (from the standalone java api) is RESULT=0&PNREF=V53E0A1624C3&RESPMSG=Approved&AUTHCODE=010101&AVSADDR=N&AVSZIP=N&IAVS=N

You can’t get all that information from the single integer return value.

As for the “Print” statement – I’m using the debugger and have used it all (Print, MsgBox, assigning to a variable) – it’s still gibberish because it’s returning me the pointer position – not the value in the pointer. If I declare the pointer as a String, it returns gibberish. If I declare the pointer as a Long, it returns the pointer location, but I can’t get the value from the pointer.

TIA,

Scott

sboyer@csci-va.com