本文整理汇总了Python中paypal.standard.ipn.models.PayPalIPN.receipt_id方法的典型用法代码示例。如果您正苦于以下问题:Python PayPalIPN.receipt_id方法的具体用法?Python PayPalIPN.receipt_id怎么用?Python PayPalIPN.receipt_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paypal.standard.ipn.models.PayPalIPN
的用法示例。
在下文中一共展示了PayPalIPN.receipt_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PayPalIPNForm
# 需要导入模块: from paypal.standard.ipn.models import PayPalIPN [as 别名]
# 或者: from paypal.standard.ipn.models.PayPalIPN import receipt_id [as 别名]
form = PayPalIPNForm(data)
if form.is_valid():
try:
#When commit = False, object is returned without saving to DB.
ipn_obj = form.save(commit = False)
except Exception, e:
flag = "Exception while processing. (%s)" % e
else:
flag = "Invalid form. (%s)" % form.errors
if ipn_obj is None:
ipn_obj = PayPalIPN()
#Set query params and sender's IP address
ipn_obj.initialize(request)
if flag is not None:
#We save errors in the flag field
ipn_obj.set_flag(flag)
else:
# Secrets should only be used over SSL.
if request.is_secure() and 'secret' in request.GET:
ipn_obj.verify_secret(form, request.GET['secret'])
else:
ipn_obj.verify(item_check_callable)
ipn_obj.receipt_id = data.get('charset')
ipn_obj.save()
return HttpResponse("OKAY")