Advertisement
Guest User

OfxPy SiteClientUID Patch

a guest
Feb 11th, 2016
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.06 KB | None | 0 0
  1. --- OfxPy/orig/ofx.py   Wed Feb 11 10:07:36 2015
  2. +++ OfxPy/ofx.py    Thu Feb 11 23:37:36 2016
  3. @@ -86,7 +86,14 @@
  4.          clientuid=""
  5.          if "103" in self.ofxver:
  6.              #include clientuid field only if version=103, otherwise the server may reject the request
  7. -            clientuid = OfxField("CLIENTUID",userdat.clientuid)
  8. +
  9. +            # if a site-level clientUID is defined, use it, otherwise default to global clientUID
  10. +            clientuidval = userdat.clientuid
  11. +            if FieldVal(site,"siteClientUID") <> '':
  12. +                clientuidval = FieldVal(site,"siteClientUID")
  13. +
  14. +            clientuid = OfxField("CLIENTUID",clientuidval)
  15. +            print "using ClientUID of: ", clientuidval
  16.          
  17.          fidata = [OfxField("ORG",FieldVal(site,"fiorg"))]
  18.          fidata += [OfxField("FID",FieldVal(site,"fid"))]
  19.  
  20. --- OfxPy/orig/site_cfg.py  Wed Feb 19 20:51:56 2014
  21. +++ OfxPy/site_cfg.py   Thu Feb 11 23:11:21 2016
  22. @@ -142,6 +142,7 @@
  23.                  bankid=''
  24.                  brokerid=''
  25.                  ofxver = '102'
  26. +                siteClientUID = ''
  27.                  appid  = DefaultAppID       #defined in control2.py
  28.                  appver = DefaultAppVer
  29.                  mininterval = 0
  30. @@ -161,6 +162,7 @@
  31.                               'BANKID': bankid,
  32.                             'BROKERID': brokerid,
  33.                               'OFXVER': ofxver,
  34. +                      'SITECLIENTUID': siteClientUID,
  35.                                'APPID': appid,
  36.                               'APPVER': appver,
  37.                          'MININTERVAL': mininterval,
  38. @@ -181,6 +183,7 @@
  39.                      elif field == 'BANKID': bankid = value
  40.                      elif field == 'BROKERID': brokerid = value
  41.                      elif field == 'OFXVER': ofxver = value
  42. +                    elif field == 'SITECLIENTUID': siteClientUID = value
  43.                      elif field == 'APPID': appid = value
  44.                      elif field == 'APPVER': appver = value
  45.                      elif field == 'MININTERVAL': mininterval = int(value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement