|
|
|
|
@ -4,7 +4,7 @@ from django.http import HttpResponse |
|
|
|
|
from django.template.response import TemplateResponse |
|
|
|
|
from django.views.decorators.csrf import csrf_exempt |
|
|
|
|
|
|
|
|
|
from customer.models import Payment |
|
|
|
|
from customer.models import Payment, License |
|
|
|
|
from customer.utils import get_robokassa_url |
|
|
|
|
from robokassa.conf import USE_POST |
|
|
|
|
from robokassa.forms import ( |
|
|
|
|
@ -64,7 +64,18 @@ def success(request, template_name='robokassa/success.html', |
|
|
|
|
sender=form, InvId=inv_id, OutSum=out_sum, |
|
|
|
|
extra=form.extra_params()) |
|
|
|
|
|
|
|
|
|
context = {'InvId': inv_id, 'OutSum': out_sum, 'form': form} |
|
|
|
|
try: |
|
|
|
|
payment = Payment.objects.get( |
|
|
|
|
pk=inv_id, |
|
|
|
|
order_amount=out_sum |
|
|
|
|
) |
|
|
|
|
lic = License.objects.get(pk=payment.order_number) |
|
|
|
|
except Payment.DoesNotExist: |
|
|
|
|
lic = '' |
|
|
|
|
except License.DoesNotExist: |
|
|
|
|
lic = '' |
|
|
|
|
|
|
|
|
|
context = {'InvId': inv_id, 'OutSum': out_sum, 'lic': lic, 'form': form} |
|
|
|
|
context.update(form.extra_params()) |
|
|
|
|
context.update(extra_context or {}) |
|
|
|
|
return TemplateResponse(request, template_name, context) |
|
|
|
|
|