I'm implementing a PayPal IPN handler in TBNL. The process works like this:
1. paypal receives a payment for your account
2. paypal POSTs the details of the transaction to an URL you specify, e.g. http://tbnlhosting.com/xach/process-ipn
3. you POST the body of their POST back to a paypal URL, with one additional variable appended
4. paypal replies to the POST with "VERIFIED" or "INVALID"
Is it possible to get the verbatim body of a POST request with TBNL? I noticed there's a header-in value of "content-stream", but it's not documented.
Zach
On Mon, 21 Feb 2005 10:58:21 -0500, Zach Beane xach@xach.com wrote:
I'm implementing a PayPal IPN handler in TBNL. The process works like this:
paypal receives a payment for your account
paypal POSTs the details of the transaction to an URL you specify, e.g. http://tbnlhosting.com/xach/process-ipn
you POST the body of their POST back to a paypal URL, with one additional variable appended
paypal replies to the POST with "VERIFIED" or "INVALID"
Is it possible to get the verbatim body of a POST request with TBNL? I noticed there's a header-in value of "content-stream", but it's not documented.
Hi Zach!
No, at the moment you can't. CONTENT-STREAM is not documented because it's of no use once the request object has been created. I think the best way to implement this would be to add a new slot (something like "RAW-POST-DATA") to the request object and only fill it if some special variable which usually is NIL has a true value. What do you think?
If you want to work on this the meat of it should be around line 110 in request.lisp and you should also decide if you want to do the same thing for multipart/form-data POST requests.
I can also do this but probably not this week - I'm pretty busy. So, clean patches including documentation are preferred... :)
Cheers, Edi.
On Mon, Feb 21, 2005 at 05:10:59PM +0100, Edi Weitz wrote:
Hi Zach!
No, at the moment you can't. CONTENT-STREAM is not documented because it's of no use once the request object has been created. I think the best way to implement this would be to add a new slot (something like "RAW-POST-DATA") to the request object and only fill it if some special variable which usually is NIL has a true value. What do you think?
Sounds good to me.
If you want to work on this the meat of it should be around line 110 in request.lisp and you should also decide if you want to do the same thing for multipart/form-data POST requests.
I can also do this but probably not this week - I'm pretty busy. So, clean patches including documentation are preferred... :)
Ok, attached is a patch. I have tested it for a few cases and it seems to work.
Zach