def process_data(self, payment, request):
        if not 'trans' in request.GET:
            return HttpResponseForbidden('FAILED')
        transaction_id = request.GET.get('trans')
        payment.transaction_id = transaction_id
        transaction_request = render_to_string(
            'payments/sofort/transaction_request.xml',
            {'transactions': [transaction_id]})
        doc, response = self.post_request(transaction_request)
        try:
            # If there is a transaction and status returned,
            # the payment was successful
            status = doc['transactions']['transaction_details']['status']
        except __HOLE__:
            # Payment Failed
            payment.change_status('rejected')
            return redirect(payment.get_failure_url())
        else:
            payment.captured_amount = payment.total
            payment.change_status('confirmed')
            payment.extra_data = json.dumps(doc)
            sender_data = doc['transactions']['transaction_details']['sender']
            holder_data = sender_data['holder']
            first_name, last_name = holder_data.rsplit(' ', 1)
            payment.billing_first_name = first_name
            payment.billing_last_name = last_name
            payment.billing_country_code = sender_data['country_code']
            payment.save()
            return redirect(payment.get_success_url())
dataset/ETHPy150Open mirumee/django-payments/payments/sofort/__init__.py/SofortProvider.process_data