您好我在我的Django电子商务中集成了条带。客户可以付款,我可以在条带的仪表板中看到该交易。但是当Stripe向我发送IPN时,这就是我所看到的(这是请求):
<WSGIRequest
path:/response_ipn_stripe/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{'CONTENT_LENGTH': '2546',
'CONTENT_TYPE': 'application/json; charset=utf-8',
u'CSRF_COOKIE': u'******',
'DOCUMENT_ROOT': '******',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HTTP_ACCEPT': '*/*; q=0.5, application/xml',
'HTTP_CACHE_CONTROL': 'no-cache',
'HTTP_HOST': 'domain.com',
'HTTP_USER_AGENT': 'Ruby',
'HTTP_X_NEWRELIC_ID': '******',
'HTTP_X_NEWRELIC_TRANSACTION': '******',
'PATH_INFO': u'/response_ipn_stripe/',
'PATH_TRANSLATED': '******',
'QUERY_STRING': '',
'REMOTE_ADDR': '******',
'REMOTE_PORT': '******',
'REQUEST_METHOD': 'POST',
'REQUEST_URI': '/response_ipn_stripe/',
'SCRIPT_FILENAME': '******',
'SCRIPT_NAME': u'',
'SERVER_ADDR': '******',
'SERVER_ADMIN': '*******',
'SERVER_NAME': '******',
'SERVER_PORT': '80',
'SERVER_PROTOCOL': 'HTTP/1.1',
'SERVER_SIGNATURE': '<address>Apache/2.2.22 (Ubuntu) Server at domain.com Port 80</address>\n',
'SERVER_SOFTWARE': 'Apache/2.2.22 (Ubuntu)',
'mod_wsgi.application_group': 'domain.com|',
'mod_wsgi.callable_object': 'application',
'mod_wsgi.handler_script': '',
'mod_wsgi.input_chunked': '0',
'mod_wsgi.listener_host': '',
'mod_wsgi.listener_port': '80',
'mod_wsgi.process_group': '',
'mod_wsgi.request_handler': 'wsgi-script',
'mod_wsgi.script_reloading': '1',
'mod_wsgi.version': (3, 3),
'wsgi.errors': <mod_wsgi.Log object at 0x7f8a9980b0f0>,
'wsgi.file_wrapper': <built-in method file_wrapper of mod_wsgi.Adapter object at 0x7f8a999e7a80>,
'wsgi.input': <mod_wsgi.Input object at 0x7f8a997fcdf0>,
'wsgi.multiprocess': True,
'wsgi.multithread': False,
'wsgi.run_once': False,
'wsgi.url_scheme': 'http',
'wsgi.version': (1, 1)}>
如果POST查询为空,我如何访问信息?
这是我的Django视图:
@csrf_exempt
def ipn_stripe(request):
log1 = AppLogs.objects.create(text="IPN_STRIPE START")
event_json = simplejson.load(request.body)
log2 = AppLogs.objects.create(text=event_json)
log3 = AppLogs.objects.create(text="IPN_STRIPE END")
return HttpResponse(status=200)
更新
我尝试过: request.body , request.POST ['_ content'] , HttpRequest.POST , HttpRequest。正文, request.POST
由于