(self, values, incoming=True)
return hashlib.sha512(sign.encode('utf-8')).hexdigest()
Generate the shasign for incoming or outgoing communications.

        :param dict values: The values used to generate the signature
        :param bool incoming: Whether the signature must be generated for an incoming (PayUmoney to
                              Odoo) or outgoing (Odoo to PayUMoney) communication.
        :return: The shasign
        :rtype: str
Generate the shasign for incoming or outgoing communications.
Generate the shasign for incoming or outgoing communications .
def _payumoney_generate_sign(self, values, incoming=True):
        """ Generate the shasign for incoming or outgoing communications.

        :param dict values: The values used to generate the signature
        :param bool incoming: Whether the signature must be generated for an incoming (PayUmoney to
                              Odoo) or outgoing (Odoo to PayUMoney) communication.
        :return: The shasign
        :rtype: str
        """
        sign_values = {
            **values,
            'key': self.payumoney_merchant_key,
            'salt': self.payumoney_merchant_salt,
        }
        if incoming:
            keys = 'salt|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|' \
                   'txnid|key'
            sign = '|'.join(f'{sign_values.get(k) or ""}' for k in keys.split('|'))
        else:  # outgoing
            keys = 'key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||salt'
            sign = '|'.join(f'{sign_values.get(k) or ""}' for k in keys.split('|'))
        return hashlib.sha512(sign.encode('utf-8')).hexdigest()
def _payumoney_generate_sign ( self , values , incoming = True ) : sign_values = { * * values , 'key' : self . payumoney_merchant_key , 'salt' : self . payumoney_merchant_salt , } if incoming : keys = 'salt|status||||||udf5|udf4|udf3|udf2|udf1|email|firstname|productinfo|amount|' 'txnid|key' sign = '|' . join ( f'{sign_values.get(k) or ""}' for k in keys . split ( '|' ) ) else : # outgoing keys = 'key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||salt' sign = '|' . join ( f'{sign_values.get(k) or ""}' for k in keys . split ( '|' ) ) return hashlib . sha512 ( sign . encode ( 'utf-8' ) ) . hexdigest ( )