开发者

django-paypal IPN doesn't work

I'm using django-paypal as a payment solution inside my django application. I'm trying to implement a IPN handler.

What happens when I receive an IPN message at my IPN-handling URL the django server crashes:

Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 281, in run
    self.finish_response()
  File "/usr/local/lib/p开发者_JS百科ython2.6/dist-packages/django/core/servers/basehttp.py", line 321, in finish_response
    self.write(data)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 417, in write
    self._write(data)
  File "/usr/lib/python2.6/socket.py", line 300, in write
    self.flush()
  File "/usr/lib/python2.6/socket.py", line 286, in flush
    self._sock.sendall(buffer)
error: [Errno 104] Connection reset by peer

My payments applications urls.py looks like this:

urlpatterns = patterns('mysite.payment.views',
    (r'^thank_you/', 'thank_you'),
    (r'^canceled/', 'canceled'),
    (r'^paypal-ipn/', include('paypal.standard.ipn.urls'))
    )

To me the error message is pretty useless. Would be great if someone could help me.


I admit I'm an idiot :)

You don't need ssl for this. But what you need is to do a syncdb before you are able to use it,...

God sometimes it is so easy that you just don't see it.


Can you monitor precisely the packet that paypal is sending your server using tcpdump or wireshark? It looks like they may be terminating the connection early, but it's hard to tell much without a longer traceback and/or a packet dump.

Edit: I had forgotten about the https messages. Paypal probably requires HTTPS for those callbacks. The dev server won't support that, so unfortunately you will probably need to flesh out your server configuration before you can test that functionality.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