Subversion Repositories SmartDukaan

Rev

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

Rev 20811 Rev 20873
Line 2694... Line 2694...
2694
    Parameters:
2694
    Parameters:
2695
     - shipmentLogisticsCostDetail
2695
     - shipmentLogisticsCostDetail
2696
    """
2696
    """
2697
    pass
2697
    pass
2698
 
2698
 
-
 
2699
  def createPayment(self, userId, txnId, gatewayId):
-
 
2700
    """
-
 
2701
    Parameters:
-
 
2702
     - userId
-
 
2703
     - txnId
-
 
2704
     - gatewayId
-
 
2705
    """
-
 
2706
    pass
-
 
2707
 
-
 
2708
  def calculatePaymentAmount(self, txnId):
-
 
2709
    """
-
 
2710
    Parameters:
-
 
2711
     - txnId
-
 
2712
    """
-
 
2713
    pass
-
 
2714
 
2699
 
2715
 
2700
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
2716
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
2701
  def __init__(self, iprot, oprot=None):
2717
  def __init__(self, iprot, oprot=None):
2702
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
2718
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
2703
 
2719
 
Line 12915... Line 12931...
12915
    result = addShipmentLogisticDetail_result()
12931
    result = addShipmentLogisticDetail_result()
12916
    result.read(self._iprot)
12932
    result.read(self._iprot)
12917
    self._iprot.readMessageEnd()
12933
    self._iprot.readMessageEnd()
12918
    return
12934
    return
12919
 
12935
 
-
 
12936
  def createPayment(self, userId, txnId, gatewayId):
-
 
12937
    """
-
 
12938
    Parameters:
-
 
12939
     - userId
-
 
12940
     - txnId
-
 
12941
     - gatewayId
-
 
12942
    """
-
 
12943
    self.send_createPayment(userId, txnId, gatewayId)
-
 
12944
    return self.recv_createPayment()
-
 
12945
 
-
 
12946
  def send_createPayment(self, userId, txnId, gatewayId):
-
 
12947
    self._oprot.writeMessageBegin('createPayment', TMessageType.CALL, self._seqid)
-
 
12948
    args = createPayment_args()
-
 
12949
    args.userId = userId
-
 
12950
    args.txnId = txnId
-
 
12951
    args.gatewayId = gatewayId
-
 
12952
    args.write(self._oprot)
-
 
12953
    self._oprot.writeMessageEnd()
-
 
12954
    self._oprot.trans.flush()
-
 
12955
 
-
 
12956
  def recv_createPayment(self, ):
-
 
12957
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
12958
    if mtype == TMessageType.EXCEPTION:
-
 
12959
      x = TApplicationException()
-
 
12960
      x.read(self._iprot)
-
 
12961
      self._iprot.readMessageEnd()
-
 
12962
      raise x
-
 
12963
    result = createPayment_result()
-
 
12964
    result.read(self._iprot)
-
 
12965
    self._iprot.readMessageEnd()
-
 
12966
    if result.success is not None:
-
 
12967
      return result.success
-
 
12968
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPayment failed: unknown result");
-
 
12969
 
-
 
12970
  def calculatePaymentAmount(self, txnId):
-
 
12971
    """
-
 
12972
    Parameters:
-
 
12973
     - txnId
-
 
12974
    """
-
 
12975
    self.send_calculatePaymentAmount(txnId)
-
 
12976
    return self.recv_calculatePaymentAmount()
-
 
12977
 
-
 
12978
  def send_calculatePaymentAmount(self, txnId):
-
 
12979
    self._oprot.writeMessageBegin('calculatePaymentAmount', TMessageType.CALL, self._seqid)
-
 
12980
    args = calculatePaymentAmount_args()
-
 
12981
    args.txnId = txnId
-
 
12982
    args.write(self._oprot)
-
 
12983
    self._oprot.writeMessageEnd()
-
 
12984
    self._oprot.trans.flush()
-
 
