• Welcome to KonaKart Community Forum. Please login or sign up.
 

The callback from PayPal did not contain the 'custom' parameter.

Started by kevix, February 11, 2013, 10:41:56 am

Previous topic - Next topic

kevix

We are evaluating konakart community edition 6.3.0.0. I am testing the Paypal Standard integration using a sandbox test account. I believe I have set up the module correctly and I can see that the payment is made to the paypal sandbox merchant account from the sandbox customer account however a callback is not received.

I have set the callback user to the "out of the box" admin user. Although our development server is behind our firewall port forwarding seems to be working and I think the callback is received but it fails producing this exception in the log... can anyone offer advice on how to get the callback to work?


java.lang.Exception: The callback from PayPal did not contain the 'custom' parameter.
at com.konakart.actions.ipn.PayPalAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

ming

Hi,

I'm not sure what the problem is.  Your response from PayPal doesn't seem to be complete or as expected.

With these payment gateways it's often handy to set these to DEBUG in konakart/WEB-INF/classes/konakart-logging.properties and try again:

# Modules
log4j.logger.com.konakart.bl.modules.payment    = DEBUG

# Gateways
log4j.logger.com.konakart.actions.gateways      = DEBUG
log4j.logger.com.konakart.actions.ipn           = DEBUG



If that doesn't help you could always add some diagnostic lines into the source code, rebuild using our ANT build under custom and get more information.   (Source for these modules is under the custom directory).


BTW...   our next version (v6.5.0.0) should be released this week.   New storefront - demo live at http://www.konakart.com/konakart/


ming

I noticed that in the new version (v6.5.0.0) released today... there was a note about some changes to PayPal:

* Send additional parameters in PayPal module (first_name, last_name address1, address2 city, state, country, postcode)


Maybe you could try the new version to see if that helps?


kevix

I have got 6.5.0.0 installed today (new storefront looks nice!).
I have tried an initial test and the callback didn't work, I need to turn the logging on for 6.5.0.0 and I will report back with more info.

Previously I had set the Paypal currency to be "GBP", now I have left it as the default "Selected Currency". We'd actually want it to always take payments in GBP though. Can I specify "GBP" here?

Previously, using the sandbox, the customer would be taken to the Paypal site (login, confirm payment, etc) and there would then be a link to return back to the konakart site, however this final link was not present, nor did it redirect.


kevix

OK I have got the Paypal module working. At the same time I was also developing my own payment module that uses IPN and that too wasn't generating a callback.

My test server is at work, behind the firewall, and I forward port 8780 from the router (internet side) to the test server port 8780.

From the log (catalina.out) I could not see the debug statement in the PaypalAction class, so it made me suspicious that the callback was not being made.

I went to the Paypal Sandbox and logged in. I turned on the IPN history and could see that all the IPN sends had failed, and the odd thing was none had any HTTP status code (should be 200, or at least 404 or 500 or something if it went wrong).

Then I turned on the GET/POST logging so that I could see the HTTP requests. To do this edit konakart/conf/server.xml and uncomment the valve section, then restart the server. You will then be able to see the requests in konakart/logs/localhost_access_log.yyyy-mm-dd.txt. I could see that there were no POST requests coming in to /konakart/PayPalCallback.action, my hunch was right - but why?

I also "discovered" the Paypal IPN simulator and this showed that it was getting "connection refused" on port 8780. Another good clue.

From my Linux box at home I tried to use wget to get the callback, I got a status 302 and was redirected to the Welcome page - so that could get a connection on port 8780.

I then logged in to the company webserver and tried wget on the callback URL and got a "connection refused" too. So two out of three external connections were refused (plus, I believe the callback from the other payment gateway). Could it be that the remote hosts are refusing the connection based on their own firewall rules for port 8780?

To test this theory I added another port forward on the router to forward port 80 (normal http port) onto 8780 on the konakart server, altered the callback in the Paypal module to remove the port (http://server/konakart/PayPalCallback.action) and... it worked!

This shouldn't be a problem in production as we will want to do it all on port 80, but I am surprised that it worked earlier in the month and seems to be blocked now. Anyone else have problems with callbacks to 8780?


ming

Yes some of the gateway suppliers seem to have restrictions on which ports they will respond to.. worth checking as they can change over time... Moneybookers/Skrill, for example, have this list of supported ports:

80, 81, 82, 83, 88, 90, 178, 419, 433, 443, 444, 448, 451, 666, 800, 888, 1025, 1430, 1680, 1888, 1916, 1985, 2006, 2221, 3000, 4111, 4121, 4423, 4440, 4441, 4442, 4443, 4450, 4451, 4455, 4567, 5443, 5507, 5653, 5654, 5656, 5678, 6500, 7000, 7001, 7022, 7102, 7777, 7878, 8000, 8001, 8002, 8011, 8014, 8015, 8016, 8027, 8070, 8080, 8081, 8082, 8085, 8086, 8088, 8090, 8097, 8180, 8181, 8443, 8449, 8680, 8843, 8888, 8989, 9006, 9088, 9443, 9797, 10088, 10443, 12312, 18049, 18079, 18080, 18090, 18443, 20202, 20600, 20601, 20603, 20607, 20611, 21301, 22240, 26004, 27040, 28080, 30080, 37208, 37906, 40002, 40005, 40080, 50001, 60080, 60443