Subversion Repositories SmartDukaan

Rev

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

Rev 4303 Rev 4324
Line 716... Line 716...
716
     - refundedBy
716
     - refundedBy
717
     - reason
717
     - reason
718
    """
718
    """
719
    pass
719
    pass
720
 
720
 
-
 
721
  def updateShipmentAddress(self, orderId, addressId):
-
 
722
    """
-
 
723
    Updates shipment address of an order. Delivery and shipping date estimates
-
 
724
    etc. are also updated here.
-
 
725
 
-
 
726
    Throws TransactionServiceException in case address change is not
-
 
727
    possible due to certain reasons such as new pincode in address is
-
 
728
    not serviceable etc.
-
 
729
 
-
 
730
    Parameters:
-
 
731
     - orderId
-
 
732
     - addressId
-
 
733
    """
-
 
734
    pass
-
 
735
 
721
  def acceptOrdersForItemId(self, itemId, inventory):
736
  def acceptOrdersForItemId(self, itemId, inventory):
722
    """
737
    """
723
    Marks the orders as ACCEPTED for the given itemId and inventory. It also updates the accepted timestamp. If the
738
    Marks the orders as ACCEPTED for the given itemId and inventory. It also updates the accepted timestamp. If the
724
    given order is not a COD order, it also captures the payment if the same has not been captured.
739
    given order is not a COD order, it also captures the payment if the same has not been captured.
725
 
740
 
Line 3075... Line 3090...
3075
    self._iprot.readMessageEnd()
3090
    self._iprot.readMessageEnd()
3076
    if result.ex is not None:
3091
    if result.ex is not None:
3077
      raise result.ex
3092
      raise result.ex
3078
    return
3093
    return
3079
 
3094
 
-
 
3095
  def updateShipmentAddress(self, orderId, addressId):
-
 
3096
    """
-
 
3097
    Updates shipment address of an order. Delivery and shipping date estimates
-
 
3098
    etc. are also updated here.
-
 
3099
 
-
 
3100
    Throws TransactionServiceException in case address change is not
-
 
3101
    possible due to certain reasons such as new pincode in address is
-
 
3102
    not serviceable etc.
-
 
3103
 
-
 
3104
    Parameters:
-
 
3105
     - orderId
-
 
3106
     - addressId
-
 
3107
    """
-
 
3108
    self.send_updateShipmentAddress(orderId, addressId)
-
 
3109
    self.recv_updateShipmentAddress()
-
 
3110
 
-
 
3111
  def send_updateShipmentAddress(self, orderId, addressId):
-
 
3112
    self._oprot.writeMessageBegin('updateShipmentAddress', TMessageType.CALL, self._seqid)
-
 
3113
    args = updateShipmentAddress_args()
-
 
3114
    args.orderId = orderId
-
 
3115
    args.addressId = addressId
-
 
3116
    args.write(self._oprot)
-
 
3117
    self._oprot.writeMessageEnd()
-
 
3118
    self._oprot.trans.flush()
-
 
3119
 
-
 
3120
  def recv_updateShipmentAddress(self, ):
-
 
3121
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
3122
    if mtype == TMessageType.EXCEPTION:
-
 
3123
      x = TApplicationException()
-
 
3124
      x.read(self._iprot)
-
 
3125
      self._iprot.readMessageEnd()
-
 
3126
      raise x
-
 
3127
    result = updateShipmentAddress_result()
-
 
3128
    result.read(self._iprot)
-
 
3129
    self._iprot.readMessageEnd()
-
 
3130
    if result.ex is not None:
-
 
3131
      raise result.ex
-
 
3132
    return
-
 
3133
 
3080
  def acceptOrdersForItemId(self, itemId, inventory):
3134
  def acceptOrdersForItemId(self, itemId, inventory):
3081
    """
3135
    """
3082
    Marks the orders as ACCEPTED for the given itemId and inventory. It also updates the accepted timestamp. If the
3136
    Marks the orders as ACCEPTED for the given itemId and inventory. It also updates the accepted timestamp. If the
3083
    given order is not a COD order, it also captures the payment if the same has not been captured.
3137
    given order is not a COD order, it also captures the payment if the same has not been captured.
3084
 
3138
 
Line 3288... Line 3342...
3288
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3342
    self._processMap["markOrderCancellationRequestReceived"] = Processor.process_markOrderCancellationRequestReceived
3289
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3343
    self._processMap["markOrderCancellationRequestConfirmed"] = Processor.process_markOrderCancellationRequestConfirmed
