Subversion Repositories SmartDukaan

Rev

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

Rev 3010 Rev 3376
Line 3... Line 3...
3
#
3
#
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
#
5
#
6
 
6
 
7
from thrift.Thrift import *
7
from thrift.Thrift import *
-
 
8
import shop2020.thriftpy.generic.GenericService
8
from ttypes import *
9
from ttypes import *
9
from thrift.Thrift import TProcessor
10
from thrift.Thrift import TProcessor
10
from thrift.transport import TTransport
11
from thrift.transport import TTransport
11
from thrift.protocol import TBinaryProtocol
12
from thrift.protocol import TBinaryProtocol
12
try:
13
try:
13
  from thrift.protocol import fastbinary
14
  from thrift.protocol import fastbinary
14
except:
15
except:
15
  fastbinary = None
16
  fastbinary = None
16
 
17
 
17
 
18
 
18
class Iface:
-
 
19
  def closeSession(self, ):
-
 
20
    """
-
 
21
    For closing the open session in sqlalchemy
19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
22
    """
-
 
23
    pass
-
 
24
 
-
 
25
  def createPayment(self, userId, amount, gatewayId, txnId):
20
  def createPayment(self, userId, amount, gatewayId, txnId):
26
    """
21
    """
27
    create a new payment and return payment id, throws an exception if gateway is not active
22
    create a new payment and return payment id, throws an exception if gateway is not active
28
    
23
    
29
    
24
    
Line 170... Line 165...
170
     - merchantTxnId
165
     - merchantTxnId
171
    """
166
    """
172
    pass
167
    pass
173
 
168
 
174
 
169
 
175
class Client(Iface):
170
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
176
  def __init__(self, iprot, oprot=None):
171
  def __init__(self, iprot, oprot=None):
177
    self._iprot = self._oprot = iprot
-
 
178
    if oprot != None:
-
 
179
      self._oprot = oprot
-
 
180
    self._seqid = 0
-
 
181
 
-
 
182
  def closeSession(self, ):
-
 
183
    """
-
 
184
    For closing the open session in sqlalchemy
-
 
185
    """
-
 
186
    self.send_closeSession()
-
 
187
    self.recv_closeSession()
-
 
188
 
-
 
189
  def send_closeSession(self, ):
-
 
190
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
172
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
191
    args = closeSession_args()
-
 
192
    args.write(self._oprot)
-
 
193
    self._oprot.writeMessageEnd()
-
 
194
    self._oprot.trans.flush()
-
 
195
 
-
 
196
  def recv_closeSession(self, ):
-
 
197
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
198
    if mtype == TMessageType.EXCEPTION:
-
 
199
      x = TApplicationException()
-
 
200
      x.read(self._iprot)
-
 
201
      self._iprot.readMessageEnd()
-
 
202
      raise x
-
 
203
    result = closeSession_result()
-
 
204
    result.read(self._iprot)
-
 
205
    self._iprot.readMessageEnd()
-
 
206
    return
-
 
207
 
173
 
208
  def createPayment(self, userId, amount, gatewayId, txnId):
174
  def createPayment(self, userId, amount, gatewayId, txnId):
209
    """
175
    """
210
    create a new payment and return payment id, throws an exception if gateway is not active
176
    create a new payment and return payment id, throws an exception if gateway is not active
211
    
177
    
Line 698... Line 664...
698
    if result.pe != None:
664
    if result.pe != None:
699
      raise result.pe
665
      raise result.pe
700
    raise TApplicationException(TApplicationException.MISSING_RESULT, "capturePayment failed: unknown result");
666
    raise TApplicationException(TApplicationException.MISSING_RESULT, "capturePayment failed: unknown result");
701
 
667
 
702
 
668
 
703
class Processor(Iface, TProcessor):
669
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
704
  def __init__(self, handler):
670
  def __init__(self, handler):
705
    self._handler = handler
-
 
706
    self._processMap = {}
-
 
707
    self._processMap["closeSession"] = Processor.process_closeSession
671
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
708
    self._processMap["createPayment"] = Processor.process_createPayment
672
    self._processMap["createPayment"] = Processor.process_createPayment
709
    self._processMap["getPaymentsForUser"] = Processor.process_getPaymentsForUser
673
    self._processMap["getPaymentsForUser"] = Processor.process_getPaymentsForUser
710
    self._processMap["getPayments"] = Processor.process_getPayments
