Esempio n. 1
0
    def on_payment_status_change(p24_session_id, p24_order_id, p24_kwota, p24_order_id_full, p24_crc):
        params = {
            "p24_session_id": p24_session_id,
            "p24_order_id": p24_order_id,
            "p24_kwota": p24_kwota,
            "p24_order_id_full": p24_order_id_full,
            "p24_crc": p24_crc,
        }
        crc = PaymentProcessor.get_backend_setting("crc")
        if p24_crc != PaymentProcessor.compute_sig(params, PaymentProcessor._SUCCESS_RETURN_SIG_FIELDS, crc):
            logger.warning("Success return call has wrong crc %s" % str(params))
            return False

        payment_id = p24_session_id.split(":")[0]
        get_payment_status_task.delay(payment_id, p24_session_id, p24_order_id, p24_kwota)
        return True
Esempio n. 2
0
    def on_payment_status_change(p24_session_id, p24_order_id, p24_kwota, p24_order_id_full, p24_crc):
        params = {
            'p24_session_id': p24_session_id,
            'p24_order_id': p24_order_id,
            'p24_kwota': p24_kwota,
            'p24_order_id_full': p24_order_id_full,
            'p24_crc': p24_crc,
        }
        crc = PaymentProcessor.get_backend_setting('crc')
        if p24_crc != PaymentProcessor.compute_sig(params, PaymentProcessor._SUCCESS_RETURN_SIG_FIELDS,
                                                   crc):
            logger.warning('Success return call has wrong crc %s' % str(params))
            return False

        payment_id = p24_session_id.split(':')[0]
        get_payment_status_task.delay(payment_id, p24_session_id, p24_order_id, p24_kwota)
        return True
Esempio n. 3
0
    def on_payment_status_change(p24_session_id, p24_order_id, p24_amount,
                                 p24_currency, p24_sign):
        params = {
            'p24_session_id': p24_session_id,
            'p24_order_id': p24_order_id,
            'p24_amount': p24_amount,
            'p24_currency': p24_currency,
            'p24_sign': p24_sign,
        }
        crc = PaymentProcessor.get_backend_setting('crc')
        if p24_sign != PaymentProcessor.compute_sig(
            params, PaymentProcessor._STATUS_SIG_FIELDS, crc):
            logger.warning('Status view call has wrong crc %s' % str(params))
            return False

        payment_id = p24_session_id.split(':')[0]
        get_payment_status_task.delay(
            payment_id, p24_session_id, p24_amount, p24_currency, p24_order_id)
        return True