Subversion Repositories SmartDukaan

Rev

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

Rev 4283 Rev 4285
Line 707... Line 707...
707
     - refundedBy
707
     - refundedBy
708
     - reason
708
     - reason
709
    """
709
    """
710
    pass
710
    pass
711
 
711
 
-
 
712
  def acceptOrdersForItemId(self, itemId, inventory):
-
 
713
    """
-
 
714
    Marks the orders as ACCEPTED for the given itemId and inventory. It also updates the accepted timestamp. If the
-
 
715
    given order is not a COD order, it also captures the payment if the same has not been captured.
-
 
716
 
-
 
717
    Parameters:
-
 
718
     - itemId
-
 
719
     - inventory
-
 
720
    """
-
 
721
    pass
-
 
722
 
712
 
723
 
713
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
724
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
714
  def __init__(self, iprot, oprot=None):
725
  def __init__(self, iprot, oprot=None):
715
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
726
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
716
 
727
 
Line 2993... Line 3004...
2993
    self._iprot.readMessageEnd()
3004
    self._iprot.readMessageEnd()
2994
    if result.ex is not None:
3005
    if result.ex is not None:
2995
      raise result.ex
3006
      raise result.ex
2996
    return
3007
    return
2997
 
3008
 
-
 
3009
  def acceptOrdersForItemId(self, itemId, inventory):
-
 
3010
    """
-
 
3011
    Marks the orders as ACCEPTED for the given itemId and inventory. It also updates the accepted timestamp. If the
-
 
3012
    given order is not a COD order, it also captures the payment if the same has not been captured.
-
 
3013
 
-
 
3014
    Parameters:
-
 
3015
     - itemId
-
 
3016
     - inventory
-
 
3017
    """
-
 
3018
    self.send_acceptOrdersForItemId(itemId, inventory)
-
 
3019
    return self.recv_acceptOrdersForItemId()
-
 
3020
 
-
 
3021
  def send_acceptOrdersForItemId(self, itemId, inventory):
-
 
3022
    self._oprot.writeMessageBegin('acceptOrdersForItemId', TMessageType.CALL, self._seqid)
-
 
3023
    args = acceptOrdersForItemId_args()
-
 
3024
    args.itemId = itemId
-
 
3025
    args.inventory = inventory
-
 
3026
    args.write(self._oprot)
-
 
3027
    self._oprot.writeMessageEnd()
-
 
3028
    self._oprot.trans.flush()
-
 
3029
 
-
 
3030
  def recv_acceptOrdersForItemId(self, ):
-
 
3031
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3032
    if mtype == TMessageType.EXCEPTION:
-
 
3033
      x = TApplicationException()
-
 
3034
      x.read(self._iprot)
-
 
3035
      self._iprot.readMessageEnd()
-
 
3036
      raise x
-
 
3037
    result = acceptOrdersForItemId_result()
-
 
3038
    result.read(self._iprot)
-
 
3039
    self._iprot.readMessageEnd()
-
 
3040
    if result.success is not None:
-
 
3041
      return result.success
-
 
3042
    if result.ex is not None:
-
 
3043
      raise result.ex
-
 
3044
    raise TApplicationException(TApplicationException.MISSING_RESULT, "acceptOrdersForItemId failed: unknown result");
-
 
3045
 
2998
 
3046
 
2999
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3047
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
3000
  def __init__(self, handler):
3048
  def __init__(self, handler):
3001
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3049
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
3002
    self._processMap["createTransaction"] = Processor.process_createTransaction
3050
    self._processMap["createTransaction"] = Processor.process_createTransaction
Line 3060... Line 3108...
3060
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3108
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3061
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3109
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3062
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3110
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3063
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3111
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3064
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
3112
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
-
 
3113
    self._processMap["acceptOrdersForItemId"] = Processor.process_acceptOrdersForItemId
3065
 
3114
 
3066
  def process(self, iprot, oprot):
3115
  def process(self, iprot, oprot):
3067
    (name, type, seqid) = iprot.readMessageBegin()
