Payflow Pro Made Easy
If you have ever had to do credit card processing you most likely have come across this problem in the past. Payflow Pro is a popular gateway that you may have used back in the day and was previously owned by Verisign. Times have changed and now Paypal owns the software but what we are going to discuss should work for both. In the past (at least to my knowledge) you had to install the cfx_payflowpro tag on your ColdFusion server which ended up being a big pain, especially if you did not have rights to the server.
Today I am happy to announce that I have solved that problem. Credit card processing using Paypal's PayflowPro just got a lot easier. The reason for this is mainly due to Mark Mandel's Java Loader which is a library that handles creation of Java objects from external Java libraries. So how does it work? I have created a component using JavaLoader that will load the java class files and basically wraps the Java methods. This is great because now you can process credit cards without installing anything on the server.
The code is not quite ready to be released yet but I thought I would share a little code snippet. Imagine at the end of your checkout process you could provide real time processing with as little code as shown below.
<cfset payflowpro = createObject("component","PayflowPro").init("C:\Program Files\Apache Group\Apache2\htdocs\paypal\Verisign.jar")>
<!--- set the certificate path --->
<cfset payflowpro.setCertPath("C:\Program Files\Apache Group\Apache2\htdocs\paypal\certs")>
<!--- setup the context --->
<cfset payflowpro.createContext("test-payflow.verisign.com",443,30)>
<!--- the param list --->
<cfset payflowpro.setParamList(user,vendor,partner,pwd,trxtype,tender,acct,expdate,accttype,amt,currency,cvv2,street,city,state,country,zip,firstname,lastname,clientip,comment1,comment2,custref,invnum)>
<!--- submit the transaction, returns a string --->
<cfset response = payflowpro.submitTransaction()>
<!--- destroy the context --->
<cfset payflowpro.destroyContext()>
I am really looking for people who are looking to do processing with PayflowPro so I could get others thoughts on the library and how to use it. Any comments or questions are welcome so please feel free to leave them.
