Subversion Repositories SmartDukaan

Rev

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

Rev 1627 Rev 1731
Line 49... Line 49...
49
    """
49
    """
50
    pass
50
    pass
51
 
51
 
52
  def getPayments(self, fromTime, toTime, status, gatewayId):
52
  def getPayments(self, fromTime, toTime, status, gatewayId):
53
    """
53
    """
54
    get all payments for user. Gateway is mandatory.
54
    * Returns all payments based on following filters.
-
 
55
    status
-
 
56
    fromTime: if 0 then not considered else filters on initTimestamp >= fromTime
-
 
57
    toTime: if -1 then not considered else filters on successTimestamp or errorTimestamp <= toTime
55
    
58
    *
56
    
59
    
57
    Parameters:
60
    Parameters:
58
     - fromTime
61
     - fromTime
59
     - toTime
62
     - toTime
60
     - status
63
     - status
Line 111... Line 114...
111
     - gatewayTxnDate
114
     - gatewayTxnDate
112
     - attributes
115
     - attributes
113
    """
116
    """
114
    pass
117
    pass
115
 
118
 
116
  def getMaxPaymentAmount(self, ):
119
  def getSuccessfulPaymentsAmountRange(self, ):
117
    """
-
 
118
    Returns the maximum amount of a single payment.
-
 
119
    """
-
 
120
    pass
-
 
121
 
-
 
122
  def getMinPaymentAmount(self, ):
-
 
123
    """
120
    """
124
    Returns the minimum amount of a single payment.
121
    Returns the minimum and maximum amounts among successful payments.
-
 
122
    List contains two double values, first minimum and second maximum amount.
125
    """
123
    """
126
    pass
124
    pass
127
 
125
 
128
 
126
 
129
class Client(Iface):
127
class Client(Iface):
Line 243... Line 241...
243
      raise result.pe
241
      raise result.pe
244
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForUser failed: unknown result");
242
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForUser failed: unknown result");
245
 
243
 
246
  def getPayments(self, fromTime, toTime, status, gatewayId):
244
  def getPayments(self, fromTime, toTime, status, gatewayId):
247
    """
245
    """
248
    get all payments for user. Gateway is mandatory.
246
    * Returns all payments based on following filters.
-
 
247
    status
-
 
248
    fromTime: if 0 then not considered else filters on initTimestamp >= fromTime
-
 
249
    toTime: if -1 then not considered else filters on successTimestamp or errorTimestamp <= toTime
249
    
250
    *
250
    
251
    
251
    Parameters:
252
    Parameters:
252
     - fromTime
253
     - fromTime
253
     - toTime
254
     - toTime
254
     - status
255
     - status
Line 444... Line 445...
444
      return result.success
445
      return result.success
445
    if result.pe != None:
446
    if result.pe != None:
446
      raise result.pe
447
      raise result.pe
447
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updatePaymentDetails failed: unknown result");
448
    raise TApplicationException(TApplicationException.MISSING_RESULT, "updatePaymentDetails failed: unknown result");
448
 
449
 
449
  def getMaxPaymentAmount(self, ):
450
  def getSuccessfulPaymentsAmountRange(self, ):
450
    """
451
    """
451
    Returns the maximum amount of a single payment.
452
    Returns the minimum and maximum amounts among successful payments.
-
 
453
    List contains two double values, first minimum and second maximum amount.
452
    """
454
    """
453
    self.send_getMaxPaymentAmount()
455
    self.send_getSuccessfulPaymentsAmountRange()
454
    return self.recv_getMaxPaymentAmount()
456
    return self.recv_getSuccessfulPaymentsAmountRange()
455
 
457
 
456
  def send_getMaxPaymentAmount(self, ):
458
  def send_getSuccessfulPaymentsAmountRange(self, ):
457
    self._oprot.writeMessageBegin('getMaxPaymentAmount', TMessageType.CALL, self._seqid)
459
    self._oprot.writeMessageBegin('getSuccessfulPaymentsAmountRange', TMessageType.CALL, self._seqid)
458
    args = getMaxPaymentAmount_args()
460
    args = getSuccessfulPaymentsAmountRange_args()
459
    args.write(self._oprot)
461
    args.write(self._oprot)
460
    self._oprot.writeMessageEnd()
462
    self._oprot.writeMessageEnd()
461
    self._oprot.trans.flush()
463
    self._oprot.trans.flush()
462
 
464
 
463
  def recv_getMaxPaymentAmount(self, ):
465
  def recv_getSuccessfulPaymentsAmountRange(self, ):
464
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
466
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
465
    if mtype == TMessageType.EXCEPTION:
467
    if mtype == TMessageType.EXCEPTION:
466
      x = TApplicationException()
468
      x = TApplicationException()
