def call_back(request, param):
# Testnet
method='GET'
x_signature = request.headers.get('X-Signature')
print(siri)
request_uri_encoded = str(request).splitlines()[0].split()[1]
request_uri = urllib.parse.unquote(request_uri_encoded)
constant_digest = hashlib.sha512('').digest() # [207, 131, 225, 53, 126,.........., 249, 39, 218, 62]
requestt = method+request_uri+constant_digest
raw_signature =
hmac.new(secret, requestt, hashlib.sha512)
b64_signature = base64.b64encode(raw_signature.digest())
print('request_uri_encoded: ', request_uri_encoded)
print('request_uri: ', request_uri)
print('x_signature: ', x_signature)
print('b64_signature: ', b64_signature)
if (x_signature == b64_signature): # IT PRINTS ERROR
print('SUCCESS')
else:
print('ERROR')
But this callback function dont get to run. The API is to issue a GET http request to the url specified as my callback url.
And in my urls.py i have this pattern
url(r'^callback/(?P<param>[-\w]+)/$', call_back, name='callback'),
But i dont seem to get why the callback function refuses to run even though from my command line i see that the webservice
keeps issuing a GET callback request. Here is what the GET request shows in my command
[11/Nov/2017 03:23:17] "GET /callback/blue-cap?order_id=204199&amount=4570384&amount_in_btc=
0.04570384&amount_paid_in_btc=0.04570384&status=2&address=muAYN5HZBN4VfvmVhZhTnm7yBN33JQ3JGD&tid=9a5327bb9efa3b2be285c8a47222d6c89a95fd2d3e10c7c4707974c0c52e7e57&
transaction_ids=[%229a5327bb9efa3b2be285c8a47222d6c89a95fd2d3e10c7c4707974c0c52e7e57%22]&keychain_id=2&last_keychain_id=1&after_payment_redirect_to=
Any help please !!!!