Subversion Repositories SmartDukaan

Rev

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

Rev 7049 Rev 8618
Line 193... Line 193...
193
     - merchantTxnId
193
     - merchantTxnId
194
     - amount
194
     - amount
195
    """
195
    """
196
    pass
196
    pass
197
 
197
 
198
  def capturePayment(self, merchantTxnId):
198
  def capturePayment(self, merchantTxnId, isDigital):
199
    """
199
    """
200
    Capture the payment for the given merchant transaction id. It processes the last payment for the given
200
    Capture the payment for the given merchant transaction id. It processes the last payment for the given
201
    transaction. If the capture attempt failed, the payment is marked as failed. PaymentException with error
201
    transaction. If the capture attempt failed, the payment is marked as failed. PaymentException with error
202
    code 104 is	thrown in case no payments are found for the transaction id passed. PaymentException is also
202
    code 104 is	thrown in case no payments are found for the transaction id passed. PaymentException is also
203
    thrown with error code 106 in case capture was not possible due to connection
203
    thrown with error code 106 in case capture was not possible due to connection
204
    issue.
204
    issue.
205
 
205
 
206
    Parameters:
206
    Parameters:
207
     - merchantTxnId
207
     - merchantTxnId
-
 
208
     - isDigital
208
    """
209
    """
209
    pass
210
    pass
210
 
211
 
211
  def refundPayment(self, merchantTxnId, amount, isDigital):
212
  def refundPayment(self, merchantTxnId, amount, isDigital):
212
    """
213
    """
Line 868... Line 869...
868
      return result.success
869
      return result.success
869
    if result.pe is not None:
870
    if result.pe is not None:
870
      raise result.pe
871
      raise result.pe
871
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createRefund failed: unknown result");
872
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createRefund failed: unknown result");
872
 
873
 
873
  def capturePayment(self, merchantTxnId):
874
  def capturePayment(self, merchantTxnId, isDigital):
874
    """
875
    """
875
    Capture the payment for the given merchant transaction id. It processes the last payment for the given
876
    Capture the payment for the given merchant transaction id. It processes the last payment for the given
876
    transaction. If the capture attempt failed, the payment is marked as failed. PaymentException with error
877
    transaction. If the capture attempt failed, the payment is marked as failed. PaymentException with error
877
    code 104 is	thrown in case no payments are found for the transaction id passed. PaymentException is also
878
    code 104 is	thrown in case no payments are found for the transaction id passed. PaymentException is also
878
    thrown with error code 106 in case capture was not possible due to connection
879
    thrown with error code 106 in case capture was not possible due to connection
879
    issue.
880
    issue.
880
 
881
 
881
    Parameters:
882
    Parameters:
882
     - merchantTxnId
883
     - merchantTxnId
-
 
884
     - isDigital
883
    """
885
    """
884
    self.send_capturePayment(merchantTxnId)
886
    self.send_capturePayment(merchantTxnId, isDigital)
885
    return self.recv_capturePayment()
887
    return self.recv_capturePayment()
886
 
888
 
887
  def send_capturePayment(self, merchantTxnId):
889
  def send_capturePayment(self, merchantTxnId, isDigital):
888
    self._oprot.writeMessageBegin('capturePayment', TMessageType.CALL, self._seqid)
890
    self._oprot.writeMessageBegin('capturePayment', TMessageType.CALL, self._seqid)
889
    args = capturePayment_args()
891
    args = capturePayment_args()
890
    args.merchantTxnId = merchantTxnId
892
    args.merchantTxnId = merchantTxnId
-
 
893
    args.isDigital = isDigital
891
    args.write(self._oprot)
894
    args.write(self._oprot)
892
    self._oprot.writeMessageEnd()
895
    self._oprot.writeMessageEnd()
893
    self._oprot.trans.flush()
896
    self._oprot.trans.flush()
894
 
897
 
895
  def recv_capturePayment(self, ):
898
  def recv_capturePayment(self, ):
Line 1330... Line 1333...
1330
    args = capturePayment_args()
1333
    args = capturePayment_args()
1331
    args.read(iprot)
1334
    args.read(iprot)
1332
    iprot.readMessageEnd()
