# Path: payway/merchants/models.py
# class Merchant(RandomUIDAbstractModel):
# 
#     URL_METHODS = Choices(
#         ('POST', 'POST'),
#         ('GET',  'GET'),
#     )
# 
#     user = models.ForeignKey(User, related_name='merchants', verbose_name=_('user'))
#     name = models.CharField('Имя', max_length=255)
#     secret_key = models.CharField(_('secret key'), max_length=50)
# 
#     result_url = models.URLField(_('result url'))
#     result_url_method = models.CharField(_('result url method'), max_length=4, choices=URL_METHODS)
# 
#     success_url = models.URLField(_('success url'))
#     fail_url = models.URLField(_('fail url'))
# 
#     class Meta:
#         verbose_name = 'продавец'
#         verbose_name_plural = 'продавцы'
#         db_table = 'payway_merchants'


import logging
from model_utils import Choices
from simptools.wrappers.http import HttpClient, HttpRequest
from requests.exceptions import ConnectionError
from payway.merchants.models import Merchant
        self.order = order

        if self.merchant.result_url_method == Merchant.URL_METHODS.GET:
            self.__set_GET()
        else:
            self.__set_POST()

    def __set_POST(self, *args, **kwargs):
        self.POST = self.__request()

    def __set_GET(self, *args, **kwargs):
        self.GET = self.__request()

    def __request(self):
        return {
            'url': self.merchant.result_url,
            'data': {
                'uid': self.order.uid,
                'is_paid': self.order.is_paid,
                'sum': self.order.sum.amount,
                'sum_currency': self.order.sum_currency,
                'description': self.order.description,
            }
        }

class MerchantHttpClient(HttpClient):

    @classmethod
    def notify(cls, merchant, order):
        result = ''

# Path: payway/merchants/models.py
# class Merchant(RandomUIDAbstractModel):
# 
#     URL_METHODS = Choices(
#         ('POST', 'POST'),
#         ('GET',  'GET'),
#     )
# 
#     user = models.ForeignKey(User, related_name='merchants', verbose_name=_('user'))
#     name = models.CharField('Имя', max_length=255)
#     secret_key = models.CharField(_('secret key'), max_length=50)
# 
#     result_url = models.URLField(_('result url'))
#     result_url_method = models.CharField(_('result url method'), max_length=4, choices=URL_METHODS)
# 
#     success_url = models.URLField(_('success url'))
#     fail_url = models.URLField(_('fail url'))
# 
#     class Meta:
#         verbose_name = 'продавец'
#         verbose_name_plural = 'продавцы'
#         db_table = 'payway_merchants'


# Path: payway/merchants/http.py
import logging
from model_utils import Choices
from simptools.wrappers.http import HttpClient, HttpRequest
from requests.exceptions import ConnectionError
from payway.merchants.models import Merchant

        self.order = order

        if self.merchant.result_url_method == Merchant.URL_METHODS.GET:
            self.__set_GET()
        else:
            self.__set_POST()

    def __set_POST(self, *args, **kwargs):
        self.POST = self.__request()

    def __set_GET(self, *args, **kwargs):
        self.GET = self.__request()

    def __request(self):
        return {
            'url': self.merchant.result_url,
            'data': {
                'uid': self.order.uid,
                'is_paid': self.order.is_paid,
                'sum': self.order.sum.amount,
                'sum_currency': self.order.sum_currency,
                'description': self.order.description,
            }
        }

class MerchantHttpClient(HttpClient):

    @classmethod
    def notify(cls, merchant, order):
        result = ''

        try: