Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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))
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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']),
                      ))
Exemplo n.º 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))
     ])
Exemplo n.º 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']),
         ))
Exemplo n.º 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))
Exemplo n.º 11
0
 def _ccQuery(self, acctid, dtstart):
     '''CC Statement request'''
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(), self._ccreq(acctid, dtstart))
     ])
Exemplo n.º 12
0
 def _acctQuery(self, dtstart):
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(), self._acctreq(dtstart))
     ])
Exemplo n.º 13
0
 def _acctreq(self, dtstart):
     req = tag('ACCTINFORQ',field('DTACCTUP',dtstart))
     return self._message('SIGNUP','ACCTINFO',req)
Exemplo n.º 14
0
 def _invstQuery(self, brokerid, acctid, dtstart):
     return join('\r\n',[self._header(),
                       tag('OFX',
                            self._signOn(),
                            self._invstreq(brokerid, acctid,dtstart))])
Exemplo n.º 15
0
 def _acctQuery(self,dtstart):
     return join('\r\n',[self._header(),
                       tag('OFX',
                           self._signOn(),
                            self._acctreq(dtstart))])
Exemplo n.º 16
0
 def _ccQuery(self, acctid, dtstart):
     '''CC Statement request'''
     return join('\r\n',[self._header(),
                       tag('OFX',
                            self._signOn(),
                            self._ccreq(acctid, dtstart))])
Exemplo n.º 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))])
Exemplo n.º 18
0
 def _invstQuery(self, brokerid, acctid, dtstart):
     return join('\r\n', [
         self._header(),
         tag('OFX', self._signOn(), self._invstreq(brokerid, acctid,
                                                   dtstart))
     ])
Exemplo n.º 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)
Exemplo n.º 20
0
 def _acctreq(self, dtstart):
     req = tag('ACCTINFORQ', field('DTACCTUP', dtstart))
     return self._message('SIGNUP', 'ACCTINFO', req)