3290
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3344
    self._processMap["markOrderCancellationRequestDenied"] = Processor.process_markOrderCancellationRequestDenied
3291
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3345
    self._processMap["markTransactionAsPaymentFlagRemoved"] = Processor.process_markTransactionAsPaymentFlagRemoved
3292
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
3346
    self._processMap["refundTransaction"] = Processor.process_refundTransaction
-
 
3347
    self._processMap["updateShipmentAddress"] = Processor.process_updateShipmentAddress
3293
    self._processMap["acceptOrdersForItemId"] = Processor.process_acceptOrdersForItemId
3348
    self._processMap["acceptOrdersForItemId"] = Processor.process_acceptOrdersForItemId
3294
    self._processMap["markOrdersAsPORaised"] = Processor.process_markOrdersAsPORaised
3349
    self._processMap["markOrdersAsPORaised"] = Processor.process_markOrdersAsPORaised
3295
    self._processMap["markOrdersAsReversalInitiated"] = Processor.process_markOrdersAsReversalInitiated
3350
    self._processMap["markOrdersAsReversalInitiated"] = Processor.process_markOrdersAsReversalInitiated
3296
    self._processMap["markOrdersAsNotAvailabke"] = Processor.process_markOrdersAsNotAvailabke
3351
    self._processMap["markOrdersAsNotAvailabke"] = Processor.process_markOrdersAsNotAvailabke
3297
 
3352
 
Line 4165... Line 4220...
4165
    oprot.writeMessageBegin("refundTransaction", TMessageType.REPLY, seqid)
4220
    oprot.writeMessageBegin("refundTransaction", TMessageType.REPLY, seqid)
4166
    result.write(oprot)
4221
    result.write(oprot)
4167
    oprot.writeMessageEnd()
4222
    oprot.writeMessageEnd()
4168
    oprot.trans.flush()
4223
    oprot.trans.flush()
4169
 
4224
 
-
 
4225
  def process_updateShipmentAddress(self, seqid, iprot, oprot):
-
 
4226
    args = updateShipmentAddress_args()
-
 
4227
    args.read(iprot)
-
 
4228
    iprot.readMessageEnd()
-
 
4229
    result = updateShipmentAddress_result()
-
 
4230
    try:
-
 
4231
      self._handler.updateShipmentAddress(args.orderId, args.addressId)
-
 
4232
    except TransactionServiceException, ex:
-
 
4233
      result.ex = ex
-
 
4234
    oprot.writeMessageBegin("updateShipmentAddress", TMessageType.REPLY, seqid)
-
 
4235
    result.write(oprot)
-
 
4236
    oprot.writeMessageEnd()
-
 
4237
    oprot.trans.flush()
-
 
4238
 
4170
  def process_acceptOrdersForItemId(self, seqid, iprot, oprot):
4239
  def process_acceptOrdersForItemId(self, seqid, iprot, oprot):
4171
    args = acceptOrdersForItemId_args()
4240
    args = acceptOrdersForItemId_args()
4172
    args.read(iprot)
4241
    args.read(iprot)
4173
    iprot.readMessageEnd()
4242
    iprot.readMessageEnd()
4174
    result = acceptOrdersForItemId_result()
4243
    result = acceptOrdersForItemId_result()
Line 13355... Line 13424...
13355
    if self.ex is not None:
13424
    if self.ex is not None:
13356
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
13425
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
13357
      self.ex.write(oprot)
13426
      self.ex.write(oprot)
13358
      oprot.writeFieldEnd()
13427
      oprot.writeFieldEnd()
13359
    oprot.writeFieldStop()
13428
    oprot.writeFieldStop()
-
 
13429
    oprot.writeStructEnd()
-
 
13430
 
-
 
13431
  def validate(self):
-
 
13432
    return
-
 
13433
 
-
 
13434
 
-
 
13435
  def __repr__(self):
-
 
13436
    L = ['%s=%r' % (key, value)
-
 
13437
      for key, value in self.__dict__.iteritems()]
-
 
13438
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13439
 
-
 
13440
  def __eq__(self, other):
-
 
13441
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13442
 
-
 
13443
  def __ne__(self, other):
-
 
13444
    return not (self == other)
-
 
13445
 
-
 
13446
class updateShipmentAddress_args:
-
 
13447
  """
-
 
13448
  Attributes:
-
 
13449
   - orderId
-
 
13450
   - addressId
-
 
13451
  """
-
 
13452
 
-
 
13453
  thrift_spec = (
-
 
13454
    None, # 0
-
 
13455
    (1, TType.I64, 'orderId', None, None, ), # 1
-
 
13456
    (2, TType.I64, 'addressId', None, None, ), # 2
-
 
13457
  )