674
    self._processMap["getPayments"] = Processor.process_getPayments
711
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
675
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
712
    self._processMap["getPayment"] = Processor.process_getPayment
676
    self._processMap["getPayment"] = Processor.process_getPayment
Line 732... Line 696...
732
      return
696
      return
733
    else:
697
    else:
734
      self._processMap[name](self, seqid, iprot, oprot)
698
      self._processMap[name](self, seqid, iprot, oprot)
735
    return True
699
    return True
736
 
700
 
737
  def process_closeSession(self, seqid, iprot, oprot):
-
 
738
    args = closeSession_args()
-
 
739
    args.read(iprot)
-
 
740
    iprot.readMessageEnd()
-
 
741
    result = closeSession_result()
-
 
742
    self._handler.closeSession()
-
 
743
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
-
 
744
    result.write(oprot)
-
 
745
    oprot.writeMessageEnd()
-
 
746
    oprot.trans.flush()
-
 
747
 
-
 
748
  def process_createPayment(self, seqid, iprot, oprot):
701
  def process_createPayment(self, seqid, iprot, oprot):
749
    args = createPayment_args()
702
    args = createPayment_args()
750
    args.read(iprot)
703
    args.read(iprot)
751
    iprot.readMessageEnd()
704
    iprot.readMessageEnd()
752
    result = createPayment_result()
705
    result = createPayment_result()
Line 925... Line 878...
925
    oprot.trans.flush()
878
    oprot.trans.flush()
926
 
879
 
927
 
880
 
928
# HELPER FUNCTIONS AND STRUCTURES
881
# HELPER FUNCTIONS AND STRUCTURES
929
 
882
 
930
class closeSession_args:
-
 
931
 
-
 
932
  thrift_spec = (
-
 
933
  )
-
 
934
 
-
 
935
  def read(self, iprot):
-
 
936
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
937
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
938
      return
-
 
939
    iprot.readStructBegin()
-
 
940
    while True:
-
 
941
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
942
      if ftype == TType.STOP:
-
 
943
        break
-
 
944
      else:
-
 
945
        iprot.skip(ftype)
-
 
946
      iprot.readFieldEnd()
-
 
947
    iprot.readStructEnd()
-
 
948
 
-
 
949
  def write(self, oprot):
-
 
950
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
951
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
952
      return
-
 
953
    oprot.writeStructBegin('closeSession_args')
-
 
954
    oprot.writeFieldStop()
-
 
955
    oprot.writeStructEnd()
-
 
956
 
-
 
957
  def __repr__(self):
-
 
958
    L = ['%s=%r' % (key, value)
-
 
959
      for key, value in self.__dict__.iteritems()]
-
 
960
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
961
 
-
 
962
  def __eq__(self, other):
-
 
963
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
964
 
-
 
965
  def __ne__(self, other):
-
 
966
    return not (self == other)
-
 
967
 
-
 
968
class closeSession_result:
-
 
969
 
-
 
970
  thrift_spec = (
-
 
971
  )
-
 
972
 
-
 
973
  def read(self, iprot):
-
 
974
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
975
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
976
      return
-
 
977
    iprot.readStructBegin()
-
 
978
    while True:
-
 
979
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
980
      if ftype == TType.STOP:
-
 
981
        break
-
 
982
      else:
-
 
983
        iprot.skip(ftype)
-
 
984
      iprot.readFieldEnd()
-
 
985
    iprot.readStructEnd()
-
 
986
 
-
 
987
  def write(self, oprot):
-
 
988
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
989
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
990
      return
-
 
991
    oprot.writeStructBegin('closeSession_result')
-
 
992
    oprot.writeFieldStop()
-
 
993
    oprot.writeStructEnd()
-
 
994
 
-
 
995
  def __repr__(self):
-
 
996
    L = ['%s=%r' % (key, value)
-
 
997
      for key, value in self.__dict__.iteritems()]
-
 
998
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
999
 
-
 
1000
  def __eq__(self, other):
-
 
1001
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1002
 
-
 
1003
  def __ne__(self, other):
-
 
1004
    return not (self == other)
-
 
1005
 
-
 
1006
class createPayment_args:
883
class createPayment_args:
1007
  """
884
  """
1008
  Attributes:
885
  Attributes:
1009
   - userId
886
   - userId
1010
   - amount
887
   - amount