I'm trying to integrate a Django app with PagSeguro, but I'm having trouble with the notifications part.
This is the view that receives the notifications:
def recebe_notificacao(request):
if request.method == 'POST':
notification_code = request.POST['notificationCode']
if notification_code:
url = 'https://ws.pagseguro.uol.com.br/v2/transactions/notifications/' + notification_code + 'email' + 'token'
r = requests.get(url)
print 'r ' + r
else:
print 'notification code is null'
return render(request, 'update_transactions.html')
I saw the PagSeguro documentation that they return me several parameters, but I'm not sure how I can access them through the r
variable. For example, how do I know the status of the transaction, which is returned as an XML?