-
 
13458
 
-
 
13459
  def __init__(self, orderId=None, addressId=None,):
-
 
13460
    self.orderId = orderId
-
 
13461
    self.addressId = addressId
-
 
13462
 
-
 
13463
  def read(self, iprot):
-
 
13464
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13465
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13466
      return
-
 
13467
    iprot.readStructBegin()
-
 
13468
    while True:
-
 
13469
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13470
      if ftype == TType.STOP:
-
 
13471
        break
-
 
13472
      if fid == 1:
-
 
13473
        if ftype == TType.I64:
-
 
13474
          self.orderId = iprot.readI64();
-
 
13475
        else:
-
 
13476
          iprot.skip(ftype)
-
 
13477
      elif fid == 2:
-
 
13478
        if ftype == TType.I64:
-
 
13479
          self.addressId = iprot.readI64();
-
 
13480
        else:
-
 
13481
          iprot.skip(ftype)
-
 
13482
      else:
-
 
13483
        iprot.skip(ftype)
-
 
13484
      iprot.readFieldEnd()
-
 
13485
    iprot.readStructEnd()
-
 
13486
 
-
 
13487
  def write(self, oprot):
-
 
13488
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13489
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13490
      return
-
 
13491
    oprot.writeStructBegin('updateShipmentAddress_args')
-
 
13492
    if self.orderId is not None:
-
 
13493
      oprot.writeFieldBegin('orderId', TType.I64, 1)
-
 
13494
      oprot.writeI64(self.orderId)
-
 
13495
      oprot.writeFieldEnd()
-
 
13496
    if self.addressId is not None:
-
 
13497
      oprot.writeFieldBegin('addressId', TType.I64, 2)
-
 
13498
      oprot.writeI64(self.addressId)
-
 
13499
      oprot.writeFieldEnd()
-
 
13500
    oprot.writeFieldStop()
-
 
13501
    oprot.writeStructEnd()
-
 
13502
 
-
 
13503
  def validate(self):
-
 
13504
    return
-
 
13505
 
-
 
13506
 
-
 
13507
  def __repr__(self):
-
 
13508
    L = ['%s=%r' % (key, value)
-
 
13509
      for key, value in self.__dict__.iteritems()]
-
 
13510
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
13511
 
-
 
13512
  def __eq__(self, other):
-
 
13513
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
13514
 
-
 
13515
  def __ne__(self, other):
-
 
13516
    return not (self == other)
-
 
13517
 
-
 
13518
class updateShipmentAddress_result:
-
 
13519
  """
-
 
13520
  Attributes:
-
 
13521
   - ex
-
 
13522
  """
-
 
13523
 
-
 
13524
  thrift_spec = (
-
 
13525
    None, # 0
-
 
13526
    (1, TType.STRUCT, 'ex', (TransactionServiceException, TransactionServiceException.thrift_spec), None, ), # 1
-
 
13527
  )
-
 
13528
 
-
 
13529
  def __init__(self, ex=None,):
-
 
13530
    self.ex = ex
-
 
13531
 
-
 
13532
  def read(self, iprot):
-
 
13533
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
13534
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
13535
      return
-
 
13536
    iprot.readStructBegin()
-
 
13537
    while True:
-
 
13538
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
13539
      if ftype == TType.STOP:
-
 
13540
        break
-
 
13541
      if fid == 1:
-
 
13542
        if ftype == TType.STRUCT:
-
 
13543
          self.ex = TransactionServiceException()
-
 
13544
          self.ex.read(iprot)
-
 
13545
        else:
-
 
13546
          iprot.skip(ftype)
-
 
13547
      else:
-
 
13548
        iprot.skip(ftype)
-
 
13549
      iprot.readFieldEnd()
-
 
13550
    iprot.readStructEnd()
-
 
13551
 
-
 
13552
  def write(self, oprot):
-
 
13553
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
13554
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
13555
      return
-
 
13556
    oprot.writeStructBegin('updateShipmentAddress_result')
-
 
13557
    if self.ex is not None:
-
 
13558
      oprot.writeFieldBegin('ex', TType.STRUCT, 1)
-
 
13559
      self.ex.write(oprot)
-
 
13560
      oprot.writeFieldEnd()
-
 
13561
    oprot.writeFieldStop()
13360
    oprot.writeStructEnd()
13562
    oprot.writeStructEnd()
13361
 
13563
 
13362
  def validate(self):
13564
  def validate(self):
13363
    return
13565
    return
13364
 
13566