(self, values, incoming=True)
return md5(data_string.encode('utf-8')).hexdigest()
Generate the signature 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 (PayU Latam to
                              Odoo) or outgoing (Odoo to PayU Latam) communication.
        :return: The signature
        :rtype: str
Generate the signature for incoming or outgoing communications.
Generate the signature for incoming or outgoing communications .
def _payulatam_generate_sign(self, values, incoming=True):
        """ Generate the signature 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 (PayU Latam to
                              Odoo) or outgoing (Odoo to PayU Latam) communication.
        :return: The signature
        :rtype: str
        """
        if incoming:
            data_string = '~'.join([
                self.payulatam_api_key,
                self.payulatam_merchant_id,
                values['referenceCode'],
                # http://developers.payulatam.com/en/web_checkout/integration.html
                # Section: 2. Response page > Signature validation
                # PayU Latam use the "Round half to even" rounding method
                # to generate their signature. This happens to be Python 3's
                # default rounding method.
                float_repr(float(values.get('TX_VALUE')), 1),
                values['currency'],
                values.get('transactionState'),
            ])
        else:
            data_string = '~'.join([
                self.payulatam_api_key,
                self.payulatam_merchant_id,
                values['referenceCode'],
                float_repr(float(values['amount']), 1),
                values['currency'],
            ])
        return md5(data_string.encode('utf-8')).hexdigest()
def _payulatam_generate_sign ( self , values , incoming = True ) : if incoming : data_string = '~' . join ( [ self . payulatam_api_key , self . payulatam_merchant_id , values [ 'referenceCode' ] , # http://developers.payulatam.com/en/web_checkout/integration.html # Section: 2. Response page > Signature validation # PayU Latam use the "Round half to even" rounding method # to generate their signature. This happens to be Python 3's # default rounding method. float_repr ( float ( values . get ( 'TX_VALUE' ) ) , 1 ) , values [ 'currency' ] , values . get ( 'transactionState' ) , ] ) else : data_string = '~' . join ( [ self . payulatam_api_key , self . payulatam_merchant_id , values [ 'referenceCode' ] , float_repr ( float ( values [ 'amount' ] ) , 1 ) , values [ 'currency' ] , ] ) return md5 ( data_string . encode ( 'utf-8' ) ) . hexdigest ( )