Paypal *Payflow* Gateway support?

119 views
Skip to first unread message

Phil Cruz

unread,
Mar 19, 2012, 4:34:26 PM3/19/12
to cfpa...@googlegroups.com
Can anyone confirm if cfpayment supports the Paypal Payflow Gateway or not? 
( https://www.x.com/developers/paypal/documentation-tools/getting-started-guides/payflow-payment-gateway ) 
I see support for "PayPal Website Payments Pro" but not for the Payflow type of gateway.

Thanks,
Phil

Brian G

unread,
Mar 21, 2012, 12:02:37 AM3/21/12
to cfpa...@googlegroups.com
Phil, 

I think it's support for what today is called Payments Standard.  Paypal is actually about it restructure their payment offerings into three newly named tiers.  We'll need to realign when that happens.  I might be having to support Paypal myself soon in which case I might be working on that.

After I write 1.0 documentation. ;)


Brian

Jason Brookins

unread,
Jun 20, 2012, 12:06:17 PM6/20/12
to cfpa...@googlegroups.com
I recently started work on a Payflow Pro gateway, but I'm having issues locally with the config.path not being recognized (i.e. throwing an error in base.init()).  The folder is /gateway/payflowpro/payflowpro.cfc, but it can't get past the unit test setup for the gateway.

Any suggestions for how to attack this issue?

-jb

Brian G

unread,
Jun 20, 2012, 6:53:44 PM6/20/12
to cfpa...@googlegroups.com
Jason - can you post the exact error and stack trace? 

One thing to note, line 52 in core.cfc instantiates a path with all lower case names:

<cfset variables.instance.gateway = createObject("component", "gateway.#lCase(variables.instance.config.path)#").init(config = variables.instance.config, service = this) />

Brian

Jason Brookins

unread,
Jun 21, 2012, 2:57:57 PM6/21/12
to cfpa...@googlegroups.com
There error is being thrown in core.init() on instantiation of the gateway object.  

The folder structure is:

cfpayment
     api/
          gateway/
               payflowpro/
                    tests/PayFlowProTest.cfc
                    payflowpro.cfc

The test setup has this as the path:   gw.path = "payflowpro.payflowpro".

Here is the stack trace:

coldfusion.runtime.CustomException: Invalid Gateway Specified at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:124) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2661) at cfcore2ecfc420191669$funcINIT.runFunction(/Applications/ColdFusion8/wwwroot/cfpayment/api/core.cfc:54) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) at cfPayFlowProTest2ecfc88247405$funcSETUP.runFunction(/Applications/ColdFusion8/wwwroot/cfpayment/api/gateway/payflowpro/tests/PayFlowProTest.cfc:16) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) at cfTestDecorator2ecfc958006578$funcSETUP.runFunction(/Applications/ColdFusion8/wwwroot/mxunit/framework/TestDecorator.cfc:26) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) at cfTestSuiteRunner2ecfc594676551$funcRUNTESTMETHOD.runFunction(/Applications/ColdFusion8/wwwroot/mxunit/framework/TestSuiteRunner.cfc:97) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2471) at cfTestSuiteRunner2ecfc594676551$funcRUN.runFunction(/Applications/ColdFusion8/wwwroot/mxunit/framework/TestSuiteRunner.cfc:52) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) at cfTestSuite2ecfc730185079$funcRUN.runFunction(/Applications/ColdFusion8/wwwroot/mxunit/framework/TestSuite.cfc:131) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:448) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:308) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2272) at cfRemoteFacade2ecfc2070213983$funcEXECUTETESTCASE.runFunction(/Applications/ColdFusion8/wwwroot/mxunit/framework/RemoteFacade.cfc:76) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:360) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:324) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:59) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:277) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:463) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:453) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:320) at coldfusion.xml.rpc.CFComponentSkeleton.__invoke(CFComponentSkeleton.java:666) at mxunit.framework.RemoteFacade.executeTestCase(/Applications/ColdFusion8/wwwroot/mxunit/framework/RemoteFacade.cfc) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:388) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:283) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at coldfusion.xml.rpc.CFCProvider.invoke(CFCProvider.java:54) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at coldfusion.xml.rpc.CFCServlet.doAxisPost(CFCServlet.java:270) at coldfusion.filter.AxisFilter.invoke(AxisFilter.java:43) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:288) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:138) at coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:289) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)       

It just doesn't seem to be find the right path to the gateway cfc, and I'm a bit stumped.

Thanks for the help.

-jb

Brian G

unread,
Jun 21, 2012, 6:10:34 PM6/21/12
to cfpa...@googlegroups.com
Jason - can you post the code from PayFlowProTest.cfc?  At least the 
first 40 lines or so?

