This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
django-yandex-kassa
===================

`Документация <https: money.yandex.ru="" doc.xml?id="527069">`_ по интеграции


Оформление документов
---------------------

#. Идем на `kassa.yandex.ru <https: kassa.yandex.ru="">`_

#. Регистрируемся

#. Созваниваемся с сапортом, отправляем сканы, получаем SCID & ShopID

Отдельно нужно договариваться (писать прошение, подавать доп. пакет документов) на прием платежей через

* Сбер, т.к. он не умеет делать возврат и, вообще, особенный;
* мобильные платежи: на момент написания документации для подключения 'ого способа оплаты сайт должен был иметь оборотку более 30тр в месяц +процент для каждого оператора оговаривается отдельно;
* QiWi;
* MasterPass.


Установка
---------

#. Установить пакет:

.. code:: sh

pip install django-yandex-kassa

#. Добавить ``yandex_kassa`` в ``settings.INSTALLED_APPS``:

.. code:: python

INSTALLED_APPS = (
...
'yandex_kassa',
...
)

#. Выполнить синхронизацию с БД:

.. code:: sh

python manage.py syncdb

#. Добавить в ``urls.py``:

.. code:: python

urlpatterns = patterns('',
# ...
url(r'^kassa/', include('yandex_kassa.urls')),
)

#. Указать в settings следующие параметры:

.. code:: python
YANDEX_KASSA_DEBUG = False
YANDEX_KASSA_SCID = 123123
YANDEX_KASSA_SHOP_ID = 123123
YANDEX_KASSA_SHOP_PASSWORD = 'password'

YANDEX_KASSA_DISPLAY_FIELDS = ['paymentType', 'cps_email', 'cps_phone']

YANDEX_KASSA_CALLBACK_URL = '/kassa/callback/'
YANDEX_KASSA_FAIL_URL = '/kassa/fail/'
YANDEX_KASSA_SUCCESS_URL = '/kassa/success/'

YANDEX_KASSA_PAYMENT_TYPE = ['ab', 'ac', 'gp', 'pb', 'pc', 'wm']


#. Указать в рабочем Яндекс Кассы кабинете натсрйоки для приема уведомлений:

* paymentAvisoURL: https://example.com/kassa/payment-aviso/
* checkURL: https://example.com/kassa/order-check/
* failURL: https://example.com/kassa/fail/
* successURL: https://example.com/kassa/success/


Использование
-------------

`Полный пример использования <https: github.com="" drmartiner="" django-yandex-kassa="" tree="" master="" demo="">`_

#. Реализуйте представление и модель товара и заказа:

.. code:: python

# -*- coding: utf-8 -*-

# ...

class HomeView(TemplateView):
template_name = 'home.html'

def get_context_data(self, **kwargs):
count = randint(1, 3)
item = Item.objects.all().order_by('?').first()
amount = count * item.price

payment = Payment(order_amount=amount)
payment.save()

order = Order(item=item, count=count,
amount=amount, payment=payment)
order.save()

ctx = super(HomeView, self).get_context_data(**kwargs)
ctx['order'] = order
ctx['form'] = PaymentForm(initial=dict(orderNumber=order.uuid, sum=amount,
customerNumber=payment.customer_number))
return ctx

.. code:: python

# -*- coding: utf-8 -*-

# ...

class Item(models.Model):
name = models.CharField('Наименование', max_length=32)
price = models.PositiveIntegerField('Стоимость')

def __unicode__(self):
return truncatechars(self.name, 16)

class Meta:
verbose_name = 'Товар'
verbose_name_plural = 'Товары'


class Order(models.Model):
uuid = models.CharField('ID заказа', max_length=64,
default=get_uuid, primary_key=True)
item = models.ForeignKey('app.Item', verbose_name='Товар')
count = models.PositiveIntegerField('Кол-во', default=1)
payment = models.ForeignKey('yandex_kassa.Payment',
verbose_name='Платеж')
amount = models.PositiveIntegerField('Сумма заказа')

class Meta:
verbose_name = 'Заказ'
verbose_name_plural = 'Заказы'


#. Шаблон платежной формы:

.. code:: html

<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<form action="{{ form.target }}" <br=""> method="post" class="form" name="ShopForm" id="payment_form_id">
{% bootstrap_form form %}

{% buttons %}
<button type="submit" class="btn btn-success">
{% bootstrap_icon "shopping-cart" %}
Оплатить "{{ order.item.name }}" x{{ order.count }} шт
</button>
{% endbuttons %}
</form>
</div>

Release History

Release History

0.9.12

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.11

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.10

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.9.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-yandex-kassa-0.9.12.tar.gz (16.0 kB) Copy SHA256 Checksum SHA256 Source Jan 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting