Esempio n. 1
0
 def decode_callback(self, data, signature):
     """
     https://www.liqpay.com/en/doc/callback
     :param data: function result base64.b64encode(json_string)
     :param signature: function result base64.b64encode(hashlib.sha1(private_key + data + private_key))
     """
     return decode_response_data(self.private_key, data, signature)
Esempio n. 2
0
 def decode_callback(self, data, signature):
     """
     https://www.liqpay.com/en/doc/callback
     :param data: function result base64.b64encode(json_string)
     :param signature: function result base64.b64encode(hashlib.sha1(private_key + data + private_key))
     """
     return decode_response_data(self.private_key, data, signature)
Esempio n. 3
0
    def test_response_decoder(self):
        data = dict(field='value')
        encoded = encode_data(data)
        signature = generate_signature(self.private_key, encoded)

        decoded = decode_response_data(self.private_key, encoded, signature)
        self.assertEqual(data, decoded)
        self.assertRaises(SignatureMismatch, decode_response_data, self.private_key, encoded, 'privateKey2')
Esempio n. 4
0
    def test_response_decoder(self):
        data = dict(field='value')
        encoded = encode_data(data)
        signature = generate_signature(self.private_key, encoded)

        decoded = decode_response_data(self.private_key, encoded, signature)
        self.assertEqual(data, decoded)
        self.assertRaises(SignatureMismatch, decode_response_data,
                          self.private_key, encoded, 'privateKey2')