From 1f2416e0b2b1863eef5f0f99f61e9d60ec97996c Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 20 Feb 2018 15:35:46 +0300 Subject: [PATCH] migrate update --- access/views.py | 4 ++-- finance/yandex.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 finance/yandex.py diff --git a/access/views.py b/access/views.py index 1d05b66..4505f22 100644 --- a/access/views.py +++ b/access/views.py @@ -143,8 +143,8 @@ class DetailUserView(APIView): acc = request.JSON.get('account', None) - b_date = datetime.datetime.strptime(acc['b_date'], '%d.%m.%Y') # TODO вынести форматы в настройки - acc['b_date'] = b_date.strftime('%Y-%m-%d') + b_date = datetime.datetime.strptime(acc['b_day'], '%d.%m.%Y') # TODO вынести форматы в настройки + acc['b_day'] = b_date.strftime('%Y-%m-%d') acc['gender'] = 0 if acc['gender'] == "undefined" else 1 if acc['gender'] == "male" else 2 diff --git a/finance/yandex.py b/finance/yandex.py new file mode 100644 index 0000000..7bb4d51 --- /dev/null +++ b/finance/yandex.py @@ -0,0 +1,42 @@ +# # coding=utf-8 +# import datetime +# from hashlib import md5 +# from django.shortcuts import render +# from django.views.decorators.csrf import csrf_exempt +# +# from lms.settings import YANDEX_MONEY_SHOP_PASSWORD +# +# +# # coding=utf-8 +# import datetime +# from hashlib import md5 +# from django.shortcuts import render +# from django.views.decorators.csrf import csrf_exempt +# +# from finance.models import Bill, YandexKassaHistory +# from lms.settings import YANDEX_MONEY_SHOP_PASSWORD +# +# +# def gen_md5(cd): +# return md5(';'.join(( +# cd['action'], +# cd['orderSumAmount'], +# cd['orderSumCurrencyPaycash'], +# cd['orderSumBankPaycash'], +# cd['shopId'], +# cd['invoiceId'], +# cd['customerNumber'], +# YANDEX_MONEY_SHOP_PASSWORD, +# )).encode('utf-8')).hexdigest().upper() +# +# +# @csrf_exempt +# def aviso(request): +# # Страница получения результата о платежах +# data = request.POST +# +# +# +# @csrf_exempt +# def check(request): +# data = request.POST