Subversion Repositories SmartDukaan

Rev

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

Rev 8618 Rev 8908
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):
-
 
268
    """
-
 
269
    Parameters:
-
 
270
     - merchantTxnId
-
 
271
     - amount
-
 
272
     - isDigital
-
 
273
    """
-
 
274
    pass
-
 
275
 
267
 
276
 
268
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
277
class Client(shop2020.thriftpy.generic.GenericService.Client, Iface):
269
  def __init__(self, iprot, oprot=None):
278
  def __init__(self, iprot, oprot=None):
270
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
279
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
271
 
280
 
Line 1065... Line 1074...
1065
    result = markPaymentAsProcessed_result()
1074
    result = markPaymentAsProcessed_result()
1066
    result.read(self._iprot)
1075
    result.read(self._iprot)
1067
    self._iprot.readMessageEnd()
1076
    self._iprot.readMessageEnd()
1068
    return
1077
    return
1069
 
1078
 
-
 
1079
  def validatePaymentAtGateway(self, merchantTxnId, amount, isDigital):
-
 
1080
    """
-
 
1081
    Parameters:
-
 
1082
     - merchantTxnId
-
 
1083
     - amount
-
 
1084
     - isDigital
-
 
1085
    """
-
 
1086
    self.send_validatePaymentAtGateway(merchantTxnId, amount, isDigital)
-
 
1087
    return self.recv_validatePaymentAtGateway()
-
 
1088
 
-
 
1089
  def send_validatePaymentAtGateway(self, merchantTxnId, amount, isDigital):
-
 
1090
    self._oprot.writeMessageBegin('validatePaymentAtGateway', TMessageType.CALL, self._seqid)
-
 
1091
    args = validatePaymentAtGateway_args()
-
 
1092
    args.merchantTxnId = merchantTxnId
-
 
1093
    args.amount = amount
-
 
1094
    args.isDigital = isDigital
-
 
1095
    args.write(self._oprot)
-
 
1096
    self._oprot.writeMessageEnd()
-
 
1097
    self._oprot.trans.flush()
-
 
1098
 
-
 
1099
  def recv_validatePaymentAtGateway(self, ):
-
 
1100
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
1101
    if mtype == TMessageType.EXCEPTION:
-
 
1102
      x = TApplicationException()
-
 
1103
      x.read(self._iprot)
-
 
1104
      self._iprot.readMessageEnd()
-
 
1105
      raise x
-
 
1106
    result = validatePaymentAtGateway_result()
-
 
1107
    result.read(self._iprot)
-
 
1108
    self._iprot.readMessageEnd()
-
 
1109
    if result.success is not None:
-
 
1110
      return result.success
-
 
1111
    if result.pe is not None:
-
 
1112
      raise result.pe
-
 
1113
    raise TApplicationException(TApplicationException.MISSING_RESULT, "validatePaymentAtGateway failed: unknown result");
-
 
1114
 
1070
 
1115
 
1071
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1116
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
1072
  def __init__(self, handler):
1117
  def __init__(self, handler):
1073
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1118
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
1074
    self._processMap["createPayment"] = Processor.process_createPayment
1119
    self._processMap["createPayment"] = Processor.process_createPayment
Line 1090... Line 1135...
1090
    self._processMap["capturePayment"] = Processor.process_capturePayment
1135
    self._processMap["capturePayment"] = Processor.process_capturePayment
1091
    self._processMap["refundPayment"] = Processor.process_refundPayment
1136
    self._processMap["refundPayment"] = Processor.process_refundPayment
1092
    self._processMap["partiallyCapturePayment"] = Processor.process_partiallyCapturePayment
1137
    self._processMap["partiallyCapturePayment"] = Processor.process_partiallyCapturePayment
1093
    self._processMap["getPaymentsRequiringExtraProcessing"] = Processor.process_getPaymentsRequiringExtraProcessing
1138
    self._processMap["getPaymentsRequiringExtraProcessing"] = Processor.process_getPaymentsRequiringExtraProcessing
1094
    self._processMap["markPaymentAsProcessed"] = Processor.process_markPaymentAsProcessed
1139
    self._processMap["markPaymentAsProcessed"] = Processor.process_markPaymentAsProcessed
-
 
1140
    self._processMap["validatePaymentAtGateway"] = Processor.process_validatePaymentAtGateway
1095
 
1141
 
1096
  def process(self, iprot, oprot):
1142
  def process(self, iprot, oprot):
1097
    (name, type, seqid) = iprot.readMessageBegin()
