Subversion Repositories SmartDukaan

Rev

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

Rev 8908 Rev 8914
Line 262... Line 262...
262
     - paymentId
262
     - paymentId
263
     - category
263
     - category
264
    """
264
    """
265
    pass
265
    pass
266
 
266
 
267
  def validatePaymentAtGateway(self, merchantTxnId, amount, isDigital):
267
  def getPaymentStatusAtGateway(self, merchantTxnId, amount, isDigital):
268
    """
268
    """
269
    Parameters:
269
    Parameters:
270
     - merchantTxnId
270
     - merchantTxnId
271
     - amount
271
     - amount
272
     - isDigital
272
     - isDigital
Line 1074... Line 1074...
1074
    result = markPaymentAsProcessed_result()
1074
    result = markPaymentAsProcessed_result()
1075
    result.read(self._iprot)
1075
    result.read(self._iprot)
1076
    self._iprot.readMessageEnd()
1076
    self._iprot.readMessageEnd()
1077
    return
1077
    return
1078
 
1078
 
1079
  def validatePaymentAtGateway(self, merchantTxnId, amount, isDigital):
1079
  def getPaymentStatusAtGateway(self, merchantTxnId, amount, isDigital):
1080
    """
1080
    """
1081
    Parameters:
1081
    Parameters:
1082
     - merchantTxnId
1082
     - merchantTxnId
1083
     - amount
1083
     - amount
1084
     - isDigital
1084
     - isDigital
1085
    """
1085
    """
1086
    self.send_validatePaymentAtGateway(merchantTxnId, amount, isDigital)
1086
    self.send_getPaymentStatusAtGateway(merchantTxnId, amount, isDigital)
1087
    return self.recv_validatePaymentAtGateway()
1087
    return self.recv_getPaymentStatusAtGateway()
1088
 
1088
 
1089
  def send_validatePaymentAtGateway(self, merchantTxnId, amount, isDigital):
1089
  def send_getPaymentStatusAtGateway(self, merchantTxnId, amount, isDigital):
1090
    self._oprot.writeMessageBegin('validatePaymentAtGateway', TMessageType.CALL, self._seqid)
1090
    self._oprot.writeMessageBegin('getPaymentStatusAtGateway', TMessageType.CALL, self._seqid)
1091
    args = validatePaymentAtGateway_args()
1091
    args = getPaymentStatusAtGateway_args()
1092
    args.merchantTxnId = merchantTxnId
1092
    args.merchantTxnId = merchantTxnId
1093
    args.amount = amount
1093
    args.amount = amount
1094
    args.isDigital = isDigital
1094
    args.isDigital = isDigital
1095
    args.write(self._oprot)
1095
    args.write(self._oprot)
1096
    self._oprot.writeMessageEnd()
1096
    self._oprot.writeMessageEnd()
1097
    self._oprot.trans.flush()
1097
    self._oprot.trans.flush()
1098
 
1098
 
1099
  def recv_validatePaymentAtGateway(self, ):
1099
  def recv_getPaymentStatusAtGateway(self, ):
1100
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
1100
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
1101
    if mtype == TMessageType.EXCEPTION:
1101
    if mtype == TMessageType.EXCEPTION:
1102
      x = TApplicationException()
1102
      x = TApplicationException()
1103
      x.read(self._iprot)
1103
      x.read(self._iprot)
1104
      self._iprot.readMessageEnd()
1104
      self._iprot.readMessageEnd()
1105
      raise x
1105
      raise x
1106
    result = validatePaymentAtGateway_result()
1106
    result = getPaymentStatusAtGateway_result()
1107
    result.read(self._iprot)
1107
    result.read(self._iprot)
1108
    self._iprot.readMessageEnd()
1108
    self._iprot.readMessageEnd()
1109
    if result.success is not None:
1109
    if result.success is not None:
1110
      return result.success
1110
      return result.success
1111
    if result.pe is not None:
1111
    if result.pe is not None:
1112
      raise result.pe
1112
      raise result.pe
1113
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validatePaymentAtGateway failed: unknown result");
1113
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentStatusAtGateway failed: unknown result");
1114
 
1114
 
