我一直在通过django-paypal文档选择我的方式,当我从沙箱模拟器发送IPN时,我得到了一个连接的信号。
我可以这样做:
UserProfile.objects.update(has_paid=True)我也可以这样做:
UserProfile.objects.update(middle_name=sender.custom) # sender.custom set to "Lyndon" on IPN每个人都可以免费享受一年。不是我想要的..。我想做的是
up = UserProfile.objects.get(user=ipn_obj.custom)
up.has_paid = False
up.save()但在这种情况下,我在即时支付通知(IPN)模拟器上收到服务器错误(500)消息。
IPN delivery failed. HTTP error code 500: Internal Server Error我仍然得到一个贝宝IPN在我的数据库中,它将显示没有标志和支付状态为“完成”。但是,信号没有连接。
我只是没有得到一些东西(或者多个东西!)这里。任何指点都非常感谢。
T
发布于 2012-09-22 05:28:32
如果我注意一下会有帮助的..。
up = UserProfile.objects.get(user.username=ipn_obj.custom)user.username...
发布于 2012-09-30 04:32:21
试着利用这点
UserProfile.objects.filter(user=ipn_obj.custom).update(has_paid=False)对于这类错误,您无法使用ipdb了解问题是什么:
你应该安装ipdb,
$ pip install ipdb要运行,请转到不起作用的代码并添加,
import ipdb; ipdb.set_trace()当您在本地(我指的是runserver)上运行并请求运行这些代码片段时,您将看到上面一行之后的跟踪。
请注意,下一步使用"n“,继续在ipdb上使用"c”。
https://stackoverflow.com/questions/12467717
复制相似问题