A Java servlet to recieve PayPal Instant Payment Notifications (IPN)
Switch branches/tags
Nothing to show



This project contains a Google AppEngine project that :

  • has a servlet implementing the PayPal IPN "protocol" (Instant Payment Notification)
  • persists all IPN messages (and parses them partially)
  • uses postback validation
  • a minimal Vaadin application to browse the stored IPN messages

Keep in mind that the PayPal sandbox can be pretty slow. So you might get timeouts on validation messaages (GAE has a set 10s max timeout)

Feel free to fork this project and improve it. I'd love to see some cooperation on taming the PayPal beast :)

Getting started

Build and run the example application

  1. mvn clean install
  2. cd war
  3. mvn appengine:devserver



Upgrade to Objectify 4.0rc2 Minor upgrades for both Vaadin and AppEngine


Upgrade to Vaadin 7 and AppEngine 1.8.

important The Maven AppEngine plugin is now the one officially supported by Google. The plugin requires Maven 3.1.0 or higher, so you may need to upgrade Maven.

Using the Library in Your Own Projects

Register the Context Listener

In our web.xml, make sure you register the IPNContextListener, else you won't be able to persist the messages to the datastore.


Configure the PayPal environment

Add in web.xml


Possible values: SANDBOX, LIVE

Configuring the task queue

In your WEB-INF directory, create a queue.xml file to configure the task queue that will handle validation. Example:

<?xml version="1.0" encoding="UTF-8"?>

Adding the Servlets

To process PayPal IPN messages, the task queue is used. This allows for easy and configurable retries. To properly process IPN messages you will need three servlets. Two are part of this packages, one you will need to implement yourself.

The IPNServlet stores incoming IPN messages as is and forwards them to the IPNValidationServlet through a task queue.


The IPNValidationServlet tries to validate the message. The number and frequency of retries is configured in the queue. After successful validation, the servlet starts the processing task.

		<description>Task to launch after validation</description>

The processing servlet should be implemented by you. To get you started, this project contains a dummy servlet.


Maven Repository

Currently this project is not released or deployed to a public repository. Please let me know if you'd like that.