12985
 
-
 
12986
  def recv_calculatePaymentAmount(self, ):
-
 
12987
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
12988
    if mtype == TMessageType.EXCEPTION:
-
 
12989
      x = TApplicationException()
-
 
12990
      x.read(self._iprot)
-
 
12991
      self._iprot.readMessageEnd()
-
 
12992
      raise x
-
 
12993
    result = calculatePaymentAmount_result()
-
 
12994
    result.read(self._iprot)
-
 
12995
    self._iprot.readMessageEnd()
-
 
12996
    if result.success is not None:
-
 
12997
      return result.success
-
 
12998
    raise TApplicationException(TApplicationException.MISSING_RESULT, "calculatePaymentAmount failed: unknown result");
-
 
12999
 
12920
 
13000
 
12921
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
13001
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
12922
  def __init__(self, handler):
13002
  def __init__(self, handler):
12923
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
13003
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
12924
    self._processMap["createTransaction"] = Processor.process_createTransaction
13004
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 13227... Line 13307...
13227
    self._processMap["deleteReturnOrder"] = Processor.process_deleteReturnOrder
13307
    self._processMap["deleteReturnOrder"] = Processor.process_deleteReturnOrder
13228
    self._processMap["refundReturnOrder"] = Processor.process_refundReturnOrder
13308
    self._processMap["refundReturnOrder"] = Processor.process_refundReturnOrder
13229
    self._processMap["addShipmentDelay"] = Processor.process_addShipmentDelay
13309
    self._processMap["addShipmentDelay"] = Processor.process_addShipmentDelay
13230
    self._processMap["getCostDetailForLogisticsTxnId"] = Processor.process_getCostDetailForLogisticsTxnId
13310
    self._processMap["getCostDetailForLogisticsTxnId"] = Processor.process_getCostDetailForLogisticsTxnId
13231
    self._processMap["addShipmentLogisticDetail"] = Processor.process_addShipmentLogisticDetail
13311
    self._processMap["addShipmentLogisticDetail"] = Processor.process_addShipmentLogisticDetail
-
 
13312
    self._processMap["createPayment"] = Processor.process_createPayment
-
 
13313
    self._processMap["calculatePaymentAmount"] = Processor.process_calculatePaymentAmount
13232
 
13314
 
13233
  def process(self, iprot, oprot):
13315
  def process(self, iprot, oprot):
13234
    (name, type, seqid) = iprot.readMessageBegin()
13316
    (name, type, seqid) = iprot.readMessageBegin()
13235
    if name not in self._processMap:
13317
    if name not in self._processMap:
13236
      iprot.skip(TType.STRUCT)
13318
      iprot.skip(TType.STRUCT)
Line 17048... Line 17130...
17048
    oprot.writeMessageBegin("addShipmentLogisticDetail", TMessageType.REPLY, seqid)
17130
    oprot.writeMessageBegin("addShipmentLogisticDetail", TMessageType.REPLY, seqid)
17049
    result.write(oprot)
17131
    result.write(oprot)
17050
    oprot.writeMessageEnd()
17132
    oprot.writeMessageEnd()
17051
    oprot.trans.flush()
17133
    oprot.trans.flush()
17052
 
17134
 
-
 
17135
  def process_createPayment(self, seqid, iprot, oprot):
-
 
17136
    args = createPayment_args()
-
 
17137
    args.read(iprot)
-
 
17138
    iprot.readMessageEnd()
-
 
17139
    result = createPayment_result()
-
 
17140
    result.success = self._handler.createPayment(args.userId, args.txnId, args.gatewayId)
-
 
17141
    oprot.writeMessageBegin("createPayment", TMessageType.REPLY, seqid)
-
 
17142
    result.write(oprot)
-
 
17143
    oprot.writeMessageEnd()
-
 
17144
    oprot.trans.flush()
-
 
17145
 
-
 
17146
  def process_calculatePaymentAmount(self, seqid, iprot, oprot):
