Subversion Repositories SmartDukaan

Rev

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

Rev 4258 Rev 4259
Line 714... Line 714...
714
    Parameters:
714
    Parameters:
715
     - transactionId
715
     - transactionId
716
    """
716
    """
717
    pass
717
    pass
718
 
718
 
-
 
719
  def refundTransaction(self, transactionId, refundedBy, reason):
-
 
720
    """
-
 
721
    This method is called when a flagged payment is deemed unserviceable and the corresponding orders
-
 
722
    need to be cancelled
-
 
723
 
-
 
724
    Parameters:
-
 
725
     - transactionId
-
 
726
     - refundedBy
-
 
727
     - reason
-
 
728
    """
-
 
729
    pass
-
 
730
 
719
 
731
 
720
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
732
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
721
  def __init__(self, iprot, oprot=None):
733
  def __init__(self, iprot, oprot=None):
722
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
734
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
723
 
735
 
Line 3032... Line 3044...
3032
    self._iprot.readMessageEnd()
3044
    self._iprot.readMessageEnd()
3033
    if result.ex is not None:
3045
    if result.ex is not None:
3034
      raise result.ex
3046
      raise result.ex
3035
    return
3047
    return
3036
 
3048
 
-
 
3049
  def refundTransaction(self, transactionId, refundedBy, reason):
-
 
3050
    """
-
 
3051
    This method is called when a flagged payment is deemed unserviceable and the corresponding orders
-
 
3052
    need to be cancelled
-
 
3053
 
-
 
3054
    Parameters:
-
 
3055
     - transactionId
-
 
3056
     - refundedBy
-
 
3057
     - reason
-
 
3058
    """
-
 
3059
    self.send_refundTransaction(transactionId, refundedBy, reason)
-
 
3060
    self.recv_refundTransaction()
-
 
3061
 
-
 
3062
  def send_refundTransaction(self, transactionId, refundedBy, reason):
-
 
3063
    self._oprot.writeMessageBegin('refundTransaction', TMessageType.CALL, self._seqid)
-
 
3064
    args = refundTransaction_args()
-
 
3065
    args.transactionId = transactionId
-
 
3066
    args.refundedBy = refundedBy
-
 
3067
    args.reason = reason
-
 
3068
    args.write(self._oprot)
-
 
3069
    self._oprot.writeMessageEnd()
-
 
3070
    self._oprot.trans.flush()
-
 
3071
 
-
 
3072
  def recv_refundTransaction(self, ):
-
 
3073
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3074
    if mtype == TMessageType.EXCEPTION:
-
 
3075
      x = TApplicationException()
-
 
3076
      x.read(self._iprot)
-
 
3077
      self._iprot.readMessageEnd()
-
 
3078
      raise x
-
 
3079
    result = refundTransaction_result()
-
 
3080
    result.read(self._iprot)
-
 
3081
    self._iprot.readMessageEnd()
-
 
3082
    if result.ex is not None:
-
 
3083
      raise result.ex
-
 
3084
    return
-
 
3085
 
3037
 
3086
 
3038
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3087
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3039
  def __init__(self, handler):
3088
  def __init__(self, handler):
3040
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3089
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3041
    self._processMap["createTransaction"] = Processor.process_createTransaction
3090
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 3100... Line 3149...
3100
    self._processMap["getItemWiseRiskyOrdersCount"] = Processor.process_getItemWiseRiskyOrdersCount
3149
    self._processMap["getItemWiseRiskyOrdersCount"] = Processor.process_getItemWiseRiskyOrdersCount
3101
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3150
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3102
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3151
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3103
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3152
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3104
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3153
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
-
 
3154
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
3105
 
3155
 
3106
  def process(self, iprot, oprot):
3156
  def process(self, iprot, oprot):
3107
    (name, type, seqid) = iprot.readMessageBegin()
3157
    (name, type, seqid) = iprot.readMessageBegin()
3108
    if name not in self._processMap:
3158
    if name not in self._processMap:
3109
      iprot.skip(TType.STRUCT)
