|
|
|
|
@ -6,7 +6,6 @@ from urllib.parse import urlsplit |
|
|
|
|
|
|
|
|
|
from django.contrib import messages |
|
|
|
|
from django.contrib.auth.decorators import login_required |
|
|
|
|
from django.core.exceptions import DisallowedHost |
|
|
|
|
from django.http import HttpResponse |
|
|
|
|
from django.shortcuts import redirect, get_object_or_404 |
|
|
|
|
from django.views.generic import View, TemplateView |
|
|
|
|
@ -26,6 +25,10 @@ from .models import AuthorBalance, CoursePayment, SchoolPayment |
|
|
|
|
logger = logging.getLogger('django') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DisallowedPingbackHost(Exception): |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@method_decorator(login_required, name='dispatch') |
|
|
|
|
class CourseBuySuccessView(TemplateView): |
|
|
|
|
template_name = 'payment/course_payment_success.html' |
|
|
|
|
@ -248,5 +251,5 @@ class PaymentwallCallbackView(View): |
|
|
|
|
payment.author_balance.save() |
|
|
|
|
return HttpResponse('OK') |
|
|
|
|
else: |
|
|
|
|
raise DisallowedHost |
|
|
|
|
raise DisallowedPingbackHost |
|
|
|
|
return HttpResponse(status=403) |
|
|
|
|
|