467
      x.read(self._iprot)
469
      x.read(self._iprot)
468
      self._iprot.readMessageEnd()
470
      self._iprot.readMessageEnd()
469
      raise x
471
      raise x
470
    result = getMaxPaymentAmount_result()
472
    result = getSuccessfulPaymentsAmountRange_result()
471
    result.read(self._iprot)
473
    result.read(self._iprot)
472
    self._iprot.readMessageEnd()
474
    self._iprot.readMessageEnd()
473
    if result.success != None:
475
    if result.success != None:
474
      return result.success
476
      return result.success
475
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getMaxPaymentAmount failed: unknown result");
477
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentsAmountRange failed: unknown result");
476
 
-
 
477
  def getMinPaymentAmount(self, ):
-
 
478
    """
-
 
479
    Returns the minimum amount of a single payment.
-
 
480
    """
-
 
481
    self.send_getMinPaymentAmount()
-
 
482
    return self.recv_getMinPaymentAmount()
-
 
483
 
-
 
484
  def send_getMinPaymentAmount(self, ):
-
 
485
    self._oprot.writeMessageBegin('getMinPaymentAmount', TMessageType.CALL, self._seqid)
-
 
486
    args = getMinPaymentAmount_args()
-
 
487
    args.write(self._oprot)
-
 
488
    self._oprot.writeMessageEnd()
-
 
489
    self._oprot.trans.flush()
-
 
490
 
-
 
491
  def recv_getMinPaymentAmount(self, ):
-
 
492
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
493
    if mtype == TMessageType.EXCEPTION:
-
 
494
      x = TApplicationException()
-
 
495
      x.read(self._iprot)
-
 
496
      self._iprot.readMessageEnd()
-
 
497
      raise x
-
 
498
    result = getMinPaymentAmount_result()
-
 
499
    result.read(self._iprot)
-
 
500
    self._iprot.readMessageEnd()
-
 
501
    if result.success != None:
-
 
502
      return result.success
-
 
503
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getMinPaymentAmount failed: unknown result");
-
 
504
 
478
 
505
 
479
 
506
class Processor(Iface, TProcessor):
480
class Processor(Iface, TProcessor):
507
  def __init__(self, handler):
481
  def __init__(self, handler):
508
    self._handler = handler
482
    self._handler = handler
Line 513... Line 487...
513
    self._processMap["getPayments"] = Processor.process_getPayments
487
    self._processMap["getPayments"] = Processor.process_getPayments
514
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
488
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
515
    self._processMap["getPayment"] = Processor.process_getPayment
489
    self._processMap["getPayment"] = Processor.process_getPayment
516
    self._processMap["getPaymentForTxnId"] = Processor.process_getPaymentForTxnId
490
    self._processMap["getPaymentForTxnId"] = Processor.process_getPaymentForTxnId
517
    self._processMap["updatePaymentDetails"] = Processor.process_updatePaymentDetails
491
    self._processMap["updatePaymentDetails"] = Processor.process_updatePaymentDetails
518
    self._processMap["getMaxPaymentAmount"] = Processor.process_getMaxPaymentAmount
-
 
519
    self._processMap["getMinPaymentAmount"] = Processor.process_getMinPaymentAmount
492
    self._processMap["getSuccessfulPaymentsAmountRange"] = Processor.process_getSuccessfulPaymentsAmountRange
520
 
493
 
521
  def process(self, iprot, oprot):
494
  def process(self, iprot, oprot):
522
    (name, type, seqid) = iprot.readMessageBegin()
495
    (name, type, seqid) = iprot.readMessageBegin()
523
    if name not in self._processMap:
496
    if name not in self._processMap:
524
      iprot.skip(TType.STRUCT)
497
      iprot.skip(TType.STRUCT)
Line 640... Line 613...
640
    oprot.writeMessageBegin("updatePaymentDetails", TMessageType.REPLY, seqid)
613
    oprot.writeMessageBegin("updatePaymentDetails", TMessageType.REPLY, seqid)
641
    result.write(oprot)
614
    result.write(oprot)
642
    oprot.writeMessageEnd()
615
    oprot.writeMessageEnd()
643
    oprot.trans.flush()
616
    oprot.trans.flush()
644
 
617
 
645
  def process_getMaxPaymentAmount(self, seqid, iprot, oprot):
618
  def process_getSuccessfulPaymentsAmountRange(self, seqid, iprot, oprot):
646
    args = getMaxPaymentAmount_args()
619
    args = getSuccessfulPaymentsAmountRange_args()
647
    args.read(iprot)
620
    args.read(iprot)
648
    iprot.readMessageEnd()
621
    iprot.readMessageEnd()
649
    result = getMaxPaymentAmount_result()