3159
      iprot.skip(TType.STRUCT)
Line 3976... Line 4026...
3976
    oprot.writeMessageBegin("markTransactionAsPaymentFlagRemoved", TMessageType.REPLY, seqid)
4026
    oprot.writeMessageBegin("markTransactionAsPaymentFlagRemoved", TMessageType.REPLY, seqid)
3977
    result.write(oprot)
4027
    result.write(oprot)
3978
    oprot.writeMessageEnd()
4028
    oprot.writeMessageEnd()
3979
    oprot.trans.flush()
4029
    oprot.trans.flush()
3980
 
4030
 
-
 
4031
  def process_refundTransaction(self, seqid, iprot, oprot):
-
 
4032
    args = refundTransaction_args()
-
 
4033
    args.read(iprot)
-
 
4034
    iprot.readMessageEnd()
-
 
4035
    result = refundTransaction_result()
-
 
4036
    try:
-
 
4037
      self._handler.refundTransaction(args.transactionId, args.refundedBy, args.reason)
-
 
4038
    except TransactionServiceException, ex:
-
 
4039
      result.ex = ex
-
 
4040
    oprot.writeMessageBegin("refundTransaction", TMessageType.REPLY, seqid)
-
 
4041
    result.write(oprot)
-
 
4042
    oprot.writeMessageEnd()
-
 
4043
    oprot.trans.flush()
-
 
4044
 
3981
 
4045
 
3982
# HELPER FUNCTIONS AND STRUCTURES
4046
# HELPER FUNCTIONS AND STRUCTURES
3983
 
4047
 
3984
class createTransaction_args:
4048
class createTransaction_args:
3985
  """
4049
  """
Line 13093... Line 13157...
13093
    if self.ex is not None:
13157
    if self.ex is not None:
13094
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
13158
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
13095
      self.ex.write(oprot)
13159
      self.ex.write(oprot)
13096
      oprot.writeFieldEnd()
13160
      oprot.writeFieldEnd()
13097
    oprot.writeFieldStop()
13161
    oprot.writeFieldStop()
-
 
13162
    oprot.writeStructEnd()
-
 
13163
 
-
 
13164
  def validate(self):
-
 
13165
    return
-
 
13166
 
-
 
13167
 
-
 
13168
  def __repr__(self):
-
 
13169
    L = ['%s=%r' % (key, value)
-
 
13170
      for key, value in self.__dict__.iteritems()]
-
 
13171
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13172
 
-
 
13173
  def __eq__(self, other):
-
 
13174
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13175
 
-
 
13176
  def __ne__(self, other):
-
 
13177
    return not (self == other)
-
 
13178
 
-
 
13179
class refundTransaction_args:
-
 
13180
  """
-
 
13181
  Attributes:
-
 
13182
   - transactionId
-
 
13183
   - refundedBy
-
 
13184
   - reason
-
 
13185
  """
-
 
13186
 
-
 
13187
  thrift_spec = (
-
 
13188
    None, # 0
-
 
13189
    (1, TType.I64, 'transactionId', None, None, ), # 1
-
 
13190
    (2, TType.STRING, 'refundedBy', None, None, ), # 2
-
 
13191
    (3, TType.STRING, 'reason', None, None, ), # 3
-
 
13192
  )
-
 
13193
 
-
 
13194
  def __init__(self, transactionId=None, refundedBy=None, reason=None,):
-
 
13195
    self.transactionId = transactionId
-
 
13196
    self.refundedBy = refundedBy
-
 
13197
    self.reason = reason
-
 
13198
 
-
 
13199
  def read(self, iprot):
-
 
13200
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13201
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13202
      return
-
 
13203
    iprot.readStructBegin()
-
 
13204
    while True:
-
 
13205
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13206
      if ftype == TType.STOP:
-
 
13207
        break
-
 
13208
      if fid == 1:
-
 
13209
        if ftype == TType.I64:
-
 
13210
          self.transactionId = iprot.readI64();
-
 
13211
        else:
-
 
13212
          iprot.skip(ftype)
