[Seaside] tutorial1: form submit method

Kamil Kukura kamk@volny.cz
Fri, 26 Apr 2002 11:06:11 +0200


 > <snip>
 > The reason I am asking is because some server-to-server communication
 > conventions will try to do just that.  For example, if you use the IPN
 > (Instant Payment Notification) server-to-server feature of PayPal,
 > then the PayPal server will try to invoke a URL that you have
 > specified, with a form filled with a bunch of hidden input fields.  In
 > other words, PayPal will try to POST something very similar to the
 > above html, but without an action attribute specified.  I need to know
 > how to intercept such a situation from within Seaside so that I can
 > look at the hidden fields PayPal is trying to send me.
 >
 > Nevin


And Seaside should do like what? Probably the response of such POST
request from PayPal should be some status code or just anything or
nothing being sent back. So it seems it is "cgi-like" job for Comanche
or whatever server is used.
But it might be you want to process the payment notification within your
application [not session - I assume PayPal's server doesn't expect to
have session from your server]. Then I would go by having own
IAApplication's subclass with:

handleRequest: request response: response url: url
     url at: 1 ifPresent: [:special |
         special = 'processIPN' ifTrue: [
             "process this notification with fields found in request and
             sent something back using response"

             ^ self]].


     "otherwise continue as normaly"
     super handleRequest: request response: response url: url

and thus URL for PayPal will look like
http://www.somewhere/seaside/someapp/processIPN

-- 
Kamil