Beispiel #1
0
 def _ccreq(self, acctid, dtstart):
     req = tag('CCSTMTRQ',
         tag('CCACCTFROM',field('ACCTID',acctid)),
         tag('INCTRAN',
         field('DTSTART',dtstart),
         field('INCLUDE','Y')))
     return self._message('CREDITCARD','CCSTMT',req)
Beispiel #2
0
 def _bareq(self, acctid, routing_number, dtstart, accttype):
     config = self.config
     req = tag(
         'STMTRQ',
         tag('BANKACCTFROM', field('BANKID', str(routing_number)),
             field('ACCTID', acctid), field('ACCTTYPE', accttype)),
         tag('INCTRAN', field('DTSTART', dtstart), field('INCLUDE', 'Y')))
     return self._message('BANK', 'STMT', req)
Beispiel #3
0
 def _message(self, msgType, trnType, request):
     return tag(
         msgType + 'MSGSRQV1',
         tag(
             trnType + 'TRNRQ',
             field('TRNUID', _genuuid()),
             field('CLTCOOKIE', self._cookie()),  # what is cookie used for?
             request))
Beispiel #4
0
 def _invstreq(self, brokerid, acctid, dtstart):
     dtnow = time.strftime('%Y%m%d%H%M%S', time.localtime())
     req = tag(
         'INVSTMTRQ',
         tag('INVACCTFROM', field('BROKERID', brokerid),
             field('ACCTID', acctid)),
         tag('INCTRAN', field('DTSTART', dtstart), field('INCLUDE', 'Y')),
         field('INCOO', 'Y'),
         tag('INCPOS', field('DTASOF', dtnow), field('INCLUDE', 'Y')),
         field('INCBAL', 'Y'))
     return self._message('INVSTMT', 'INVSTMT', req)
Beispiel #5
0
 def _bareq(self, acctid,routing_number,  dtstart, accttype):
     config=self.config
     req = tag('STMTRQ',
         tag('BANKACCTFROM',
             field('BANKID', str(routing_number)),
                 field('ACCTID',acctid),
             field('ACCTTYPE',accttype)),
         tag('INCTRAN',
             field('DTSTART',dtstart),
             field('INCLUDE','Y')))
     return self._message('BANK','STMT',req)
Beispiel #6
0
 def _invstreq(self, brokerid, acctid, dtstart):
     dtnow = time.strftime('%Y%m%d%H%M%S',time.localtime())
     req = tag('INVSTMTRQ',
                tag('INVACCTFROM',
                   field('BROKERID', brokerid),
                   field('ACCTID',acctid)),
                tag('INCTRAN',
                     field('DTSTART',dtstart),
                     field('INCLUDE','Y')),
                field('INCOO','Y'),
                tag('INCPOS',
                     field('DTASOF', dtnow),
                     field('INCLUDE','Y')),
                field('INCBAL','Y'))
     return self._message('INVSTMT','INVSTMT',req)
Beispiel #7
0
 def _signOn(self):
     config = self.config
     fidata = [ field('ORG',config['fiorg']) ]
     if config.has_key('fid'):
         fidata += [ field('FID',config['fid']) ]
     return tag('SIGNONMSGSRQV1',
                 tag('SONRQ',
                      field('DTCLIENT',_date()),
                      field('USERID',config['user']),
                      field('USERPASS',config['password']),
                      field('LANGUAGE','ENG'),
                      tag('FI', *fidata),
                      field('APPID',config['appid']),
                      field('APPVER',config['appver']),
                      ))
Beispiel #8
0
 def _bankQuery(self, acctid, routing_number, dtstart, accttype):
     '''Bank account statement request'''
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(),
             self._bareq(acctid, routing_number, dtstart, accttype))
     ])
Beispiel #9
0
 def _signOn(self):
     config = self.config
     fidata = [field('ORG', config['fiorg'])]
     if config.has_key('fid'):
         fidata += [field('FID', config['fid'])]
     return tag(
         'SIGNONMSGSRQV1',
         tag(
             'SONRQ',
             field('DTCLIENT', _date()),
             field('USERID', config['user']),
             field('USERPASS', config['password']),
             field('LANGUAGE', 'ENG'),
             tag('FI', *fidata),
             field('APPID', config['appid']),
             field('APPVER', config['appver']),
         ))
Beispiel #10
0
 def _message(self,msgType,trnType,request):
     return tag(msgType+'MSGSRQV1',
                 tag(trnType+'TRNRQ',
                      field('TRNUID',_genuuid()),
                      field('CLTCOOKIE',self._cookie()), # what is cookie used for?
                      request))
Beispiel #11
0
 def _ccQuery(self, acctid, dtstart):
     '''CC Statement request'''
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(), self._ccreq(acctid, dtstart))
     ])
Beispiel #12
0
 def _acctQuery(self, dtstart):
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(), self._acctreq(dtstart))
     ])
Beispiel #13
0
 def _acctreq(self, dtstart):
     req = tag('ACCTINFORQ',field('DTACCTUP',dtstart))
     return self._message('SIGNUP','ACCTINFO',req)
Beispiel #14
0
 def _invstQuery(self, brokerid, acctid, dtstart):
     return join('\r\n',[self._header(),
                       tag('OFX',
                            self._signOn(),
                            self._invstreq(brokerid, acctid,dtstart))])
Beispiel #15
0
 def _acctQuery(self,dtstart):
     return join('\r\n',[self._header(),
                       tag('OFX',
                           self._signOn(),
                            self._acctreq(dtstart))])
Beispiel #16
0
 def _ccQuery(self, acctid, dtstart):
     '''CC Statement request'''
     return join('\r\n',[self._header(),
                       tag('OFX',
                            self._signOn(),
                            self._ccreq(acctid, dtstart))])
Beispiel #17
0
 def _bankQuery(self, acctid, routing_number, dtstart, accttype):
     '''Bank account statement request'''
     return join('\r\n',[self._header(),
                         tag('OFX',
                             self._signOn(),
                             self._bareq(acctid, routing_number, dtstart, accttype))])
Beispiel #18
0
 def _invstQuery(self, brokerid, acctid, dtstart):
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(), self._invstreq(brokerid, acctid,
                                                   dtstart))
     ])
Beispiel #19
0
 def _ccreq(self, acctid, dtstart):
     req = tag(
         'CCSTMTRQ', tag('CCACCTFROM', field('ACCTID', acctid)),
         tag('INCTRAN', field('DTSTART', dtstart), field('INCLUDE', 'Y')))
     return self._message('CREDITCARD', 'CCSTMT', req)
Beispiel #20
0
 def _acctreq(self, dtstart):
     req = tag('ACCTINFORQ', field('DTACCTUP', dtstart))
     return self._message('SIGNUP', 'ACCTINFO', req)