-
 
17147
    args = calculatePaymentAmount_args()
-
 
17148
    args.read(iprot)
-
 
17149
    iprot.readMessageEnd()
-
 
17150
    result = calculatePaymentAmount_result()
-
 
17151
    result.success = self._handler.calculatePaymentAmount(args.txnId)
-
 
17152
    oprot.writeMessageBegin("calculatePaymentAmount", TMessageType.REPLY, seqid)
-
 
17153
    result.write(oprot)
-
 
17154
    oprot.writeMessageEnd()
-
 
17155
    oprot.trans.flush()
-
 
17156
 
17053
 
17157
 
17054
# HELPER FUNCTIONS AND STRUCTURES
17158
# HELPER FUNCTIONS AND STRUCTURES
17055
 
17159
 
17056
class createTransaction_args:
17160
class createTransaction_args:
17057
  """
17161
  """
Line 59788... Line 59892...
59788
    oprot.writeFieldStop()
59892
    oprot.writeFieldStop()
59789
    oprot.writeStructEnd()
59893
    oprot.writeStructEnd()
59790
 
59894
 
59791
  def validate(self):
59895
  def validate(self):
59792
    return
59896
    return
-
 
59897
 
-
 
59898
 
-
 
59899
  def __repr__(self):
-
 
59900
    L = ['%s=%r' % (key, value)
-
 
59901
      for key, value in self.__dict__.iteritems()]
-
 
59902
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
59903
 
-
 
59904
  def __eq__(self, other):
-
 
59905
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
59906
 
-
 
59907
  def __ne__(self, other):
-
 
59908
    return not (self == other)
-
 
59909
 
-
 
59910
class createPayment_args:
-
 
59911
  """
-
 
59912
  Attributes:
-
 
59913
   - userId
-
 
59914
   - txnId
-
 
59915
   - gatewayId
-
 
59916
  """
-
 
59917
 
-
 
59918
  thrift_spec = (
-
 
59919
    None, # 0
-
 
59920
    (1, TType.I64, 'userId', None, None, ), # 1
-
 
59921
    (2, TType.I64, 'txnId', None, None, ), # 2
-
 
59922
    (3, TType.I32, 'gatewayId', None, None, ), # 3
-
 
59923
  )
-
 
59924
 
-
 
59925
  def __init__(self, userId=None, txnId=None, gatewayId=None,):
-
 
59926
    self.userId = userId
-
 
59927
    self.txnId = txnId
-
 
59928
    self.gatewayId = gatewayId
-
 
59929
 
-
 
59930
  def read(self, iprot):
-
 
59931
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
59932
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
59933
      return
-
 
59934
    iprot.readStructBegin()
-
 
59935
    while True:
-
 
59936
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
59937
      if ftype == TType.STOP:
-
 
59938
        break
-
 
59939
      if fid == 1:
-
 
59940
        if ftype == TType.I64:
-
 
59941
          self.userId = iprot.readI64();
-
 
59942
        else:
-
 
59943
          iprot.skip(ftype)
-
 
59944
      elif fid == 2:
-
 
59945
        if ftype == TType.I64:
-
 
59946
          self.txnId = iprot.readI64();
-
 
59947
        else:
-
 
59948
          iprot.skip(ftype)
-
 
59949
      elif fid == 3:
-
 
59950
        if ftype == TType.I32:
-
 
59951
          self.gatewayId = iprot.readI32();
-
 
59952
        else:
-
 
59953
          iprot.skip(ftype)
-
 
59954
      else:
-
 
59955
        iprot.skip(ftype)
-
 
59956
      iprot.readFieldEnd()
-
 
59957
    iprot.readStructEnd()
-
 
59958
 
-
 
59959
  def write(self, oprot):
-
 
59960
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
59961
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
59962
      return
-
 
59963
    oprot.writeStructBegin('createPayment_args')
-
 
59964
    if self.userId is not None:
-
 
