On Wed, 2008-23-04 at 16:28 -0700, iain duncan wrote:
> On Wed, 2008-23-04 at 15:53 -0700, iain duncan wrote:
> > On Wed, 2008-23-04 at 15:37 -0700, mbertoldi wrote:
> > > Just another check, is the ipn method using **kwargs?
> > 
> > Yes, and thanks for the help. I've narrowed it down now to something to
> > do with the user running the process. To my chagrin, my supervisord is
> > all mucked up and is not switching users as I thought I had instructed
> > it to do. So in production mode the site is being run as root because
> > supervisord runs as root ( it's supposed to, but it's not switching
> > users before issuing the command. )
> 
> I guess the above is wrong, because on rechecking, now it failed with
> the site account user running the python process. So I'm stumped,
> sometimes paypal posts to me, sometimes the post doesn't come through.
> 
> still stumped, weird!

So tonight I braved the bad 'old land of cgi to test it out, and from
what I can tell so far ( more tomorrow ), the cgi script gets hit
consistently by pal no problem. Unfortunately, I'm not managing to
verify with that one, which did work on the TG version *when* the ipn
script got run. 

Would there be anything different about posting back from a cgi script?
Some charset issue I might not know about? The post back code is below,
if anyone knows whether this would execute for some reason differently
from a tg app I would love to know:

# form is a dict for the field storages
form = cgi.FieldStorage()
params = {}
params['cmd']='_notify-validate'

# add all the form vars that we were sent
for key in form.keys():
    params[key] = form.getvalue(key)

# construct a post back to paypal
req_params = urllib.urlencode( params )
log.info("\n\n req_params: \n%s\n\n" % req_params )

paypal_url = "https://www.paypal.com/cgi-bin/webscr";
headers = {"Content-type":"application/x-www-form-urlencoded"}

# make a post hit to the paypal url and read the response
request = urllib2.Request( paypal_url, req_params, headers )
response = urllib2.urlopen( request )
result = response.read()


Thanks,
Iain


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to