-
 
13213
      elif fid == 2:
-
 
13214
        if ftype == TType.STRING:
-
 
13215
          self.refundedBy = iprot.readString();
-
 
13216
        else:
-
 
13217
          iprot.skip(ftype)
-
 
13218
      elif fid == 3:
-
 
13219
        if ftype == TType.STRING:
-
 
13220
          self.reason = iprot.readString();
-
 
13221
        else:
-
 
13222
          iprot.skip(ftype)
-
 
13223
      else:
-
 
13224
        iprot.skip(ftype)
-
 
13225
      iprot.readFieldEnd()
-
 
13226
    iprot.readStructEnd()
-
 
13227
 
-
 
13228
  def write(self, oprot):
-
 
13229
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13230
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13231
      return
-
 
13232
    oprot.writeStructBegin('refundTransaction_args')
-
 
13233
    if self.transactionId is not None:
-
 
13234
      oprot.writeFieldBegin('transactionId', TType.I64, 1)
-
 
13235
      oprot.writeI64(self.transactionId)
-
 
13236
      oprot.writeFieldEnd()
-
 
13237
    if self.refundedBy is not None:
-
 
13238
      oprot.writeFieldBegin('refundedBy', TType.STRING, 2)
-
 
13239
      oprot.writeString(self.refundedBy)
-
 
13240
      oprot.writeFieldEnd()
-
 
13241
    if self.reason is not None:
-
 
13242
      oprot.writeFieldBegin('reason', TType.STRING, 3)
-
 
13243
      oprot.writeString(self.reason)
-
 
13244
      oprot.writeFieldEnd()
-
 
13245
    oprot.writeFieldStop()
-
 
13246
    oprot.writeStructEnd()
-
 
13247
 
-
 
13248
  def validate(self):
-
 
13249
    return
-
 
13250
 
-
 
13251
 
-
 
13252
  def __repr__(self):
-
 
13253
    L = ['%s=%r' % (key, value)
-
 
13254
      for key, value in self.__dict__.iteritems()]
-
 
13255
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13256
 
-
 
13257
  def __eq__(self, other):
-
 
13258
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13259
 
-
 
13260
  def __ne__(self, other):
-
 
13261
    return not (self == other)
-
 
13262
 
-
 
13263
class refundTransaction_result:
-
 
13264
  """
-
 
13265
  Attributes:
-
 
13266
   - ex
-
 
13267
  """
-
 
13268
 
-
 
13269
  thrift_spec = (
-
 
13270
    None, # 0
-
 
13271
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
13272
  )
-
 
13273
 
-
 
13274
  def __init__(self, ex=None,):
-
 
13275
    self.ex = ex
-
 
13276
 
-
 
13277
  def read(self, iprot):
-
 
13278
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13279
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13280
      return
-
 
13281
    iprot.readStructBegin()
-
 
13282
    while True:
-
 
13283
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13284
      if ftype == TType.STOP:
-
 
13285
        break
-
 
13286
      if fid == 1:
-
 
13287
        if ftype == TType.STRUCT:
-
 
13288
          self.ex = TransactionServiceException()
-
 
13289
          self.ex.read(iprot)
-
 
13290
        else:
-
 
13291
          iprot.skip(ftype)
-
 
13292
      else:
-
 
13293
        iprot.skip(ftype)
-
 
13294
      iprot.readFieldEnd()
-
 
13295
    iprot.readStructEnd()
-
 
13296
 
-
 
13297
  def write(self, oprot):
-
 
13298
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13299
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13300
      return
-
 
13301
    oprot.writeStructBegin('refundTransaction_result')
-
 
13302
    if self.ex is not None:
-
 
13303
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
13304
      self.ex.write(oprot)
-
 
13305
      oprot.writeFieldEnd()
-
 
13306
    oprot.writeFieldStop()
13098
    oprot.writeStructEnd()
13307
    oprot.writeStructEnd()
13099
 
13308
 
13100
  def validate(self):
13309
  def validate(self):
13101
    return
13310
    return
13102
 
13311