def get_form(self, payment, data=None):
        if not payment.id:
            payment.save()
        xml_request = render_to_string(
            'payments/sofort/new_transaction.xml', {
                'project_id': self.project_id,
                'language_code': get_language(),
                'interface_version': 'django-payments',
                'amount': payment.total,
                'currency': payment.currency,
                'description': payment.description,
                'success_url': payment.get_process_url(),
                'abort_url': payment.get_process_url(),
                'customer_protection': '0'})
        doc, response = self.post_request(xml_request)
        if response.status_code == 200:
            try:
                raise RedirectNeeded(doc['new_transaction']['payment_url'])
            except __HOLE__:
                raise PaymentError(
                    'Error in %s: %s' % (
                        doc['errors']['error']['field'],
                        doc['errors']['error']['message']))
dataset/ETHPy150Open mirumee/django-payments/payments/sofort/__init__.py/SofortProvider.get_form