Subversion Repositories SmartDukaan

Rev

Rev 696 | Rev 1120 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 696 Rev 765
Line 14... Line 14...
14
except:
14
except:
15
  fastbinary = None
15
  fastbinary = None
16
 
16
 
17
 
17
 
18
class Iface:
18
class Iface:
-
 
19
  def closeSession(self, ):
-
 
20
    """
-
 
21
    For closing the open session in sqlalchemy
-
 
22
    """
-
 
23
    pass
-
 
24
 
19
  def createPayment(self, userId, amount, gatewayId, txnId):
25
  def createPayment(self, userId, amount, gatewayId, txnId):
20
    """
26
    """
21
    create a new payment and return payment id, throws an exception if gateway is not active
27
    create a new payment and return payment id, throws an exception if gateway is not active
22
    
28
    
23
    
29
    
Line 112... Line 118...
112
    self._iprot = self._oprot = iprot
118
    self._iprot = self._oprot = iprot
113
    if oprot != None:
119
    if oprot != None:
114
      self._oprot = oprot
120
      self._oprot = oprot
115
    self._seqid = 0
121
    self._seqid = 0
116
 
122
 
-
 
123
  def closeSession(self, ):
-
 
124
    """
-
 
125
    For closing the open session in sqlalchemy
-
 
126
    """
-
 
127
    self.send_closeSession()
-
 
128
    self.recv_closeSession()
-
 
129
 
-
 
130
  def send_closeSession(self, ):
-
 
131
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
-
 
132
    args = closeSession_args()
-
 
133
    args.write(self._oprot)
-
 
134
    self._oprot.writeMessageEnd()
-
 
135
    self._oprot.trans.flush()
-
 
136
 
-
 
137
  def recv_closeSession(self, ):
-
 
138
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
139
    if mtype == TMessageType.EXCEPTION:
-
 
140
      x = TApplicationException()
-
 
141
      x.read(self._iprot)
-
 
142
      self._iprot.readMessageEnd()
-
 
143
      raise x
-
 
144
    result = closeSession_result()
-
 
145
    result.read(self._iprot)
-
 
146
    self._iprot.readMessageEnd()
-
 
147
    return
-
 
148
 
117
  def createPayment(self, userId, amount, gatewayId, txnId):
149
  def createPayment(self, userId, amount, gatewayId, txnId):
118
    """
150
    """
119
    create a new payment and return payment id, throws an exception if gateway is not active
151
    create a new payment and return payment id, throws an exception if gateway is not active
120
    
152
    
121
    
153
    
Line 402... Line 434...
402
 
434
 
403
class Processor(Iface, TProcessor):
435
class Processor(Iface, TProcessor):
404
  def __init__(self, handler):
436
  def __init__(self, handler):
405
    self._handler = handler
437
    self._handler = handler
406
    self._processMap = {}
438
    self._processMap = {}
-
 
439
    self._processMap["closeSession"] = Processor.process_closeSession
407
    self._processMap["createPayment"] = Processor.process_createPayment
440
    self._processMap["createPayment"] = Processor.process_createPayment
408
    self._processMap["getPaymentsForUser"] = Processor.process_getPaymentsForUser
441
    self._processMap["getPaymentsForUser"] = Processor.process_getPaymentsForUser
409
    self._processMap["getPayments"] = Processor.process_getPayments
442
    self._processMap["getPayments"] = Processor.process_getPayments
410
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
443
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
411
    self._processMap["getPayment"] = Processor.process_getPayment
444
    self._processMap["getPayment"] = Processor.process_getPayment
Line 425... Line 458...
425
      return
458
      return
426
    else:
459
    else:
427
      self._processMap[name](self, seqid, iprot, oprot)
460
      self._processMap[name](self, seqid, iprot, oprot)
428
    return True
461
    return True
429
 
462
 
-
 
463
  def process_closeSession(self, seqid, iprot, oprot):
-
 
464
    args = closeSession_args()
-
 
465
    args.read(iprot)
-
 
466
    iprot.readMessageEnd()
-
 
467
    result = closeSession_result()
-
 
468
    self._handler.closeSession()
-
 
469
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
-
 
470
    result.write(oprot)
-
 
471
    oprot.writeMessageEnd()
-
 
472
    oprot.trans.flush()
-
 
473
 
430
  def process_createPayment(self, seqid, iprot, oprot):
474
  def process_createPayment(self, seqid, iprot, oprot):
431
    args = createPayment_args()
475
    args = createPayment_args()
432
    args.read(iprot)
476
    args.read(iprot)
433
    iprot.readMessageEnd()
477
    iprot.readMessageEnd()
434
    result = createPayment_result()
478
    result = createPayment_result()
Line 526... Line 570...
526
    oprot.trans.flush()
570
    oprot.trans.flush()
527
 
571
 
528
 
572
 
529
# HELPER FUNCTIONS AND STRUCTURES
573
# HELPER FUNCTIONS AND STRUCTURES
530
 
574
 
-
 
575
class closeSession_args:
-
 
576
 
-
 
577
  thrift_spec = (
-
 
578
  )
-
 
579
 
-
 
580
  def read(self, iprot):
-
 
581
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
582
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
583
      return
-
 
584
    iprot.readStructBegin()
-
 
585
    while True:
-
 
586
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
587
      if ftype == TType.STOP:
-
 
588
        break
-
 
589
      else:
-
 
590
        iprot.skip(ftype)
-
 
591
      iprot.readFieldEnd()
-
 
592
    iprot.readStructEnd()
-
 
593
 
-
 
594
  def write(self, oprot):
-
 
595
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
596
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
597
      return
-
 
598
    oprot.writeStructBegin('closeSession_args')
-
 
599
    oprot.writeFieldStop()
-
 
600
    oprot.writeStructEnd()
-
 
601
 
-
 
602
  def __repr__(self):
-
 
603
    L = ['%s=%r' % (key, value)
-
 
604
      for key, value in self.__dict__.iteritems()]
-
 
605
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
606
 
-
 
607
  def __eq__(self, other):
-
 
608
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
609
 
-
 
610
  def __ne__(self, other):
-
 
611
    return not (self == other)
-
 
612
 
-
 
613
class closeSession_result:
-
 
614
 
-
 
615
  thrift_spec = (
-
 
616
  )
-
 
617
 
-
 
618
  def read(self, iprot):
-
 
619
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
620
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
621
      return
-
 
622
    iprot.readStructBegin()
-
 
623
    while True:
-
 
624
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
625
      if ftype == TType.STOP:
-
 
626
        break
-
 
627
      else:
-
 
628
        iprot.skip(ftype)
-
 
629
      iprot.readFieldEnd()
-
 
630
    iprot.readStructEnd()
-
 
631
 
-
 
632
  def write(self, oprot):
-
 
633
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
634
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
635
      return
-
 
636
    oprot.writeStructBegin('closeSession_result')
-
 
637
    oprot.writeFieldStop()
-
 
638
    oprot.writeStructEnd()
-
 
639
 
-
 
640
  def __repr__(self):
-
 
641
    L = ['%s=%r' % (key, value)
-
 
642
      for key, value in self.__dict__.iteritems()]
-
 
643
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
644
 
-
 
645
  def __eq__(self, other):
-
 
646
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
647
 
-
 
648
  def __ne__(self, other):
-
 
649
    return not (self == other)
-
 
650
 
531
class createPayment_args:
651
class createPayment_args:
532
  """
652
  """
533
  Attributes:
653
  Attributes:
534
   - userId
654
   - userId
535
   - amount
655
   - amount