ColdFusion 8 & CFXPayflowPro

Well unfortunately I have a bit of work ahead of me because the custom tag I'm using for PayPal payments doesn't work in ColdFusion 8. I have probably spent nearly 40 hours on attempting to get it to work but no luck. But alas there is hope! Dan Vega created a new way to call the processor through the JavaLoader created by Mark Mandel from Compound Theory. It's pretty slick but I plan on packaging it a little nicer and cleaner so I can more readily reuse it across about 20 sites. Nice work Dan and Mark!

Here is a sneak peak at the code. You can download your copy at cfpayflowpro.riaforge.org.

<!--- PayFlow Pro Paramaters --->
<cfset pp = structNew()>
<cfset pp.user = "user">
<cfset pp.vendor = "">
<cfset pp.partner = "VeriSign">
<cfset pp.pwd = "password">
<cfset pp.trxtype = "S">
<cfset pp.tender = "C">
<cfset pp.acct = "4111111111111111">
<cfset pp.expdate = "0108">
<cfset pp.accttype = "Visa">
<cfset pp.amt = "1.00">
<cfset pp.currency = "USD">
<cfset pp.cvv2 = "111">
<cfset pp.street = "210 Main St.">
<cfset pp.city = "O Fallon">
<cfset pp.state = "MO">
<cfset pp.country = "US">
<cfset pp.zip = "63368">
<cfset pp.firstname = "Dave">
<cfset pp.lastname = "Cordes">
<cfset pp.clientip = CGI.REMOTE_ADDR>   
<cfset pp.comment1 = "comm1,java test">
<cfset pp.comment2 = "comm2,java test">
<cfset pp.custref = "">
<cfset pp.invnum = "123456">
   
<!--- pass a reference to our payflow component --->
<cfset payflowpro = createObject("component","com.paypal.PayflowPro").init(server.pfpro)>

<!--- set the certificate path --->
<cfset payflowpro.setCertPath("E:\WEBROOT\payflowpro\certs")>
   
<!--- setup the context --->
<cfset payflowpro.createContext("test-payflow.verisign.com",443,30)>
   
<!--- pass the transaction parameters --->
<cfset payflowpro.setParamList(pp)>
   
<!--- submit the transaction, the response from the gateway is a delimited string --->
<cfset response = payflowpro.submitTransaction()>
   
<!--- destroy the context --->
<cfset payflowpro.destroyContext()>

<!--- parse the response --->
<cfset rh = createObject("component","com.paypal.ResponseHandler").init(response)>
   
<cfset answer = rh.responseToStruct()>

<cfdump var="#response#"><br /><br />
<cfdump var="#answer#">

Related Blog Entries

Comments
# Posted By sdfsd | 6/21/08 7:32 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.