Dolda2000 GitWeb
/
fulbank.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsb: Added support for OUTSTANDING_TRANSACTION bankid status.
[fulbank.git]
/
fulbank
/
fsb.py
diff --git
a/fulbank/fsb.py
b/fulbank/fsb.py
index
4a91278
..
44a4849
100644
(file)
--- a/
fulbank/fsb.py
+++ b/
fulbank/fsb.py
@@
-11,7
+11,7
@@
serviceid = "B7dZHQcY78VRVz9l"
class fmterror(Exception):
pass
class fmterror(Exception):
pass
-class autherror(
Exception
):
+class autherror(
auth.autherror
):
pass
class jsonerror(Exception):
pass
class jsonerror(Exception):
@@
-243,14
+243,10
@@
class session(object):
if resolve(fld, ("field",), None) == "userId":
raise autherror(fld["message"])
raise
if resolve(fld, ("field",), None) == "userId":
raise autherror(fld["message"])
raise
- if data.get("status") != "USER_SIGN":
- raise fmterror("unexpected bankid status: " + str(data.get("status")))
+ st = data.get("status")
vfy = linkurl(resolve(data, ("links", "next", "uri")))
fst = None
while True:
vfy = linkurl(resolve(data, ("links", "next", "uri")))
fst = None
while True:
- time.sleep(3)
- vdat = self._jreq(vfy)
- st = vdat.get("status")
if st in {"USER_SIGN", "CLIENT_NOT_STARTED"}:
if st != fst:
conv.message("Status: %s" % (st,), auth.conv.msg_info)
if st in {"USER_SIGN", "CLIENT_NOT_STARTED"}:
if st != fst:
conv.message("Status: %s" % (st,), auth.conv.msg_info)
@@
-261,8
+257,13
@@
class session(object):
return
elif st == "CANCELLED":
raise autherror("authentication cancelled")
return
elif st == "CANCELLED":
raise autherror("authentication cancelled")
+ elif st == "OUTSTANDING_TRANSACTION":
+ raise autherror("another bankid transaction already in progress")
else:
raise fmterror("unexpected bankid status: " + str(st))
else:
raise fmterror("unexpected bankid status: " + str(st))
+ time.sleep(3)
+ vdat = self._jreq(vfy)
+ st = vdat.get("status")
def keepalive(self):
data = self._jreq("v5/framework/clientsession")
def keepalive(self):
data = self._jreq("v5/framework/clientsession")