Advertisement
Guest User

Untitled

a guest
Sep 26th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #Preparing Data
  2. username = 'regalo.trust'
  3. timestamp = time.strftime('%Y%m%d%H%M%S')
  4. amount = abs(int(amount))
  5. withdrawcharge = 1
  6. reason = " "
  7. phone_number = int('25' + phone_number)
  8. epoch_time = int(time.time())
  9. transaction_id =int(str(epoch_time) + str(phone_number))
  10.  
  11. partnerpassword = os.environ.get('partnerpassword', '')
  12. accountno = os.environ.get("account_no", '')
  13.  
  14.  
  15.  
  16. password = hashlib.sha256((username+accountno+partnerpassword+timestamp).encode('utf-8')).hexdigest()
  17.  
  18. data = {
  19. 'username':username,
  20. 'timestamp': timestamp,
  21. 'amount': amount,
  22. 'withdrawcharge': 1,
  23. 'reason': reason,
  24. 'password':password,
  25. 'mobilephone': phone_number,
  26. 'requesttransactionid': transaction_id
  27. }
  28.  
  29. response=requests.post('https://www.intouchpay.co.rw/api/requestdeposit/', data=data)
  30. print("########## withdraw response: ",response.json())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement