diff --git a/project/customer/urls.py b/project/customer/urls.py index be7a31f..b816e4e 100644 --- a/project/customer/urls.py +++ b/project/customer/urls.py @@ -15,13 +15,16 @@ urlpatterns = patterns('', url(r'^profile/$', profile.profile_view, name='customer_profile_view'), url(r'^profile/edit/$', profile.profile_edit, name='customer_profile_edit'), url(r'^profile/email/$', profile.profile_email, name='customer_profile_email'), + url(r'^license/$', license.order_license, name='customer_order_license'), url(r'^delete_license/(?P\d+)/$', license.delete_license, name='customer_delete_license'), url(r'^get_doc/(?P\d+)/$', docs.get_doc, name='customer_license_get_doc'), + url(r'^payment/confirm/(?P\d+)$', license.yandex_pay, name='yamoney_confirm'), - url(r'^payment/result/$', license.payment_result, name='yamoney_result'), + #url(r'^payment/result/$', license.payment_result, name='yamoney_result'), # not used url(r'^payment/success/$', license.payment_success, name='yamoney_success'), url(r'^payment/fail/$', license.payment_fail, name='yamoney_fail'), + url(r'^license_list/$', license.license_list, name='customer_license_list'), url(r'^paid_list/$', license.paid_list, name='customer_paid_list'), diff --git a/project/customer/views/license.py b/project/customer/views/license.py index 92df19b..e5f8da9 100644 --- a/project/customer/views/license.py +++ b/project/customer/views/license.py @@ -117,27 +117,26 @@ def delete_license(request, pk): data = json.dumps(dictionary) return HttpResponse(data, mimetype='application/json') - -@csrf_exempt -def payment_result(request): - if request.method == 'POST': - try: - nInvId = request.POST.get('InvId') - - nOutSum = request.POST.get('OutSum') - sSignatureValue = request.POST.get('SignatureValue') - SignatureValue = hashlib.md5('%s:%s:%s' % (nOutSum, nInvId, settings.ROBOKASSA_PASSWORD2)).hexdigest() - if sSignatureValue.upper() == SignatureValue.upper(): - license = License.objects.get(pk=nInvId) - license.status = 1 - license.save() - return HttpResponse('OK%s' % nInvId) - else: - return HttpResponse('bad sign') - except License.DoesNotExist: - return HttpResponseForbidden() - else: - return HttpResponseForbidden() + +#@csrf_exempt +#def payment_result(request): +# if request.method == 'POST': +# try: +# nInvId = request.POST.get('InvId') +# nOutSum = request.POST.get('OutSum') +# sSignatureValue = request.POST.get('SignatureValue') +# SignatureValue = hashlib.md5('%s:%s:%s' % (nOutSum, nInvId, settings.ROBOKASSA_PASSWORD2)).hexdigest() # robokassa??? +# if sSignatureValue.upper() == SignatureValue.upper(): +# license = License.objects.get(pk=nInvId) +# license.set_paid() +# license.save() +# return HttpResponse('OK%s' % nInvId) +# else: +# return HttpResponse('bad sign') +# except License.DoesNotExist: +# return HttpResponseForbidden() +# else: +# return HttpResponseForbidden() @csrf_exempt