1115
 
1115
 
1116
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1116
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1117
  def __init__(self, handler):
1117
  def __init__(self, handler):
1118
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1118
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
Line 1135... Line 1135...
1135
    self._processMap["capturePayment"] = Processor.process_capturePayment
1135
    self._processMap["capturePayment"] = Processor.process_capturePayment
1136
    self._processMap["refundPayment"] = Processor.process_refundPayment
1136
    self._processMap["refundPayment"] = Processor.process_refundPayment
1137
    self._processMap["partiallyCapturePayment"] = Processor.process_partiallyCapturePayment
1137
    self._processMap["partiallyCapturePayment"] = Processor.process_partiallyCapturePayment
1138
    self._processMap["getPaymentsRequiringExtraProcessing"] = Processor.process_getPaymentsRequiringExtraProcessing
1138
    self._processMap["getPaymentsRequiringExtraProcessing"] = Processor.process_getPaymentsRequiringExtraProcessing
1139
    self._processMap["markPaymentAsProcessed"] = Processor.process_markPaymentAsProcessed
1139
    self._processMap["markPaymentAsProcessed"] = Processor.process_markPaymentAsProcessed
1140
    self._processMap["validatePaymentAtGateway"] = Processor.process_validatePaymentAtGateway
1140
    self._processMap["getPaymentStatusAtGateway"] = Processor.process_getPaymentStatusAtGateway
1141
 
1141
 
1142
  def process(self, iprot, oprot):
1142
  def process(self, iprot, oprot):
1143
    (name, type, seqid) = iprot.readMessageBegin()
1143
    (name, type, seqid) = iprot.readMessageBegin()
1144
    if name not in self._processMap:
1144
    if name not in self._processMap:
1145
      iprot.skip(TType.STRUCT)
1145
      iprot.skip(TType.STRUCT)
Line 1437... Line 1437...
1437
    oprot.writeMessageBegin("markPaymentAsProcessed", TMessageType.REPLY, seqid)
1437
    oprot.writeMessageBegin("markPaymentAsProcessed", TMessageType.REPLY, seqid)
1438
    result.write(oprot)
1438
    result.write(oprot)
1439
    oprot.writeMessageEnd()
1439
    oprot.writeMessageEnd()
1440
    oprot.trans.flush()
1440
    oprot.trans.flush()
1441
 
1441
 
1442
  def process_validatePaymentAtGateway(self, seqid, iprot, oprot):
1442
  def process_getPaymentStatusAtGateway(self, seqid, iprot, oprot):
1443
    args = validatePaymentAtGateway_args()
1443
    args = getPaymentStatusAtGateway_args()
1444
    args.read(iprot)
1444
    args.read(iprot)
1445
    iprot.readMessageEnd()
1445
    iprot.readMessageEnd()
1446
    result = validatePaymentAtGateway_result()
1446
    result = getPaymentStatusAtGateway_result()
1447
    try:
1447
    try:
1448
      result.success = self._handler.validatePaymentAtGateway(args.merchantTxnId, args.amount, args.isDigital)
1448
      result.success = self._handler.getPaymentStatusAtGateway(args.merchantTxnId, args.amount, args.isDigital)
1449
    except PaymentException, pe:
1449
    except PaymentException, pe:
1450
      result.pe = pe
1450
      result.pe = pe
1451
    oprot.writeMessageBegin("validatePaymentAtGateway", TMessageType.REPLY, seqid)
1451
    oprot.writeMessageBegin("getPaymentStatusAtGateway", TMessageType.REPLY, seqid)
1452
    result.write(oprot)
1452
    result.write(oprot)
1453
    oprot.writeMessageEnd()
1453
    oprot.writeMessageEnd()
1454
    oprot.trans.flush()
1454
    oprot.trans.flush()
1455
 
1455
 
1456
 
1456
 
Line 4642... Line 4642...
4642
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4642
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4643
 
4643
 
4644
  def __ne__(self, other):
4644
  def __ne__(self, other):
4645
    return not (self == other)
4645
    return not (self == other)
4646
 
4646
 
4647
class validatePaymentAtGateway_args:
4647
class getPaymentStatusAtGateway_args:
4648
  """
4648
  """
