# Path: payway/qiwi/models.py
# class Bill(ResponsePayment):
# 
# 
#     STATUS = Choices(
#         (50, 'MADE', _('50 Made')),
#         (52, 'PROCESSING', _('52 Processing')),
#         (60, 'PAYED', _('60 Paid')),
#         (150, 'TERMINAL_ERROR', _('150 Cancelled (Terminal error)')),
#         (151, 'MACHINE_ERROR', _('151 Cancelled (authorization error, declined, not enough money on account or something else)')),
#         (160, 'CANCELLED', _('160 Cancelled')),
#         (161, 'TIMEOUT', _('161 Cancelled (Timeout)')),
#     )
#     payment_system = _('Qiwi Wallet')
#     status = models.PositiveSmallIntegerField(_('Status'), choices=STATUS)
#     user = models.CharField(_('User phone number'), max_length=10)
#     date = models.CharField(_('Billing date'), max_length=20)
#     lifetime = models.CharField(_('Bill lifetime'), max_length=20)
# 
#     class Meta:
#         verbose_name = _('bill')
#         verbose_name_plural = _('bills')
#         db_table = 'payway_qiwi_bill'
# 
# Path: payway/qiwi/conf/settings.py
# QIWI_LOGIN = getattr(settings, 'QIWI_LOGIN')
# 
# QIWI_PASSWORD = getattr(settings, 'QIWI_PASSWORD')


import os
import sys
import tornado
    import sys
from threading import Thread
from tornadows import soaphandler, webservices, complextypes
from tornadows.soaphandler import webservice
from django.core.management import setup_environ
    from payway_demo import settings
from payway.qiwi.models import Bill
from payway.qiwi.conf.settings import QIWI_LOGIN, QIWI_PASSWORD
                'amount': amount,
                'comment': comment,
                'txn': txn,
                'lifetime': lifetime,
                'alarm': alarm,
                'create':create,
                'date': BILLING_DATE
        }

        return response

class cancelBill(complextypes.ComplexType):
    login = str
    password = str
    txn = str

class cancelBillResponse(complextypes.ComplexType):
    cancelBillResult = int

class MockCancelBillService(soaphandler.SoapHandler):

    @webservice(_params=cancelBill, _returns=cancelBillResponse)
    def cancelBill(self, request):
        login = request.login
        password = request.password
        txn = request.txn

        response = cancelBillResponse()
        response.cancelBillResult = 0


# Path: payway/qiwi/models.py
# class Bill(ResponsePayment):
# 
# 
#     STATUS = Choices(
#         (50, 'MADE', _('50 Made')),
#         (52, 'PROCESSING', _('52 Processing')),
#         (60, 'PAYED', _('60 Paid')),
#         (150, 'TERMINAL_ERROR', _('150 Cancelled (Terminal error)')),
#         (151, 'MACHINE_ERROR', _('151 Cancelled (authorization error, declined, not enough money on account or something else)')),
#         (160, 'CANCELLED', _('160 Cancelled')),
#         (161, 'TIMEOUT', _('161 Cancelled (Timeout)')),
#     )
#     payment_system = _('Qiwi Wallet')
#     status = models.PositiveSmallIntegerField(_('Status'), choices=STATUS)
#     user = models.CharField(_('User phone number'), max_length=10)
#     date = models.CharField(_('Billing date'), max_length=20)
#     lifetime = models.CharField(_('Bill lifetime'), max_length=20)
# 
#     class Meta:
#         verbose_name = _('bill')
#         verbose_name_plural = _('bills')
#         db_table = 'payway_qiwi_bill'
# 
# Path: payway/qiwi/conf/settings.py
# QIWI_LOGIN = getattr(settings, 'QIWI_LOGIN')
# 
# QIWI_PASSWORD = getattr(settings, 'QIWI_PASSWORD')


# Path: payway/qiwi/tests/mock_provider.py
import os
import sys
import tornado
    import sys
from threading import Thread
from tornadows import soaphandler, webservices, complextypes
from tornadows.soaphandler import webservice
from django.core.management import setup_environ
    from payway_demo import settings
from payway.qiwi.models import Bill
from payway.qiwi.conf.settings import QIWI_LOGIN, QIWI_PASSWORD

                'amount': amount,
                'comment': comment,
                'txn': txn,
                'lifetime': lifetime,
                'alarm': alarm,
                'create':create,
                'date': BILLING_DATE
        }

        return response

class cancelBill(complextypes.ComplexType):
    login = str
    password = str
    txn = str

class cancelBillResponse(complextypes.ComplexType):
    cancelBillResult = int

class MockCancelBillService(soaphandler.SoapHandler):

    @webservice(_params=cancelBill, _returns=cancelBillResponse)
    def cancelBill(self, request):
        login = request.login
        password = request.password
        txn = request.txn

        response = cancelBillResponse()
        response.cancelBillResult = 0


        if not all([login==QIWI_LOGIN, password==QIWI_PASSWORD]):