Exemple #1
0
    def post(self, request, *args, **kwargs):
        try:
            p24_session_id = request.POST['p24_session_id']
            p24_order_id = request.POST['p24_order_id']
            p24_kwota = request.POST['p24_kwota']
            p24_order_id_full = request.POST['p24_order_id_full']
            p24_crc = request.POST['p24_crc']
        except KeyError:
            logger.warning('Got malformed POST request: %s' % str(request.POST))
            return HttpResponse('MALFORMED', status=500)

        PaymentProcessor.on_payment_status_change(p24_session_id, p24_order_id, p24_kwota, p24_order_id_full, p24_crc)

        self.object = self.get_object()
        context = self.get_context_data(object=self.object)
        return self.render_to_response(context)
Exemple #2
0
    def post(self, request, *args, **kwargs):
        try:
            p24_session_id = request.POST['p24_session_id']
            p24_order_id = request.POST['p24_order_id']
            p24_kwota = request.POST['p24_kwota']
            p24_order_id_full = request.POST['p24_order_id_full']
            p24_crc = request.POST['p24_crc']
        except KeyError:
            logger.warning('Got malformed POST request: %s' % str(request.POST))
            return http.HttpResponseBadRequest('MALFORMED')

        PaymentProcessor.on_payment_status_change(p24_session_id, p24_order_id, p24_kwota, p24_order_id_full, p24_crc)

        self.object = self.get_object()
        context = self.get_context_data(object=self.object)
        return self.render_to_response(context)
Exemple #3
0
    def post(self, request, *args, **kwargs):
        request_ip = request.META.get('HTTP_X_FORWARDED_FOR')
        if not request_ip:
            request_ip = request.META.get('REMOTE_ADDR')
        allowed_ips = PaymentProcessor.get_backend_setting(
            'allowed_ips', '') or PaymentProcessor.ALLOWED_IP_LIST
        if request_ip not in allowed_ips:
            return HttpResponseForbidden()
        try:
            logger.debug(u"POST data: %s" % request.POST)
            p24_session_id = request.POST['p24_session_id']
            p24_order_id = request.POST['p24_order_id']
            p24_amount = request.POST['p24_amount']
            p24_currency = request.POST['p24_currency']
            p24_sign = request.POST['p24_sign']
        except KeyError:
            logger.warning('Got malformed POST request: %s' %
                           str(request.POST))
            return HttpResponse('MALFORMED', status=500)

        if PaymentProcessor.on_payment_status_change(p24_session_id,
                                                     p24_order_id, p24_amount,
                                                     p24_currency, p24_sign):
            return HttpResponse('OK')
        else:
            return HttpResponse('CRC ERR')
Exemple #4
0
    def post(self, request, *args, **kwargs):
        request_ip = request.META.get('HTTP_X_FORWARDED_FOR')
        if not request_ip:
            request_ip = request.META.get('REMOTE_ADDR')
        allowed_ips = PaymentProcessor.get_backend_setting(
            'allowed_ips', '') or PaymentProcessor.ALLOWED_IP_LIST
        if request_ip not in allowed_ips:
            return HttpResponseForbidden()
        try:
            logger.debug(u"POST data: %s" % request.POST)
            p24_session_id = request.POST['p24_session_id']
            p24_order_id = request.POST['p24_order_id']
            p24_amount = request.POST['p24_amount']
            p24_currency = request.POST['p24_currency']
            p24_sign = request.POST['p24_sign']
        except KeyError:
            logger.warning(
                'Got malformed POST request: %s' % str(request.POST))
            return HttpResponse('MALFORMED', status=500)

        if PaymentProcessor.on_payment_status_change(
                p24_session_id, p24_order_id, p24_amount, p24_currency,
                p24_sign):
            return HttpResponse('OK')
        else:
            return HttpResponse('CRC ERR')
Exemple #5
0
    def post(self, request, *args, **kwargs):
        try:
            p24_session_id = request.POST['p24_session_id']
            p24_order_id = request.POST['p24_order_id']
            p24_kwota = request.POST['p24_kwota']
            p24_order_id_full = request.POST['p24_order_id_full']
            p24_crc = request.POST['p24_crc']
        except KeyError:
            logger.warning('Got malformed POST request: %s' % str(request.POST))
            return HttpResponse('MALFORMED', status=500)

        if PaymentProcessor.on_payment_status_change(p24_session_id, p24_order_id, p24_kwota, p24_order_id_full,
                                                     p24_crc):
            return HttpResponse('OK')
        else:
            return HttpResponse('CRC ERR')
Exemple #6
0
    def post(self, request, *args, **kwargs):
        try:
            p24_session_id = request.POST['p24_session_id']
            p24_order_id = request.POST['p24_order_id']
            p24_kwota = request.POST['p24_kwota']
            p24_order_id_full = request.POST['p24_order_id_full']
            p24_crc = request.POST['p24_crc']
        except KeyError:
            logger.warning('Got malformed POST request: %s' % str(request.POST))
            return http.HttpResponseBadRequest('MALFORMED')

        if PaymentProcessor.on_payment_status_change(p24_session_id, p24_order_id, p24_kwota, p24_order_id_full,
                                                     p24_crc):
            return http.HttpResponse('OK')
        else:
            return http.HttpResponseBadRequest('CRC ERR')