com.mikeblanton.paypal.servlet
Class AbstractPDTServlet

com.mikeblanton.paypal.servlet.AbstractPDTServlet
Direct Known Subclasses:
FilePDTServlet

public abstract class AbstractPDTServlet

The AbstractPDTServlet can be extended to deal with incoming PDT's. An attempt to validate the is done by posting the PDT back to PayPal (see the PayPal Integration Guide for more information). If the PDT is successfully validated, the abstract method processValidPDT(PayPalData) is called. Otherwise, the abstract method processInvalidPDT(PayPalData) method is called.

Version:
$Revision: 1.3 $
Author:
Michael Blanton

Constructor Summary
AbstractPDTServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response)
          Called when a GET request is made.
protected  void doPost(javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response)
          Called when a POST request is made.
protected  java.lang.String getAt()
          Loads the at field in the following order:
Servlet Parameter paypaltools.pdt.at Configuration Property pdt.at System Property paypaltools.pdt.at NOTE: The at field is only loaded the first time the method is called.
protected abstract  void processInvalidPDT(PayPalData _data, javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response)
          Abstract method that is called when an INVALID PDT is received.
protected abstract  void processValidPDT(PayPalData _data, javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse _response)
          Abstract method that is called when a VALID PDT is received.
 

Constructor Detail

AbstractPDTServlet

public AbstractPDTServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest _request,
                     javax.servlet.http.HttpServletResponse _response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Called when a GET request is made. The PDT is validated via a POST back to PayPal. Any error while POST-ing back to PayPal will result in a 500. Any redirect upon completion is handled by the process methods.

doPost

protected void doPost(javax.servlet.http.HttpServletRequest _request,
                      javax.servlet.http.HttpServletResponse _response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Called when a POST request is made. The PDT is validated via a POST back to PayPal. Any error while POST-ing back to PayPal will result in a 500 response from the Servlet. Any redirect upon completion is handled by the process methods.

getAt

protected java.lang.String getAt()
Loads the at field in the following order:
NOTE: The at field is only loaded the first time the method is called.
Returns:
 

processValidPDT

protected abstract void processValidPDT(PayPalData _data,
                                        javax.servlet.http.HttpServletRequest _request,
                                        javax.servlet.http.HttpServletResponse _response)
Abstract method that is called when a VALID PDT is received. Make sure you implement code to deal with the response to the user.
Parameters:
_data -  

processInvalidPDT

protected abstract void processInvalidPDT(PayPalData _data,
                                          javax.servlet.http.HttpServletRequest _request,
                                          javax.servlet.http.HttpServletResponse _response)
Abstract method that is called when an INVALID PDT is received. Make sure you implement code to deal with the response to the user.
Parameters:
_data -