def METHOD_NAME(self, provider, data):
    """Given a data dict coming from redsys, verify it and
    find the related transaction record."""
    tx = super().METHOD_NAME(provider, data)
    if provider != "redsys":
        return tx
    parameters = data.get("Ds_MerchantParameters", "")
    parameters_dic = json.loads(base64.b64decode(parameters).decode())
    reference = urllib.parse.unquote(parameters_dic.get("Ds_Order", ""))
    pay_id = parameters_dic.get("Ds_AuthorisationCode")
    shasign = data.get("Ds_Signature", "").replace("_", "/").replace("-", "+")
    test_env = config["test_enable"]
    if not reference or not pay_id or not shasign:
        error_msg = (
            "Redsys: received data with missing reference"
            " (%s) or pay_id (%s) or shashign (%s)" % (reference, pay_id, shasign)
        )
        if not test_env:
            _logger.info(error_msg)
            raise ValidationError(error_msg)
    tx = self.search([("reference", "=", reference)])
    if not tx or len(tx) > 1:
        error_msg = "Redsys: received data for reference %s" % (reference)
        if not tx:
            error_msg += "; no order found"
        else:
            error_msg += "; multiple order found"
        _logger.info(error_msg)
        raise ValidationError(error_msg)
    if tx and not test_env:
        # verify shasign
        shasign_check = tx.provider_id.sign_parameters(
            tx.provider_id.redsys_secret_key, parameters
        )
        if shasign_check != shasign:
            error_msg = (
                "Redsys: invalid shasign, received %s, computed %s, "
                "for data %s" % (shasign, shasign_check, data)
            )
            _logger.info(error_msg)
            raise ValidationError(error_msg)
    return tx