parent
2a9f5e5288
commit
0a04dad21a
11 changed files with 298 additions and 28 deletions
@ -0,0 +1,11 @@ |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% block content %} |
||||
<div class='container-fluid'> |
||||
<div class='row'> |
||||
<div class='col-xs-12' style='margin-top: 15px'> |
||||
<h1 style="text-align: center">{{ message }}</h1> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -1,13 +1,61 @@ |
||||
from django import forms |
||||
from django.conf import settings |
||||
|
||||
from .models import WithDraw |
||||
|
||||
|
||||
class WithDrawForm(forms.ModelForm): |
||||
|
||||
class Meta: |
||||
model = WithDraw |
||||
|
||||
fields = ( |
||||
'sum', |
||||
'yandex_card', |
||||
'user', |
||||
) |
||||
|
||||
|
||||
class TmpCheckOrderForm(forms.Form): |
||||
action = forms.CharField() # Has to be "checkOrder" |
||||
md5 = forms.CharField() |
||||
shopId = forms.IntegerField() |
||||
invoiceId = forms.IntegerField() |
||||
|
||||
def clean_action(self): |
||||
action = self.cleaned_data.get('action') |
||||
|
||||
if action != 'checkOrder': |
||||
raise forms.ValidationError('Wrong action') |
||||
|
||||
return action |
||||
|
||||
def clean_shopId(self): |
||||
shopId = self.cleaned_data.get('shopId') |
||||
|
||||
if shopId != settings.YANDEX_MONEY['shop_id']: |
||||
raise forms.ValidationError('Wrong shop ID') |
||||
|
||||
return shopId |
||||
|
||||
|
||||
class TmpPaymentAvisoForm(forms.Form): |
||||
action = forms.CharField() # Has to be "paymentAviso" |
||||
md5 = forms.CharField() |
||||
shopId = forms.IntegerField() |
||||
invoiceId = forms.IntegerField() |
||||
|
||||
def clean_action(self): |
||||
action = self.cleaned_data.get('action') |
||||
|
||||
if action != 'paymentAviso': |
||||
raise forms.ValidationError('Wrong action') |
||||
|
||||
return action |
||||
|
||||
def clean_shopId(self): |
||||
shopId = self.cleaned_data.get('shopId') |
||||
|
||||
if shopId != settings.YANDEX_MONEY['shop_id']: |
||||
raise forms.ValidationError('Wrong shop ID') |
||||
|
||||
return shopId |
||||
|
||||
@ -0,0 +1,20 @@ |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% block content %} |
||||
<div class='container-fluid'> |
||||
<div class='row'> |
||||
<div class='a col-xs-12'> |
||||
<form action='{{ YANDEX_MONEY.url }}' method='POST' novalidate> |
||||
<p>shopId: <input type='text' name='shopId' value='{{ YANDEX_MONEY.shop_id }}'></p> |
||||
<p>scid: <input type='text' name='scid' value='{{ YANDEX_MONEY.scid }}'></p> |
||||
<p>sum: <input type='text' name='sum' value='100'></p> |
||||
<p>customerNumber: <input type='text' name='customerNumber' value='123'></p> |
||||
|
||||
<p>paymentType: <input type='text' name='paymentType' value='AC'></p> |
||||
|
||||
<p><button type='submit'>Simulate check</button></p> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,54 @@ |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% block content %} |
||||
<div class='container-fluid'> |
||||
<div class='row'> |
||||
<div class='a col-xs-12'> |
||||
<h3>Simulating a Yandex "checkOrder" request</h3> |
||||
|
||||
<form action='{% url 'tmp-check-order' %}' method='POST' novalidate> |
||||
<p>action: <input name='action' value='checkOrder'></p> |
||||
<p>md5: <input name='md5' value='8256D2A032A35709EAF156270C9EFE2E'></p> |
||||
<p>shopId: <input name='shopId' value='59838'></p> |
||||
<p>invoiceId: <input name='invoiceId' value='1234567'></p> |
||||
<p>customerNumber: <input name='customerNumber' value='8123294469'></p> |
||||
<p>orderSumAmount: <input name='orderSumAmount' value='87.1'></p> |
||||
<p>orderSumCurrencyPaycash: <input name='orderSumCurrencyPaycash' value='643'></p> |
||||
<p>orderSumBankPaycash: <input name='orderSumBankPaycash' value='1001'></p> |
||||
<p>shopPassword: <input name='shopPassword' value='x1uvmS9Iq8WBE3Oo'></p> |
||||
|
||||
<p>orderNumber: <input name='orderNumber' value='123'></p> |
||||
|
||||
<p><button type='submit'>Simulate check</button></p> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class='row'> |
||||
<div class='b col-xs-12'> |
||||
<h3>Simulating a Yandex "paymentAviso" request</h3> |
||||
|
||||
<form action='{% url 'tmp-payment-aviso' %}' method='POST' novalidate> |
||||
<p>action: <input name='action' value='paymentAviso'></p> |
||||
<p>md5: <input name='md5' value='45125C95A20A7F25B63D58EA304AFED2'></p> |
||||
<p>shopId: <input name='shopId' value='59838'></p> |
||||
<p>invoiceId: <input name='invoiceId' value='1234567'></p> |
||||
<p>customerNumber: <input name='customerNumber' value='8123294469'></p> |
||||
<p>orderSumAmount: <input name='orderSumAmount' value='87.1'></p> |
||||
<p>orderSumCurrencyPaycash: <input name='orderSumCurrencyPaycash' value='643'></p> |
||||
<p>orderSumBankPaycash: <input name='orderSumBankPaycash' value='1001'></p> |
||||
<p>shopPassword: <input name='shopPassword' value='x1uvmS9Iq8WBE3Oo'></p> |
||||
|
||||
<p>orderNumber: <input name='orderNumber' value='123'></p> |
||||
|
||||
<p><button type='submit'>Simulate aviso</button></p> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -1,10 +1,25 @@ |
||||
from django.conf import urls |
||||
from django.conf import urls, settings |
||||
from django.views.generic import TemplateView |
||||
|
||||
from .views import ScoreDetailView, WithDrawCreate |
||||
|
||||
|
||||
app_name = 'wallets' |
||||
|
||||
urlpatterns = [ |
||||
urls.url(r'^score/(?P<pk>\d+)/$', ScoreDetailView.as_view(), name='score-detail'), |
||||
urls.url(r'^withdraw/create/$', WithDrawCreate.as_view(), name='withdraw-create'), |
||||
|
||||
|
||||
urls.url( |
||||
r'^tmp-yamoney-req/$', |
||||
TemplateView.as_view(template_name='tmp_yandex_money_request_example.html'), |
||||
{'YANDEX_MONEY': settings.YANDEX_MONEY}, |
||||
name='tmp-yamoney-req', |
||||
), |
||||
|
||||
urls.url( |
||||
r'^tmp-yamoney-sim/$', |
||||
TemplateView.as_view(template_name='tmp_yandex_money_responses_sumulation.html'), |
||||
name='tmp-yamoney-sim', |
||||
), |
||||
] |
||||
|
||||
Loading…
Reference in new issue