PayPalAction Class Reference

Inherits com::webobjects::appserver::WODirectAction.

Collaboration diagram for PayPalAction:

Collaboration graph
[legend]

List of all members.

Classes

class  HTTPStatusResponse
class  OKResponse

Public Member Functions

WOActionResults cancelAction ()
WOActionResults ipnAction ()
 PayPalAction (WORequest aRequest)
WOActionResults returnAction ()

Static Public Attributes

static final String paypalCgi = "/cgi-bin/webscr"
static final String paypalSite = "www.paypal.com"
static final String sandboxSite = "www.sandbox.paypal.com"


Detailed Description

PayPalAction is a DirectAction subclass that holds all the functionality for processing information that PayPal would send back to the application, including processing Instant Payment Notification communications, and responding to the successful and cancelled transaction pages to which PayPal will return users. Its action handler is PayPalAction, so your url will take the form: http://www.yoursite.com/cgi-bin/WebObjects/yourAppName.woa/wa/PayPalAction/actionName...

Constructor & Destructor Documentation

PayPalAction ( WORequest  aRequest  ) 

Constructor

Parameters:
aRequest WORequest


Member Function Documentation

WOActionResults cancelAction (  ) 

Provides a default method to return the page to which PayPal will send users after a cancelled transaction.

First it checks to see if there's a System property assigned to tell it what page to return. If it finds one it returns that page by calling pageWithName(property value).

If it doesn't find one, it returns the very simple default component, CancelledPayPalTransaction.

Returns:
WOComponent for cancelled PayPal transactions

WOActionResults ipnAction (  ) 

Processor for Instant Payment Notifications

The class takes the request and constructs a response that it then echoes back to PayPal, with the additional value "&cmd=_notify-validate.

PayPal will then send a one word code for the status of the transaction. This method then parses for that word and sends the appropriate notification for the result, with the original WORequest object from PayPal attached to it (as the notification's object).

The notification gets picked up by the PayPalNotificationListenerClass, which then hands it to the delegate class you assigned to handle the notification. Pretty simple.

WOActionResults returnAction (  ) 

Provides a default method to return the page to which PayPal will send users after a successful transaction.

First it checks to see if there's a System property assigned to tell it what page to return. If it finds one, it returns that page by calling pageWithName(property value).

If it doesn't find one, it returns the very simple default component, SuccessfulPayPalTransaction.

Returns:
WOComponent for successful PayPal transactions


Member Data Documentation

final String paypalCgi = "/cgi-bin/webscr" [static]

The cgi portion of PayPal's url for doing Instant Payment Notification verifications

final String paypalSite = "www.paypal.com" [static]

Simply PayPal's url, sans the protocol

final String sandboxSite = "www.sandbox.paypal.com" [static]

PayPal developer sandbox URL


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:37 2012 for Project Wonder by  doxygen 1.5.8