3116
    (name, type, seqid) = iprot.readMessageBegin()
3068
    if name not in self._processMap:
3117
    if name not in self._processMap:
3069
      iprot.skip(TType.STRUCT)
3118
      iprot.skip(TType.STRUCT)
Line 3922... Line 3971...
3922
    oprot.writeMessageBegin("refundTransaction", TMessageType.REPLY, seqid)
3971
    oprot.writeMessageBegin("refundTransaction", TMessageType.REPLY, seqid)
3923
    result.write(oprot)
3972
    result.write(oprot)
3924
    oprot.writeMessageEnd()
3973
    oprot.writeMessageEnd()
3925
    oprot.trans.flush()
3974
    oprot.trans.flush()
3926
 
3975
 
-
 
3976
  def process_acceptOrdersForItemId(self, seqid, iprot, oprot):
-
 
3977
    args = acceptOrdersForItemId_args()
-
 
3978
    args.read(iprot)
-
 
3979
    iprot.readMessageEnd()
-
 
3980
    result = acceptOrdersForItemId_result()
-
 
3981
    try:
-
 
3982
      result.success = self._handler.acceptOrdersForItemId(args.itemId, args.inventory)
-
 
3983
    except TransactionServiceException, ex:
-
 
3984
      result.ex = ex
-
 
3985
    oprot.writeMessageBegin("acceptOrdersForItemId", TMessageType.REPLY, seqid)
-
 
3986
    result.write(oprot)
-
 
3987
    oprot.writeMessageEnd()
-
 
3988
    oprot.trans.flush()
-
 
3989
 
3927
 
3990
 
3928
# HELPER FUNCTIONS AND STRUCTURES
3991
# HELPER FUNCTIONS AND STRUCTURES
3929
 
3992
 
3930
class createTransaction_args:
3993
class createTransaction_args:
3931
  """
3994
  """
Line 12920... Line 12983...
12920
    if self.ex is not None:
12983
    if self.ex is not None:
12921
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
12984
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
12922
      self.ex.write(oprot)
12985
      self.ex.write(oprot)
12923
      oprot.writeFieldEnd()
12986
      oprot.writeFieldEnd()
12924
    oprot.writeFieldStop()
12987
    oprot.writeFieldStop()
-
 
12988
    oprot.writeStructEnd()
-
 
12989
 
-
 
12990
  def validate(self):
-
 
12991
    return
-
 
12992
 
-
 
12993
 
-
 
12994
  def __repr__(self):
-
 
12995
    L = ['%s=%r' % (key, value)
-
 
12996
      for key, value in self.__dict__.iteritems()]
-
 
12997
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
12998
 
-
 
12999
  def __eq__(self, other):
-
 
13000
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13001
 
-
 
13002
  def __ne__(self, other):
-
 
13003
    return not (self == other)
-
 
13004
 
-
 
13005
class acceptOrdersForItemId_args:
-
 
13006
  """
-
 
13007
  Attributes:
-
 
13008
   - itemId
-
 
13009
   - inventory
-
 
13010
  """
-
 
13011
 
-
 
13012
  thrift_spec = (
-
 
13013
    None, # 0
-
 
13014
    (1, TType.I64, 'itemId', None, None, ), # 1
-
 
13015
    (2, TType.I64, 'inventory', None, None, ), # 2
-
 
13016
  )
-
 
13017
 
-
 
13018
  def __init__(self, itemId=None, inventory=None,):
-
 
13019
    self.itemId = itemId
-
 
13020
    self.inventory = inventory
-
 
13021
 
-
 
13022
  def read(self, iprot):
-
 
13023
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13024
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13025
      return
-
 
13026
    iprot.readStructBegin()
-
 
13027
    while True:
-
 
13028
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13029
      if ftype == TType.STOP:
-
 
13030
        break
-
 
13031
      if fid == 1:
-
 
13032
        if ftype == TType.I64:
-
 
13033
          self.itemId = iprot.readI64();
-
 
13034
        else:
-
 
13035
          iprot.skip(ftype)
