registerups.py: cosmetic changes

This commit is contained in:
Sergey Morozov 2019-08-26 13:23:35 +03:00
parent c2750889e1
commit 34fc66d20e
1 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,12 @@ class cps_ups:
'" bid="' + self.bank_id + \
'"/>'
digest = hmac.new(self.secret_key.encode(), msg = data_tag.encode('utf-8')).hexdigest().upper()
xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><setup>' + data_tag + '<auth code="' + digest + '"/></setup>'
xml = '<?xml version="1.0" ' \
'encoding="UTF-8" ' \
'standalone="yes"?>' \
'<setup>' + data_tag + \
'<auth code="' + digest + \
'"/></setup>'
return(xml)
def register(self,
ip_address,