1143
    (name, type, seqid) = iprot.readMessageBegin()
1098
    if name not in self._processMap:
1144
    if name not in self._processMap:
1099
      iprot.skip(TType.STRUCT)
1145
      iprot.skip(TType.STRUCT)
Line 1391... Line 1437...
1391
    oprot.writeMessageBegin("markPaymentAsProcessed", TMessageType.REPLY, seqid)
1437
    oprot.writeMessageBegin("markPaymentAsProcessed", TMessageType.REPLY, seqid)
1392
    result.write(oprot)
1438
    result.write(oprot)
1393
    oprot.writeMessageEnd()
1439
    oprot.writeMessageEnd()
1394
    oprot.trans.flush()
1440
    oprot.trans.flush()
1395
 
1441
 
-
 
1442
  def process_validatePaymentAtGateway(self, seqid, iprot, oprot):
-
 
1443
    args = validatePaymentAtGateway_args()
-
 
1444
    args.read(iprot)
-
 
1445
    iprot.readMessageEnd()
-
 
1446
    result = validatePaymentAtGateway_result()
-
 
1447
    try:
-
 
1448
      result.success = self._handler.validatePaymentAtGateway(args.merchantTxnId, args.amount, args.isDigital)
-
 
1449
    except PaymentException, pe:
-
 
1450
      result.pe = pe
-
 
1451
    oprot.writeMessageBegin("validatePaymentAtGateway", TMessageType.REPLY, seqid)
-
 
1452
    result.write(oprot)
-
 
1453
    oprot.writeMessageEnd()
-
 
1454
    oprot.trans.flush()
-
 
1455
 
1396
 
1456
 
1397
# HELPER FUNCTIONS AND STRUCTURES
1457
# HELPER FUNCTIONS AND STRUCTURES
1398
 
1458
 
1399
class createPayment_args:
1459
class createPayment_args:
1400
  """
1460
  """
Line 4569... Line 4629...
4569
    oprot.writeFieldStop()
4629
    oprot.writeFieldStop()
4570
    oprot.writeStructEnd()
4630
    oprot.writeStructEnd()
4571
 
4631
 
4572
  def validate(self):
4632
  def validate(self):
4573
    return
4633
    return
-
 
4634
 
-
 
4635
 
-
 
4636
  def __repr__(self):
-
 
4637
    L = ['%s=%r' % (key, value)
-
 
4638
      for key, value in self.__dict__.iteritems()]
-
 
4639
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4640
 
-
 
4641
  def __eq__(self, other):
-
 
4642
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4643
 
-
 
4644
  def __ne__(self, other):
-
 
4645
    return not (self == other)
-
 
4646
 
-
 
4647
class validatePaymentAtGateway_args:
-
 
4648
  """
-
 
4649
  Attributes:
-
 
4650
   - merchantTxnId
-
 
4651
   - amount
-
 
4652
   - isDigital
-
 
4653
  """
-
 
4654
 
-
 
4655
  thrift_spec = (
-
 
4656
    None, # 0
-
 
4657
    (1, TType.I64, 'merchantTxnId', None, None, ), # 1
-
 
4658
    (2, TType.DOUBLE, 'amount', None, None, ), # 2
-
 
4659
    (3, TType.BOOL, 'isDigital', None, None, ), # 3
-
 
4660
  )
-
 
4661
 
-
 
4662
  def __init__(self, merchantTxnId=None, amount=None, isDigital=None,):
-
 
4663
    self.merchantTxnId = merchantTxnId
-
 
4664
    self.amount = amount
-
 
4665
    self.isDigital = isDigital
-
 
4666
 
-
 
4667
  def read(self, iprot):
-
 
4668
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4669
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4670
      return
-
 
4671
    iprot.readStructBegin()
-
 
4672
    while True:
-
 
4673
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4674
      if ftype == TType.STOP:
-
 
4675
        break
-
 
4676
      if fid == 1:
-
 
4677
        if ftype == TType.I64:
-
 
4678
          self.merchantTxnId = iprot.readI64();
-
 
4679
        else:
-
 
4680
          iprot.skip(ftype)
-
 
4681
      elif fid == 2:
-
 
4682
        if ftype == TType.DOUBLE:
-
 
4683
          self.amount = iprot.readDouble();
-
 
4684
        else:
-
 
4685
          iprot.skip(ftype)
-
 
4686
      elif fid == 3:
-
 
4687
        if ftype == TType.BOOL:
-
 