-
 
13036
      elif fid == 2:
-
 
13037
        if ftype == TType.I64:
-
 
13038
          self.inventory = iprot.readI64();
-
 
13039
        else:
-
 
13040
          iprot.skip(ftype)
-
 
13041
      else:
-
 
13042
        iprot.skip(ftype)
-
 
13043
      iprot.readFieldEnd()
-
 
13044
    iprot.readStructEnd()
-
 
13045
 
-
 
13046
  def write(self, oprot):
-
 
13047
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13048
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13049
      return
-
 
13050
    oprot.writeStructBegin('acceptOrdersForItemId_args')
-
 
13051
    if self.itemId is not None:
-
 
13052
      oprot.writeFieldBegin('itemId', TType.I64, 1)
-
 
13053
      oprot.writeI64(self.itemId)
-
 
13054
      oprot.writeFieldEnd()
-
 
13055
    if self.inventory is not None:
-
 
13056
      oprot.writeFieldBegin('inventory', TType.I64, 2)
-
 
13057
      oprot.writeI64(self.inventory)
-
 
13058
      oprot.writeFieldEnd()
-
 
13059
    oprot.writeFieldStop()
-
 
13060
    oprot.writeStructEnd()
-
 
13061
 
-
 
13062
  def validate(self):
-
 
13063
    return
-
 
13064
 
-
 
13065
 
-
 
13066
  def __repr__(self):
-
 
13067
    L = ['%s=%r' % (key, value)
-
 
13068
      for key, value in self.__dict__.iteritems()]
-
 
13069
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13070
 
-
 
13071
  def __eq__(self, other):
-
 
13072
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13073
 
-
 
13074
  def __ne__(self, other):
-
 
13075
    return not (self == other)
-
 
13076
 
-
 
13077
class acceptOrdersForItemId_result:
-
 
13078
  """
-
 
13079
  Attributes:
-
 
13080
   - success
-
 
13081
   - ex
-
 
13082
  """
-
 
13083
 
-
 
13084
  thrift_spec = (
-
 
13085
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
13086
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
13087
  )
-
 
13088
 
-
 
13089
  def __init__(self, success=None, ex=None,):
-
 
13090
    self.success = success
-
 
13091
    self.ex = ex
-
 
13092
 
-
 
13093
  def read(self, iprot):
-
 
13094
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13095
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13096
      return
-
 
13097
    iprot.readStructBegin()
-
 
13098
    while True:
-
 
13099
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13100
      if ftype == TType.STOP:
-
 
13101
        break
-
 
13102
      if fid == 0:
-
 
13103
        if ftype == TType.BOOL:
-
 
13104
          self.success = iprot.readBool();
-
 
13105
        else:
-
 
13106
          iprot.skip(ftype)
-
 
13107
      elif fid == 1:
-
 
13108
        if ftype == TType.STRUCT:
-
 
13109
          self.ex = TransactionServiceException()
-
 
13110
          self.ex.read(iprot)
-
 
13111
        else:
-
 
13112
          iprot.skip(ftype)
-
 
13113
      else:
-
 
13114
        iprot.skip(ftype)
-
 
13115
      iprot.readFieldEnd()
-
 
13116
    iprot.readStructEnd()
-
 
13117
 
-
 
13118
  def write(self, oprot):
-
 
13119
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13120
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13121
      return
-
 
13122
    oprot.writeStructBegin('acceptOrdersForItemId_result')
-
 
13123
    if self.success is not None:
-
 
13124
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
13125
      oprot.writeBool(self.success)
-
 
13126
      oprot.writeFieldEnd()
-
 
13127
    if self.ex is not None:
-
 
13128
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
13129
      self.ex.write(oprot)
-
 
13130
      oprot.writeFieldEnd()
-
 
13131
    oprot.writeFieldStop()
12925
    oprot.writeStructEnd()
13132
    oprot.writeStructEnd()
12926
 
13133
 
12927
  def validate(self):
13134
  def validate(self):
12928
    return
13135
    return
12929
 
13136