622
    result = getSuccessfulPaymentsAmountRange_result()
650
    result.success = self._handler.getMaxPaymentAmount()
-
 
651
    oprot.writeMessageBegin("getMaxPaymentAmount", TMessageType.REPLY, seqid)
-
 
652
    result.write(oprot)
-
 
653
    oprot.writeMessageEnd()
-
 
654
    oprot.trans.flush()
-
 
655
 
-
 
656
  def process_getMinPaymentAmount(self, seqid, iprot, oprot):
-
 
657
    args = getMinPaymentAmount_args()
-
 
658
    args.read(iprot)
-
 
659
    iprot.readMessageEnd()
-
 
660
    result = getMinPaymentAmount_result()
-
 
661
    result.success = self._handler.getMinPaymentAmount()
623
    result.success = self._handler.getSuccessfulPaymentsAmountRange()
662
    oprot.writeMessageBegin("getMinPaymentAmount", TMessageType.REPLY, seqid)
624
    oprot.writeMessageBegin("getSuccessfulPaymentsAmountRange", TMessageType.REPLY, seqid)
663
    result.write(oprot)
625
    result.write(oprot)
664
    oprot.writeMessageEnd()
626
    oprot.writeMessageEnd()
665
    oprot.trans.flush()
627
    oprot.trans.flush()
666
 
628
 
667
 
629
 
Line 1899... Line 1861...
1899
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1861
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1900
 
1862
 
1901
  def __ne__(self, other):
1863
  def __ne__(self, other):
1902
    return not (self == other)
1864
    return not (self == other)
1903
 
1865
 
1904
class getMaxPaymentAmount_args:
1866
class getSuccessfulPaymentsAmountRange_args:
1905
 
1867
 
1906
  thrift_spec = (
1868
  thrift_spec = (
1907
  )
1869
  )
1908
 
1870
 
1909
  def read(self, iprot):
1871
  def read(self, iprot):
Line 1922... Line 1884...
1922
 
1884
 
1923
  def write(self, oprot):
1885
  def write(self, oprot):
1924
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1886
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1925
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1887
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1926
      return
1888
      return
1927
    oprot.writeStructBegin('getMaxPaymentAmount_args')
1889
    oprot.writeStructBegin('getSuccessfulPaymentsAmountRange_args')
1928
    oprot.writeFieldStop()
1890
    oprot.writeFieldStop()
1929
    oprot.writeStructEnd()
1891
    oprot.writeStructEnd()
1930
 
1892
 
1931
  def __repr__(self):
1893
  def __repr__(self):