4688
          self.isDigital = iprot.readBool();
-
 
4689
        else:
-
 
4690
          iprot.skip(ftype)
-
 
4691
      else:
-
 
4692
        iprot.skip(ftype)
-
 
4693
      iprot.readFieldEnd()
-
 
4694
    iprot.readStructEnd()
-
 
4695
 
-
 
4696
  def write(self, oprot):
-
 
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)))
-
 
4699
      return
-
 
4700
    oprot.writeStructBegin('validatePaymentAtGateway_args')
-
 
4701
    if self.merchantTxnId is not None:
-
 
4702
      oprot.writeFieldBegin('merchantTxnId', TType.I64, 1)
-
 
4703
      oprot.writeI64(self.merchantTxnId)
-
 
4704
      oprot.writeFieldEnd()
-
 
4705
    if self.amount is not None:
-
 
4706
      oprot.writeFieldBegin('amount', TType.DOUBLE, 2)
-
 
4707
      oprot.writeDouble(self.amount)
-
 
4708
      oprot.writeFieldEnd()
-
 
4709
    if self.isDigital is not None:
-
 
4710
      oprot.writeFieldBegin('isDigital', TType.BOOL, 3)
-
 
4711
      oprot.writeBool(self.isDigital)
-
 
4712
      oprot.writeFieldEnd()
-
 
4713
    oprot.writeFieldStop()
-
 
4714
    oprot.writeStructEnd()
-
 
4715
 
-
 
4716
  def validate(self):
-
 
4717
    return
-
 
4718
 
-
 
4719
 
-
 
4720
  def __repr__(self):
-
 
4721
    L = ['%s=%r' % (key, value)
-
 
4722
      for key, value in self.__dict__.iteritems()]
-
 
4723
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
4724
 
-
 
4725
  def __eq__(self, other):
-
 
4726
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
4727
 
-
 
4728
  def __ne__(self, other):
-
 
4729
    return not (self == other)
-
 
4730
 
-
 
4731
class validatePaymentAtGateway_result:
-
 
4732
  """
-
 
4733
  Attributes:
-
 
4734
   - success
-
 
4735
   - pe
-
 
4736
  """
-
 
4737
 
-
 
4738
  thrift_spec = (
-
 
4739
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
4740
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
-
 
4741
  )
-
 
4742
 
-
 
4743
  def __init__(self, success=None, pe=None,):
-
 
4744
    self.success = success
-
 
4745
    self.pe = pe
-
 
4746
 
-
 
4747
  def read(self, iprot):
-
 
4748
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
4749
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
4750
      return
-
 
4751
    iprot.readStructBegin()
-
 
4752
    while True:
-
 
4753
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
4754
      if ftype == TType.STOP:
-
 
4755
        break
-
 
4756
      if fid == 0:
-
 
4757
        if ftype == TType.BOOL:
-
 
4758
          self.success = iprot.readBool();
-
 
4759
        else:
-
 
4760
          iprot.skip(ftype)
-
 
4761
      elif fid == 1:
-
 
4762
        if ftype == TType.STRUCT:
-
 
4763
          self.pe = PaymentException()
-
 
4764
          self.pe.read(iprot)
-
 
4765
        else:
-
 
4766
          iprot.skip(ftype)
-
 
4767
      else:
-
 
4768
        iprot.skip(ftype)
-
 
4769
      iprot.readFieldEnd()
-
 
4770
    iprot.readStructEnd()
-
 
4771
 
-
 
4772
  def write(self, oprot):
-
 
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)))
-
 
4775
      return
-
 
4776
    oprot.writeStructBegin('validatePaymentAtGateway_result')
-
 
4777
    if self.success is not None:
-
 
4778
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
4779
      oprot.writeBool(self.success)
-
 
4780
      oprot.writeFieldEnd()
-
 
4781
    if self.pe is not None:
-
 
4782
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
-
 
4783
      self.pe.write(oprot)
-
 
4784
      oprot.writeFieldEnd()
-
 
4785
    oprot.writeFieldStop()
-
 
4786
    oprot.writeStructEnd()
-
 
4787
 
-
 
4788
  def validate(self):
-
 
4789
    return
4574
 
4790
 
4575
 
4791
 
4576
  def __repr__(self):
4792
  def __repr__(self):
4577
    L = ['%s=%r' % (key, value)
4793
    L = ['%s=%r' % (key, value)
4578
      for key, value in self.__dict__.iteritems()]
4794
      for key, value in self.__dict__.iteritems()]