59965
      oprot.writeFieldBegin('userId', TType.I64, 1)
-
 
59966
      oprot.writeI64(self.userId)
-
 
59967
      oprot.writeFieldEnd()
-
 
59968
    if self.txnId is not None:
-
 
59969
      oprot.writeFieldBegin('txnId', TType.I64, 2)
-
 
59970
      oprot.writeI64(self.txnId)
-
 
59971
      oprot.writeFieldEnd()
-
 
59972
    if self.gatewayId is not None:
-
 
59973
      oprot.writeFieldBegin('gatewayId', TType.I32, 3)
-
 
59974
      oprot.writeI32(self.gatewayId)
-
 
59975
      oprot.writeFieldEnd()
-
 
59976
    oprot.writeFieldStop()
-
 
59977
    oprot.writeStructEnd()
-
 
59978
 
-
 
59979
  def validate(self):
-
 
59980
    return
-
 
59981
 
-
 
59982
 
-
 
59983
  def __repr__(self):
-
 
59984
    L = ['%s=%r' % (key, value)
-
 
59985
      for key, value in self.__dict__.iteritems()]
-
 
59986
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
59987
 
-
 
59988
  def __eq__(self, other):
-
 
59989
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
59990
 
-
 
59991
  def __ne__(self, other):
-
 
59992
    return not (self == other)
-
 
59993
 
-
 
59994
class createPayment_result:
-
 
59995
  """
-
 
59996
  Attributes:
-
 
59997
   - success
-
 
59998
  """
-
 
59999
 
-
 
60000
  thrift_spec = (
-
 
60001
    (0, TType.I64, 'success', None, None, ), # 0
-
 
60002
  )
-
 
60003
 
-
 
60004
  def __init__(self, success=None,):
-
 
60005
    self.success = success
-
 
60006
 
-
 
60007
  def read(self, iprot):
-
 
60008
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
60009
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
60010
      return
-
 
60011
    iprot.readStructBegin()
-
 
60012
    while True:
-
 
60013
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
60014
      if ftype == TType.STOP:
-
 
60015
        break
-
 
60016
      if fid == 0:
-
 
60017
        if ftype == TType.I64:
-
 
60018
          self.success = iprot.readI64();
-
 
60019
        else:
-
 
60020
          iprot.skip(ftype)
-
 
60021
      else:
-
 
60022
        iprot.skip(ftype)
-
 
60023
      iprot.readFieldEnd()
-
 
60024
    iprot.readStructEnd()
-
 
60025
 
-
 
60026
  def write(self, oprot):
-
 
60027
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
60028
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
60029
      return
-
 
60030
    oprot.writeStructBegin('createPayment_result')
-
 
60031
    if self.success is not None:
-
 
60032
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
60033
      oprot.writeI64(self.success)
-
 
60034
      oprot.writeFieldEnd()
-
 
60035
    oprot.writeFieldStop()
-
 
60036
    oprot.writeStructEnd()
-
 
60037
 
-
 
60038
  def validate(self):
-
 
60039
    return
-
 
60040
 
-
 
60041
 
-
 
60042
  def __repr__(self):
-
 
60043
    L = ['%s=%r' % (key, value)
-
 
60044
      for key, value in self.__dict__.iteritems()]
-
 
60045
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
60046
 
-
 
60047
  def __eq__(self, other):
-
 
60048
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
60049
 
-
 
60050
  def __ne__(self, other):
-
 
60051
    return not (self == other)
-
 
60052
 
-
 
60053
class calculatePaymentAmount_args:
-
 
60054
  """
-
 
60055
  Attributes:
-
 
60056
   - txnId
-
 
60057
  """
-
 
60058
 
-
 
60059
  thrift_spec = (
-
 
60060
    None, # 0
-
 
60061
    (1, TType.I64, 'txnId', None, None, ), # 1
-
 
60062
  )
-
 
60063
 
-
 
60064
  def __init__(self, txnId=None,):
