Skip to content

Commit 83e95de

Browse files
Update verify_pin
1 parent 90c33aa commit 83e95de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pysrc/mixin_bot_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def gen_post_jwt_token(self, uristring, bodystring, jti):
8686
jwtSig = self.genPOSTSig(uristring, bodystring)
8787
iat = datetime.datetime.utcnow()
8888
exp = datetime.datetime.utcnow() + datetime.timedelta(seconds=200)
89-
encoded = jwt.encode({'uid':self.client_id, 'sid':self.pay_session_id,'iat':iat,'exp': exp, 'jti':jti,'sig':jwtSig}, self.private_key, algorithm=self.algorithm)
89+
encoded = jwt.encode({'uid':self.client_id, 'sid':self.pay_session_id,'iat':iat,'exp': exp, 'jti':jti,'sig':jwtSig, "scp": "FULL"}, self.private_key, algorithm=self.algorithm)
9090
return encoded
9191

9292
def gen_encrypted_pin(self, iterString = None):
@@ -168,7 +168,7 @@ async def __genNetworkPostRequest(self, path, body, auth_token=""):
168168
if isinstance(body, (dict, list)):
169169
body = json.dumps(body)
170170
# generate robot's auth token
171-
if auth_token == "":
171+
if not auth_token:
172172
auth_token = self.gen_post_jwt_token(path, body, str(uuid.uuid4()))
173173
headers = {
174174
'Content-Type' : 'application/json',
@@ -407,7 +407,8 @@ async def verify_pin(self, auth_token=""):
407407
"""
408408
enPin = self.gen_encrypted_pin()
409409
body = {
410-
"pin": enPin
410+
"pin_base64": enPin,
411+
'timestamp': int(time.time()*1e9)
411412
}
412413

413414
return await self.__genNetworkPostRequest('/pin/verify', body, auth_token)

0 commit comments

Comments
 (0)