1932
    L = ['%s=%r' % (key, value)
1894
    L = ['%s=%r' % (key, value)
Line 1937... Line 1899...
1937
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1899
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1938
 
1900
 
1939
  def __ne__(self, other):
1901
  def __ne__(self, other):
1940
    return not (self == other)
1902
    return not (self == other)
1941
 
1903
 
1942
class getMaxPaymentAmount_result:
1904
class getSuccessfulPaymentsAmountRange_result:
1943
  """
1905
  """
1944
  Attributes:
1906
  Attributes:
1945
   - success
1907
   - success
1946
  """
1908
  """
1947
 
1909
 
1948
  thrift_spec = (
1910
  thrift_spec = (
1949
    (0, TType.DOUBLE, 'success', None, None, ), # 0
1911
    (0, TType.LIST, 'success', (TType.DOUBLE,None), None, ), # 0
1950
  )
1912
  )
1951
 
1913
 
1952
  def __init__(self, success=None,):
1914
  def __init__(self, success=None,):
1953
    self.success = success
1915
    self.success = success
1954
 
1916
 
Line 1960... Line 1922...
1960
    while True:
1922
    while True:
1961
      (fname, ftype, fid) = iprot.readFieldBegin()
1923
      (fname, ftype, fid) = iprot.readFieldBegin()
1962
      if ftype == TType.STOP:
1924
      if ftype == TType.STOP:
1963
        break
1925
        break
1964
      if fid == 0:
1926
      if fid == 0:
1965
        if ftype == TType.DOUBLE:
1927
        if ftype == TType.LIST:
1966
          self.success = iprot.readDouble();
-
 
1967
        else:
-
 
1968
          iprot.skip(ftype)
-
 
1969
      else:
-
 
1970
        iprot.skip(ftype)
-
 
1971
      iprot.readFieldEnd()
-
 
1972
    iprot.readStructEnd()
-
 
1973
 
-
 
1974
  def write(self, oprot):
-
 
1975
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1976
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1977
      return
-
 
1978
    oprot.writeStructBegin('getMaxPaymentAmount_result')
-
 
1979
    if self.success != None:
1928
          self.success = []
1980
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
-
 
1981
      oprot.writeDouble(self.success)
-
 
1982
      oprot.writeFieldEnd()
-
 
1983
    oprot.writeFieldStop()
-
 
1984
    oprot.writeStructEnd()
-
 
1985
 
-
 
1986
  def __repr__(self):
-
 
1987
    L = ['%s=%r' % (key, value)
-
 
1988
      for key, value in self.__dict__.iteritems()]
-
 
1989
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1990
 
-
 
1991
  def __eq__(self, other):
-
 
1992
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1993
 
-
 
1994
  def __ne__(self, other):
-
 
1995
    return not (self == other)
-
 
1996
 
-
 
1997
class getMinPaymentAmount_args:
-
 
1998
 
-
 
1999
  thrift_spec = (
-
 
2000
  )
-
 
2001
 
-
 
2002
  def read(self, iprot):
-
 
2003
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2004
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2005
      return
-
 
2006
    iprot.readStructBegin()
-
 
2007
    while True:
-
 
2008
      (fname, ftype, fid) = iprot.readFieldBegin()
1929
          (_etype45, _size42) = iprot.readListBegin()
2009
      if ftype == TType.STOP:
1930
          for _i46 in xrange(_size42):
2010
        break
-
 
2011
      else:
-
 
2012
        iprot.skip(ftype)
-
 
2013
      iprot.readFieldEnd()
-
 
2014
    iprot.readStructEnd()
-
 
2015
 
-
 
2016
  def write(self, oprot):
-
 
2017
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2018
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2019
      return
-
 
2020
    oprot.writeStructBegin('getMinPaymentAmount_args')
-
 
2021
    oprot.writeFieldStop()
-
 
2022
    oprot.writeStructEnd()
-
 
2023
 
-
 
2024
  def __repr__(self):
-
 
2025
    L = ['%s=%r' % (key, value)
-
 
2026
      for key, value in self.__dict__.iteritems()]
-
 
2027
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
2028
 
-
 
2029
  def __eq__(self, other):
-
 
2030
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
2031
 
-
 
2032
  def __ne__(self, other):
-
 
2033
    return not (self == other)
-
 
2034
 
-
 
2035
class getMinPaymentAmount_result:
-
 
2036
  """
-
 
2037
  Attributes:
-
 
2038
   - success
-
 
2039
  """
-
 
2040
 
-
 
2041
  thrift_spec = (
-
 
2042
    (0, TType.DOUBLE, 'success', None, None, ), # 0
-
 
2043
  )
-
 
2044
 
-
 
2045
  def __init__(self, success=None,):
-
 
2046
    self.success = success
-
 
2047
 
-
 
2048
  def read(self, iprot):
-
 
2049
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2050
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2051
      return
-
 
2052
    iprot.readStructBegin()
-
 
2053
    while True:
-
 
2054
      (fname, ftype, fid) = iprot.readFieldBegin()
1931
            _elem47 = iprot.readDouble();
2055
      if ftype == TType.STOP:
-
 
2056
        break
-
 
2057
      if fid == 0:
-
 
2058
        if ftype == TType.DOUBLE:
1932
            self.success.append(_elem47)
2059
          self.success = iprot.readDouble();
1933
          iprot.readListEnd()
2060
        else:
1934
        else:
2061
          iprot.skip(ftype)
1935
          iprot.skip(ftype)
2062
      else:
1936
      else:
2063
        iprot.skip(ftype)
1937
        iprot.skip(ftype)
2064
      iprot.readFieldEnd()
1938
      iprot.readFieldEnd()
Line 2066... Line 1940...
2066
 
1940
 
2067
  def write(self, oprot):
1941
  def write(self, oprot):
2068
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1942
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2069
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1943
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2070
      return
1944
      return
2071
    oprot.writeStructBegin('getMinPaymentAmount_result')
1945
    oprot.writeStructBegin('getSuccessfulPaymentsAmountRange_result')
2072
    if self.success != None:
1946
    if self.success != None:
2073
      oprot.writeFieldBegin('success', TType.DOUBLE, 0)
1947
      oprot.writeFieldBegin('success', TType.LIST, 0)
-
 
1948
      oprot.writeListBegin(TType.DOUBLE, len(self.success))
-
 
1949
      for iter48 in self.success:
2074
      oprot.writeDouble(self.success)
1950
        oprot.writeDouble(iter48)
-
 
1951
      oprot.writeListEnd()
2075
      oprot.writeFieldEnd()
1952
      oprot.writeFieldEnd()
2076
    oprot.writeFieldStop()
1953
    oprot.writeFieldStop()
2077
    oprot.writeStructEnd()
1954
    oprot.writeStructEnd()
2078
 
1955
 
2079
  def __repr__(self):
1956
  def __repr__(self):