-
 
60065
    self.txnId = txnId
-
 
60066
 
-
 
60067
  def read(self, iprot):
-
 
60068
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
60069
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
60070
      return
-
 
60071
    iprot.readStructBegin()
-
 
60072
    while True:
-
 
60073
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
60074
      if ftype == TType.STOP:
-
 
60075
        break
-
 
60076
      if fid == 1:
-
 
60077
        if ftype == TType.I64:
-
 
60078
          self.txnId = iprot.readI64();
-
 
60079
        else:
-
 
60080
          iprot.skip(ftype)
-
 
60081
      else:
-
 
60082
        iprot.skip(ftype)
-
 
60083
      iprot.readFieldEnd()
-
 
60084
    iprot.readStructEnd()
-
 
60085
 
-
 
60086
  def write(self, oprot):
-
 
60087
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
60088
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
60089
      return
-
 
60090
    oprot.writeStructBegin('calculatePaymentAmount_args')
-
 
60091
    if self.txnId is not None:
-
 
60092
      oprot.writeFieldBegin('txnId', TType.I64, 1)
-
 
60093
      oprot.writeI64(self.txnId)
-
 
60094
      oprot.writeFieldEnd()
-
 
60095
    oprot.writeFieldStop()
-
 
60096
    oprot.writeStructEnd()
-
 
60097
 
-
 
60098
  def validate(self):
-
 
60099
    return
-
 
60100
 
-
 
60101
 
-
 
60102
  def __repr__(self):
-
 
60103
    L = ['%s=%r' % (key, value)
-
 
60104
      for key, value in self.__dict__.iteritems()]
-
 
60105
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
60106
 
-
 
60107
  def __eq__(self, other):
-
 
60108
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
60109
 
-
 
60110
  def __ne__(self, other):
-
 
60111
    return not (self == other)
-
 
60112
 
-
 
60113
class calculatePaymentAmount_result:
-
 
60114
  """
-
 
60115
  Attributes:
-
 
60116
   - success
-
 
60117
  """
-
 
60118
 
-
 
60119
  thrift_spec = (
-
 
60120
    (0, TType.DOUBLE, 'success', None, None, ), # 0
-
 
60121
  )
-
 
60122
 
-
 
60123
  def __init__(self, success=None,):
-
 
60124
    self.success = success
-
 
60125
 
-
 
60126
  def read(self, iprot):
-
 
60127
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
60128
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
60129
      return
-
 
60130
    iprot.readStructBegin()
-
 
60131
    while True:
-
 
60132
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
60133
      if ftype == TType.STOP:
-
 
60134
        break
-
 
60135
      if fid == 0:
-
 
60136
        if ftype == TType.DOUBLE:
-
 
60137
          self.success = iprot.readDouble();
-
 
60138
        else:
-
 
60139
          iprot.skip(ftype)
-
 
60140
      else:
-
 
60141
        iprot.skip(ftype)
-
 
60142
      iprot.readFieldEnd()
-
 
60143
    iprot.readStructEnd()
-
 
60144
 
-
 
60145
  def write(self, oprot):
-
 
60146
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
60147
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
60148
      return
-
 
60149
    oprot.writeStructBegin('calculatePaymentAmount_result')
-
 
60150
    if self.success is not None:
-
 
60151
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
-
 
60152
      oprot.writeDouble(self.success)
-
 
60153
      oprot.writeFieldEnd()
-
 
60154
    oprot.writeFieldStop()
-
 
60155
    oprot.writeStructEnd()
-
 
60156
 
-
 
60157
  def validate(self):
-
 
60158
    return
59793
 
60159
 
59794
 
60160
 
59795
  def __repr__(self):
60161
  def __repr__(self):
59796
    L = ['%s=%r' % (key, value)
60162
    L = ['%s=%r' % (key, value)
59797
      for key, value in self.__dict__.iteritems()]
60163
      for key, value in self.__dict__.iteritems()]