4649
  Attributes:
4649
  Attributes:
4650
   - merchantTxnId
4650
   - merchantTxnId
4651
   - amount
4651
   - amount
4652
   - isDigital
4652
   - isDigital
Line 4695... Line 4695...
4695
 
4695
 
4696
  def write(self, oprot):
4696
  def write(self, oprot):
4697
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4697
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4698
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4698
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4699
      return
4699
      return
4700
    oprot.writeStructBegin('validatePaymentAtGateway_args')
4700
    oprot.writeStructBegin('getPaymentStatusAtGateway_args')
4701
    if self.merchantTxnId is not None:
4701
    if self.merchantTxnId is not None:
4702
      oprot.writeFieldBegin('merchantTxnId', TType.I64, 1)
4702
      oprot.writeFieldBegin('merchantTxnId', TType.I64, 1)
4703
      oprot.writeI64(self.merchantTxnId)
4703
      oprot.writeI64(self.merchantTxnId)
4704
      oprot.writeFieldEnd()
4704
      oprot.writeFieldEnd()
4705
    if self.amount is not None:
4705
    if self.amount is not None:
Line 4726... Line 4726...
4726
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4726
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
4727
 
4727
 
4728
  def __ne__(self, other):
4728
  def __ne__(self, other):
4729
    return not (self == other)
4729
    return not (self == other)
4730
 
4730
 
4731
class validatePaymentAtGateway_result:
4731
class getPaymentStatusAtGateway_result:
4732
  """
4732
  """
4733
  Attributes:
4733
  Attributes:
4734
   - success
4734
   - success
4735
   - pe
4735
   - pe
4736
  """
4736
  """
4737
 
4737
 
4738
  thrift_spec = (
4738
  thrift_spec = (
4739
    (0, TType.BOOL, 'success', None, None, ), # 0
4739
    (0, TType.I32, 'success', None, None, ), # 0
4740
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
4740
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
4741
  )
4741
  )
4742
 
4742
 
4743
  def __init__(self, success=None, pe=None,):
4743
  def __init__(self, success=None, pe=None,):
4744
    self.success = success
4744
    self.success = success
Line 4752... Line 4752...
4752
    while True:
4752
    while True:
4753
      (fname, ftype, fid) = iprot.readFieldBegin()
4753
      (fname, ftype, fid) = iprot.readFieldBegin()
4754
      if ftype == TType.STOP:
4754
      if ftype == TType.STOP:
4755
        break
4755
        break
4756
      if fid == 0:
4756
      if fid == 0:
4757
        if ftype == TType.BOOL:
4757
        if ftype == TType.I32:
4758
          self.success = iprot.readBool();
4758
          self.success = iprot.readI32();
4759
        else:
4759
        else:
4760
          iprot.skip(ftype)
4760
          iprot.skip(ftype)
4761
      elif fid == 1:
4761
      elif fid == 1:
4762
        if ftype == TType.STRUCT:
4762
        if ftype == TType.STRUCT:
4763
          self.pe = PaymentException()
4763
          self.pe = PaymentException()
Line 4771... Line 4771...
4771
 
4771
 
4772
  def write(self, oprot):
4772
  def write(self, oprot):
4773
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4773
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
4774
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4774
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
4775
      return
4775
      return
4776
    oprot.writeStructBegin('validatePaymentAtGateway_result')
4776
    oprot.writeStructBegin('getPaymentStatusAtGateway_result')
4777
    if self.success is not None:
4777
    if self.success is not None:
4778
      oprot.writeFieldBegin('success', TType.BOOL, 0)
4778
      oprot.writeFieldBegin('success', TType.I32, 0)
4779
      oprot.writeBool(self.success)
4779
      oprot.writeI32(self.success)
4780
      oprot.writeFieldEnd()
4780
      oprot.writeFieldEnd()
4781
    if self.pe is not None:
4781
    if self.pe is not None:
4782
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
4782
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
4783
      self.pe.write(oprot)
4783
      self.pe.write(oprot)
4784
      oprot.writeFieldEnd()
4784
      oprot.writeFieldEnd()