1335
    iprot.readMessageEnd()
1333
    result = capturePayment_result()
1336
    result = capturePayment_result()
1334
    try:
1337
    try:
1335
      result.success = self._handler.capturePayment(args.merchantTxnId)
1338
      result.success = self._handler.capturePayment(args.merchantTxnId, args.isDigital)
1336
    except PaymentException, pe:
1339
    except PaymentException, pe:
1337
      result.pe = pe
1340
      result.pe = pe
1338
    oprot.writeMessageBegin("capturePayment", TMessageType.REPLY, seqid)
1341
    oprot.writeMessageBegin("capturePayment", TMessageType.REPLY, seqid)
1339
    result.write(oprot)
1342
    result.write(oprot)
1340
    oprot.writeMessageEnd()
1343
    oprot.writeMessageEnd()
Line 3862... Line 3865...
3862
 
3865
 
3863
class capturePayment_args:
3866
class capturePayment_args:
3864
  """
3867
  """
3865
  Attributes:
3868
  Attributes:
3866
   - merchantTxnId
3869
   - merchantTxnId
-
 
3870
   - isDigital
3867
  """
3871
  """
3868
 
3872
 
3869
  thrift_spec = (
3873
  thrift_spec = (
3870
    None, # 0
3874
    None, # 0
3871
    (1, TType.I64, 'merchantTxnId', None, None, ), # 1
3875
    (1, TType.I64, 'merchantTxnId', None, None, ), # 1
-
 
3876
    (2, TType.BOOL, 'isDigital', None, None, ), # 2
3872
  )
3877
  )
3873
 
3878
 
3874
  def __init__(self, merchantTxnId=None,):
3879
  def __init__(self, merchantTxnId=None, isDigital=None,):
3875
    self.merchantTxnId = merchantTxnId
3880
    self.merchantTxnId = merchantTxnId
-
 
3881
    self.isDigital = isDigital
3876
 
3882
 
3877
  def read(self, iprot):
3883
  def read(self, iprot):
3878
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3884
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
3879
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3885
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
3880
      return
3886
      return
Line 3886... Line 3892...
3886
      if fid == 1:
3892
      if fid == 1:
3887
        if ftype == TType.I64:
3893
        if ftype == TType.I64:
3888
          self.merchantTxnId = iprot.readI64();
3894
          self.merchantTxnId = iprot.readI64();
3889
        else:
3895
        else:
3890
          iprot.skip(ftype)
3896
          iprot.skip(ftype)
-
 
3897
      elif fid == 2:
-
 
3898
        if ftype == TType.BOOL:
-
 
3899
          self.isDigital = iprot.readBool();
-
 
3900
        else:
-
 
3901
          iprot.skip(ftype)
3891
      else:
3902
      else:
3892
        iprot.skip(ftype)
3903
        iprot.skip(ftype)
3893
      iprot.readFieldEnd()
3904
      iprot.readFieldEnd()
3894
    iprot.readStructEnd()
3905
    iprot.readStructEnd()
3895
 
3906
 
Line 3900... Line 3911...
3900
    oprot.writeStructBegin('capturePayment_args')
3911
    oprot.writeStructBegin('capturePayment_args')
3901
    if self.merchantTxnId is not None:
3912
    if self.merchantTxnId is not None:
3902
      oprot.writeFieldBegin('merchantTxnId', TType.I64, 1)
3913
      oprot.writeFieldBegin('merchantTxnId', TType.I64, 1)
3903
      oprot.writeI64(self.merchantTxnId)
3914
      oprot.writeI64(self.merchantTxnId)
3904
      oprot.writeFieldEnd()
3915
      oprot.writeFieldEnd()
-
 
3916
    if self.isDigital is not None:
-
 
3917
      oprot.writeFieldBegin('isDigital', TType.BOOL, 2)
-
 
3918
      oprot.writeBool(self.isDigital)
-
 
3919
      oprot.writeFieldEnd()
3905
    oprot.writeFieldStop()
3920
    oprot.writeFieldStop()
3906
    oprot.writeStructEnd()
3921
    oprot.writeStructEnd()
3907
 
3922
 
3908
  def validate(self):
3923
  def validate(self):
3909
    return
3924
    return