Do you get this same error if you instantiate cfpayment in a test.cfm 
file vs. through a unit test?

And, can you confirm that the cfpayment mapping points to the right 
place per the docs?


Brian

Jason Brookins

unread,
Jun 21, 2012, 7:54:53 PM6/21/12
to cfpa...@googlegroups.com
Here is the first (and most of) part PayFlowProTest.cfc:

<cffunction name="setUp" returntype="void" access="public" output="false">

<cfscript>  

var gw = {};

variables.svc = createObject("component", "cfpayment.api.core");

gw.path = "payflowpro.payflowpro";

gw.Username = 'xxxxxxxx';

gw.Password = 'xxxxxxxx';

gw.Partner = 'xxxxxxxx';

gw.Vendor = 'xxxxxxxx';

gw.TestMode = true; // defaults to true


// create gw and get reference

variables.svc.init(gw);

variables.gw = variables.svc.getGateway();

</cfscript>

</cffunction>


<cffunction name="testPurchase" access="public" returntype="void" output="false">

<cfset var money = variables.svc.createMoney(100) /><!--- in cents, $1.00 --->

<cfset var response = "" />

<cfset var options = {} />

<!---// test the purchase method //--->

<cfset response = gw.purchase(money = money, account = createValidCard(), options = options) />

<cfset assertTrue(response.getSuccess(), "The authorization did not succeed") />

</cffunction>



<!---// Private helper methods //--->

<cffunction name="createValidCard" access="private" returntype="any" output="false">

<!--- these values simulate a valid card with matching avs/cvv --->

<cfset var account = variables.svc.createCreditCard() />

<cfset account.setAccount(4321432143214327) />

<cfset account.setMonth(12) />

<cfset account.setYear(year(now())+1) />

<cfset account.setVerificationValue(999) />

<cfset account.setFirstName("John") />

<cfset account.setLastName("Doe") />

<cfset account.setAddress("888") />

<cfset account.setPostalCode("11111") />

<cfset account.setCountry("USA") />

<cfset account.setRegion("CA") />

<cfset account.setCity("San Jose") />


<cfreturn account />

</cffunction>

As far as the mapping goes, it should be fine.  All the other gateways' unit tests go green, so they are working fine.  I'll test instantiating it outside the unit test as soon as I can.

-jb

Jason Brookins

unread,
Jun 25, 2012, 10:28:52 AM6/25/12
to cfpa...@googlegroups.com
OK. After thinking about this over the weekend, I decided to blow this up and start over (mostly).  My tests today were all green on the gateway access, and I even managed to actually get an XML payload back from Payflow Pro.  So, things are looking better today.  To make my configuration life simpler, I added getters/setters for the Payflow Pro account properties "Vendor" and "Partner" to base.cfc.  I'm not sure whether you want those rolled into the repository, but I have them in there for my local testing.

And thanks for all your help - I'm slowly getting to know cfpayment a little better every day.

-jb

Jason Brookins

unread,
Jun 25, 2012, 12:54:54 PM6/25/12
to cfpa...@googlegroups.com
I'm attempting to pass the required headers for the Payflow Pro call, but I don't know whether they are being correctly sent.  Is there a dump I can do to get the entire HTTP call, including the headers?  I know I have access to 

getRequestData() from the response, but I could use the headers to make sure I'm doing this correctly.


Thanks,

-jb

Brian G

unread,
Jun 26, 2012, 12:11:33 AM6/26/12
to cfpa...@googlegroups.com

Jason - great to hear you got it all sorted.  I hadn't heard of that before and it was kind of scaring me as it was such an elementary error.  Any idea if it turned out to be case sensitivity or mapping or?

At any rate, you can get the requestData.  If you have the gateway in test mode (pass in the config object), the ResponseData structure returned to your gateway from super.process() will include a RequestData key.  That may or may not include enough info for you, so what I would recommend is temporarily including a <cfdump var="#cfhttp#" /> around line 207 of base.cfc.

It would probably be helpful in test mode to dump the request.  My only sensitivity to this is that the request can include credit card numbers and other data and we don't really want to accidentally leave a trace of that data anywhere for PCI DSS purposes.


Brian

Jason Brookins

unread,
Jun 27, 2012, 11:01:25 AM6/27/12
to cfpa...@googlegroups.com
Brian:

I think the path issue may have been related to some malformed code; yesterday I was adding some cfscript blocks to my gateway cfc, and I saw the same error creep in.  However, this issue was a simple missing { in an if conditional.  Once I corrected the code, the path issue went away.  So, my prior error may have been a similar issue.

Thanks for the requestData hint. I will certainly keep that in mind for future tests.

-jb
Reply all
Reply to author
Forward
0 new messages