Django Callback on Facebook Credits

I would like to use Facebook Credits with my Django app.

The Facebook Credits documentation has only a sample for the PHP callback page (https://developers.facebook.com/blog/post/489/).

However, I would like to develop a callback in my Django application. I already created a view for the callback, but now I have no idea what Facebook is sending me and how to parse it.

I assume this is some kind of HTTP POST request with some parameters that I should parse, but how?

Thanks for all the input.

-one
source share
1 answer

They send you a signed request that needs to be analyzed. I would suggest reading the rest of the facebook documentation if you are confused about what this means.

This guy has already done the php to python conversion for you: http://sunilarora.org/parsing-signedrequest-parameter-in-python-bas

After you make out what they sent to you, do exactly what they do in the php script. Then you send json to them. At the end of your presentation:

def fb_credits_callback(request): # parse with your parse function # handle request return HttpResponse(json.dumps(data)) 
+3
source

Source: https://habr.com/ru/post/1393737/


All Articles