diff --git a/project/customer/callbacks.py b/project/customer/callbacks.py deleted file mode 100644 index a237378..0000000 --- a/project/customer/callbacks.py +++ /dev/null @@ -1,21 +0,0 @@ -# encoding:utf-8 -from datetime import date - -from django.dispatch import receiver - -from yandex_money.signals import payment_completed - -from customer.models import License - - -@receiver(payment_completed) -def pay_license(sender, **kwargs): - try: - print '!!!!!!!!!!!!!' - license = License.objects.get(id=sender.order_number) - license.paid_date = date.today() - license.status = 1 - license.save() - except: - print 8789879787897, '@@@@@@@@@@@@@@@@' - pass diff --git a/project/customer/views/license.py b/project/customer/views/license.py index 6fa5981..08c0df7 100644 --- a/project/customer/views/license.py +++ b/project/customer/views/license.py @@ -27,7 +27,8 @@ def yandex_pay(request, payment_id): if payment.user != request.user: raise form = YaForm(instance=payment) - return render(request, template_name, {'form': form}) + return render(request, template_name, {'form': form, + 'ya_url': settings.YANDEX_MONEY_PAYMENT_URL}) @login_required diff --git a/project/settings.py b/project/settings.py index 2a227c4..131dfc8 100644 --- a/project/settings.py +++ b/project/settings.py @@ -353,7 +353,7 @@ YANDEX_MONEY_SHOP_ID = 92585 YANDEX_MONEY_SHOP_PASSWORD = 'sQuMtorHE02U' YANDEX_MONEY_FAIL_URL = 'https://dokumentor.ru/my/payment/fail/' YANDEX_MONEY_SUCCESS_URL = 'https://dokumentor.ru/my/payment/success/' -YANDEX_MONEY_PAYMENT_URL = 'https://demomoney.yandex.ru/eshop.xml' +YANDEX_MONEY_PAYMENT_URL = 'https://money.yandex.ru/eshop.xml' # информировать о случаях, когда модуль вернул Яндекс.Кассе ошибку YANDEX_MONEY_MAIL_ADMINS_ON_PAYMENT_ERROR = True diff --git a/project/templates/customer/profile/yandex.html b/project/templates/customer/profile/yandex.html index dbb6378..ae8c1df 100644 --- a/project/templates/customer/profile/yandex.html +++ b/project/templates/customer/profile/yandex.html @@ -12,7 +12,7 @@