Subversion Repositories SmartDukaan

Rev

Rev 696 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None


class Iface:
  def createPayment(self, user_id, cart_id, amount, gateway_id):
    """
    Parameters:
     - user_id
     - cart_id
     - amount
     - gateway_id
    """
    pass

  def createPaymentRequest(self, cart_id, application_id, merchant_tx_id, params):
    """
    Parameters:
     - cart_id
     - application_id
     - merchant_tx_id
     - params
    """
    pass

  def addCallbackUrl(self, application_id, callback_url, updateIfExisting):
    """
    Parameters:
     - application_id
     - callback_url
     - updateIfExisting
    """
    pass

  def getCallbackUrl(self, application_id):
    """
    Parameters:
     - application_id
    """
    pass

  def getPaymentsForUser(self, userId, from_time, to_time, status, gateway_id):
    """
    Parameters:
     - userId
     - from_time
     - to_time
     - status
     - gateway_id
    """
    pass

  def getPaymentsForCart(self, cartId, from_time, to_time, status, gateway_id):
    """
    Parameters:
     - cartId
     - from_time
     - to_time
     - status
     - gateway_id
    """
    pass

  def getPayments(self, from_time, to_time, status, gateway_id):
    """
    Parameters:
     - from_time
     - to_time
     - status
     - gateway_id
    """
    pass

  def getPaymentForMerchantId(self, merchant_tx_id):
    """
    Parameters:
     - merchant_tx_id
    """
    pass

  def changePaymentStatus(self, id, newStatus):
    """
    Parameters:
     - id
     - newStatus
    """
    pass

  def changePaymentRequestStatus(self, request_id, requestStatus):
    """
    Parameters:
     - request_id
     - requestStatus
    """
    pass

  def getPaymentGateways(self, status):
    """
    Parameters:
     - status
    """
    pass

  def getPaymentGateway(self, id):
    """
    Parameters:
     - id
    """
    pass

  def changeGatewayStatus(self, id, status):
    """
    Parameters:
     - id
     - status
    """
    pass

  def getPayment(self, id):
    """
    Parameters:
     - id
    """
    pass

  def addBankDetails(self, id, bid, btxid, error_code, session_id, postdate, auth_code, ref_code):
    """
    Parameters:
     - id
     - bid
     - btxid
     - error_code
     - session_id
     - postdate
     - auth_code
     - ref_code
    """
    pass


class Client(Iface):
  def __init__(self, iprot, oprot=None):
    self._iprot = self._oprot = iprot
    if oprot != None:
      self._oprot = oprot
    self._seqid = 0

  def createPayment(self, user_id, cart_id, amount, gateway_id):
    """
    Parameters:
     - user_id
     - cart_id
     - amount
     - gateway_id
    """
    self.send_createPayment(user_id, cart_id, amount, gateway_id)
    return self.recv_createPayment()

  def send_createPayment(self, user_id, cart_id, amount, gateway_id):
    self._oprot.writeMessageBegin('createPayment', TMessageType.CALL, self._seqid)
    args = createPayment_args()
    args.user_id = user_id
    args.cart_id = cart_id
    args.amount = amount
    args.gateway_id = gateway_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_createPayment(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = createPayment_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "createPayment failed: unknown result");

  def createPaymentRequest(self, cart_id, application_id, merchant_tx_id, params):
    """
    Parameters:
     - cart_id
     - application_id
     - merchant_tx_id
     - params
    """
    self.send_createPaymentRequest(cart_id, application_id, merchant_tx_id, params)
    self.recv_createPaymentRequest()

  def send_createPaymentRequest(self, cart_id, application_id, merchant_tx_id, params):
    self._oprot.writeMessageBegin('createPaymentRequest', TMessageType.CALL, self._seqid)
    args = createPaymentRequest_args()
    args.cart_id = cart_id
    args.application_id = application_id
    args.merchant_tx_id = merchant_tx_id
    args.params = params
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_createPaymentRequest(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = createPaymentRequest_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return

  def addCallbackUrl(self, application_id, callback_url, updateIfExisting):
    """
    Parameters:
     - application_id
     - callback_url
     - updateIfExisting
    """
    self.send_addCallbackUrl(application_id, callback_url, updateIfExisting)
    self.recv_addCallbackUrl()

  def send_addCallbackUrl(self, application_id, callback_url, updateIfExisting):
    self._oprot.writeMessageBegin('addCallbackUrl', TMessageType.CALL, self._seqid)
    args = addCallbackUrl_args()
    args.application_id = application_id
    args.callback_url = callback_url
    args.updateIfExisting = updateIfExisting
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addCallbackUrl(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addCallbackUrl_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return

  def getCallbackUrl(self, application_id):
    """
    Parameters:
     - application_id
    """
    self.send_getCallbackUrl(application_id)
    self.recv_getCallbackUrl()

  def send_getCallbackUrl(self, application_id):
    self._oprot.writeMessageBegin('getCallbackUrl', TMessageType.CALL, self._seqid)
    args = getCallbackUrl_args()
    args.application_id = application_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getCallbackUrl(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getCallbackUrl_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return

  def getPaymentsForUser(self, userId, from_time, to_time, status, gateway_id):
    """
    Parameters:
     - userId
     - from_time
     - to_time
     - status
     - gateway_id
    """
    self.send_getPaymentsForUser(userId, from_time, to_time, status, gateway_id)
    return self.recv_getPaymentsForUser()

  def send_getPaymentsForUser(self, userId, from_time, to_time, status, gateway_id):
    self._oprot.writeMessageBegin('getPaymentsForUser', TMessageType.CALL, self._seqid)
    args = getPaymentsForUser_args()
    args.userId = userId
    args.from_time = from_time
    args.to_time = to_time
    args.status = status
    args.gateway_id = gateway_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPaymentsForUser(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPaymentsForUser_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForUser failed: unknown result");

  def getPaymentsForCart(self, cartId, from_time, to_time, status, gateway_id):
    """
    Parameters:
     - cartId
     - from_time
     - to_time
     - status
     - gateway_id
    """
    self.send_getPaymentsForCart(cartId, from_time, to_time, status, gateway_id)
    return self.recv_getPaymentsForCart()

  def send_getPaymentsForCart(self, cartId, from_time, to_time, status, gateway_id):
    self._oprot.writeMessageBegin('getPaymentsForCart', TMessageType.CALL, self._seqid)
    args = getPaymentsForCart_args()
    args.cartId = cartId
    args.from_time = from_time
    args.to_time = to_time
    args.status = status
    args.gateway_id = gateway_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPaymentsForCart(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPaymentsForCart_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentsForCart failed: unknown result");

  def getPayments(self, from_time, to_time, status, gateway_id):
    """
    Parameters:
     - from_time
     - to_time
     - status
     - gateway_id
    """
    self.send_getPayments(from_time, to_time, status, gateway_id)
    return self.recv_getPayments()

  def send_getPayments(self, from_time, to_time, status, gateway_id):
    self._oprot.writeMessageBegin('getPayments', TMessageType.CALL, self._seqid)
    args = getPayments_args()
    args.from_time = from_time
    args.to_time = to_time
    args.status = status
    args.gateway_id = gateway_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPayments(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPayments_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPayments failed: unknown result");

  def getPaymentForMerchantId(self, merchant_tx_id):
    """
    Parameters:
     - merchant_tx_id
    """
    self.send_getPaymentForMerchantId(merchant_tx_id)
    return self.recv_getPaymentForMerchantId()

  def send_getPaymentForMerchantId(self, merchant_tx_id):
    self._oprot.writeMessageBegin('getPaymentForMerchantId', TMessageType.CALL, self._seqid)
    args = getPaymentForMerchantId_args()
    args.merchant_tx_id = merchant_tx_id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPaymentForMerchantId(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPaymentForMerchantId_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentForMerchantId failed: unknown result");

  def changePaymentStatus(self, id, newStatus):
    """
    Parameters:
     - id
     - newStatus
    """
    self.send_changePaymentStatus(id, newStatus)
    self.recv_changePaymentStatus()

  def send_changePaymentStatus(self, id, newStatus):
    self._oprot.writeMessageBegin('changePaymentStatus', TMessageType.CALL, self._seqid)
    args = changePaymentStatus_args()
    args.id = id
    args.newStatus = newStatus
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_changePaymentStatus(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = changePaymentStatus_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return

  def changePaymentRequestStatus(self, request_id, requestStatus):
    """
    Parameters:
     - request_id
     - requestStatus
    """
    self.send_changePaymentRequestStatus(request_id, requestStatus)
    self.recv_changePaymentRequestStatus()

  def send_changePaymentRequestStatus(self, request_id, requestStatus):
    self._oprot.writeMessageBegin('changePaymentRequestStatus', TMessageType.CALL, self._seqid)
    args = changePaymentRequestStatus_args()
    args.request_id = request_id
    args.requestStatus = requestStatus
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_changePaymentRequestStatus(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = changePaymentRequestStatus_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return

  def getPaymentGateways(self, status):
    """
    Parameters:
     - status
    """
    self.send_getPaymentGateways(status)
    return self.recv_getPaymentGateways()

  def send_getPaymentGateways(self, status):
    self._oprot.writeMessageBegin('getPaymentGateways', TMessageType.CALL, self._seqid)
    args = getPaymentGateways_args()
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPaymentGateways(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPaymentGateways_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentGateways failed: unknown result");

  def getPaymentGateway(self, id):
    """
    Parameters:
     - id
    """
    self.send_getPaymentGateway(id)
    return self.recv_getPaymentGateway()

  def send_getPaymentGateway(self, id):
    self._oprot.writeMessageBegin('getPaymentGateway', TMessageType.CALL, self._seqid)
    args = getPaymentGateway_args()
    args.id = id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPaymentGateway(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPaymentGateway_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPaymentGateway failed: unknown result");

  def changeGatewayStatus(self, id, status):
    """
    Parameters:
     - id
     - status
    """
    self.send_changeGatewayStatus(id, status)
    self.recv_changeGatewayStatus()

  def send_changeGatewayStatus(self, id, status):
    self._oprot.writeMessageBegin('changeGatewayStatus', TMessageType.CALL, self._seqid)
    args = changeGatewayStatus_args()
    args.id = id
    args.status = status
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_changeGatewayStatus(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = changeGatewayStatus_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return

  def getPayment(self, id):
    """
    Parameters:
     - id
    """
    self.send_getPayment(id)
    return self.recv_getPayment()

  def send_getPayment(self, id):
    self._oprot.writeMessageBegin('getPayment', TMessageType.CALL, self._seqid)
    args = getPayment_args()
    args.id = id
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_getPayment(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = getPayment_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success != None:
      return result.success
    if result.pe != None:
      raise result.pe
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getPayment failed: unknown result");

  def addBankDetails(self, id, bid, btxid, error_code, session_id, postdate, auth_code, ref_code):
    """
    Parameters:
     - id
     - bid
     - btxid
     - error_code
     - session_id
     - postdate
     - auth_code
     - ref_code
    """
    self.send_addBankDetails(id, bid, btxid, error_code, session_id, postdate, auth_code, ref_code)
    self.recv_addBankDetails()

  def send_addBankDetails(self, id, bid, btxid, error_code, session_id, postdate, auth_code, ref_code):
    self._oprot.writeMessageBegin('addBankDetails', TMessageType.CALL, self._seqid)
    args = addBankDetails_args()
    args.id = id
    args.bid = bid
    args.btxid = btxid
    args.error_code = error_code
    args.session_id = session_id
    args.postdate = postdate
    args.auth_code = auth_code
    args.ref_code = ref_code
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_addBankDetails(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = addBankDetails_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.pe != None:
      raise result.pe
    return


class Processor(Iface, TProcessor):
  def __init__(self, handler):
    self._handler = handler
    self._processMap = {}
    self._processMap["createPayment"] = Processor.process_createPayment
    self._processMap["createPaymentRequest"] = Processor.process_createPaymentRequest
    self._processMap["addCallbackUrl"] = Processor.process_addCallbackUrl
    self._processMap["getCallbackUrl"] = Processor.process_getCallbackUrl
    self._processMap["getPaymentsForUser"] = Processor.process_getPaymentsForUser
    self._processMap["getPaymentsForCart"] = Processor.process_getPaymentsForCart
    self._processMap["getPayments"] = Processor.process_getPayments
    self._processMap["getPaymentForMerchantId"] = Processor.process_getPaymentForMerchantId
    self._processMap["changePaymentStatus"] = Processor.process_changePaymentStatus
    self._processMap["changePaymentRequestStatus"] = Processor.process_changePaymentRequestStatus
    self._processMap["getPaymentGateways"] = Processor.process_getPaymentGateways
    self._processMap["getPaymentGateway"] = Processor.process_getPaymentGateway
    self._processMap["changeGatewayStatus"] = Processor.process_changeGatewayStatus
    self._processMap["getPayment"] = Processor.process_getPayment
    self._processMap["addBankDetails"] = Processor.process_addBankDetails

  def process(self, iprot, oprot):
    (name, type, seqid) = iprot.readMessageBegin()
    if name not in self._processMap:
      iprot.skip(TType.STRUCT)
      iprot.readMessageEnd()
      x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
      oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
      x.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()
      return
    else:
      self._processMap[name](self, seqid, iprot, oprot)
    return True

  def process_createPayment(self, seqid, iprot, oprot):
    args = createPayment_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = createPayment_result()
    try:
      result.success = self._handler.createPayment(args.user_id, args.cart_id, args.amount, args.gateway_id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("createPayment", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_createPaymentRequest(self, seqid, iprot, oprot):
    args = createPaymentRequest_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = createPaymentRequest_result()
    try:
      self._handler.createPaymentRequest(args.cart_id, args.application_id, args.merchant_tx_id, args.params)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("createPaymentRequest", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addCallbackUrl(self, seqid, iprot, oprot):
    args = addCallbackUrl_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addCallbackUrl_result()
    try:
      self._handler.addCallbackUrl(args.application_id, args.callback_url, args.updateIfExisting)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("addCallbackUrl", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getCallbackUrl(self, seqid, iprot, oprot):
    args = getCallbackUrl_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getCallbackUrl_result()
    try:
      self._handler.getCallbackUrl(args.application_id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getCallbackUrl", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPaymentsForUser(self, seqid, iprot, oprot):
    args = getPaymentsForUser_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPaymentsForUser_result()
    try:
      result.success = self._handler.getPaymentsForUser(args.userId, args.from_time, args.to_time, args.status, args.gateway_id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPaymentsForUser", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPaymentsForCart(self, seqid, iprot, oprot):
    args = getPaymentsForCart_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPaymentsForCart_result()
    try:
      result.success = self._handler.getPaymentsForCart(args.cartId, args.from_time, args.to_time, args.status, args.gateway_id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPaymentsForCart", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPayments(self, seqid, iprot, oprot):
    args = getPayments_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPayments_result()
    try:
      result.success = self._handler.getPayments(args.from_time, args.to_time, args.status, args.gateway_id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPayments", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPaymentForMerchantId(self, seqid, iprot, oprot):
    args = getPaymentForMerchantId_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPaymentForMerchantId_result()
    try:
      result.success = self._handler.getPaymentForMerchantId(args.merchant_tx_id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPaymentForMerchantId", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_changePaymentStatus(self, seqid, iprot, oprot):
    args = changePaymentStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = changePaymentStatus_result()
    try:
      self._handler.changePaymentStatus(args.id, args.newStatus)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("changePaymentStatus", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_changePaymentRequestStatus(self, seqid, iprot, oprot):
    args = changePaymentRequestStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = changePaymentRequestStatus_result()
    try:
      self._handler.changePaymentRequestStatus(args.request_id, args.requestStatus)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("changePaymentRequestStatus", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPaymentGateways(self, seqid, iprot, oprot):
    args = getPaymentGateways_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPaymentGateways_result()
    try:
      result.success = self._handler.getPaymentGateways(args.status)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPaymentGateways", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPaymentGateway(self, seqid, iprot, oprot):
    args = getPaymentGateway_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPaymentGateway_result()
    try:
      result.success = self._handler.getPaymentGateway(args.id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPaymentGateway", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_changeGatewayStatus(self, seqid, iprot, oprot):
    args = changeGatewayStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = changeGatewayStatus_result()
    try:
      self._handler.changeGatewayStatus(args.id, args.status)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("changeGatewayStatus", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_getPayment(self, seqid, iprot, oprot):
    args = getPayment_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getPayment_result()
    try:
      result.success = self._handler.getPayment(args.id)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("getPayment", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()

  def process_addBankDetails(self, seqid, iprot, oprot):
    args = addBankDetails_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = addBankDetails_result()
    try:
      self._handler.addBankDetails(args.id, args.bid, args.btxid, args.error_code, args.session_id, args.postdate, args.auth_code, args.ref_code)
    except PaymentException, pe:
      result.pe = pe
    oprot.writeMessageBegin("addBankDetails", TMessageType.REPLY, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES

class createPayment_args:
  """
  Attributes:
   - user_id
   - cart_id
   - amount
   - gateway_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'user_id', None, None, ), # 1
    (2, TType.I64, 'cart_id', None, None, ), # 2
    (3, TType.DOUBLE, 'amount', None, None, ), # 3
    (4, TType.I64, 'gateway_id', None, None, ), # 4
  )

  def __init__(self, user_id=None, cart_id=None, amount=None, gateway_id=None,):
    self.user_id = user_id
    self.cart_id = cart_id
    self.amount = amount
    self.gateway_id = gateway_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.user_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.cart_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.amount = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.gateway_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createPayment_args')
    if self.user_id != None:
      oprot.writeFieldBegin('user_id', TType.I64, 1)
      oprot.writeI64(self.user_id)
      oprot.writeFieldEnd()
    if self.cart_id != None:
      oprot.writeFieldBegin('cart_id', TType.I64, 2)
      oprot.writeI64(self.cart_id)
      oprot.writeFieldEnd()
    if self.amount != None:
      oprot.writeFieldBegin('amount', TType.DOUBLE, 3)
      oprot.writeDouble(self.amount)
      oprot.writeFieldEnd()
    if self.gateway_id != None:
      oprot.writeFieldBegin('gateway_id', TType.I64, 4)
      oprot.writeI64(self.gateway_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createPayment_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.I64, 'success', None, None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.I64:
          self.success = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createPayment_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.I64, 0)
      oprot.writeI64(self.success)
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createPaymentRequest_args:
  """
  Attributes:
   - cart_id
   - application_id
   - merchant_tx_id
   - params
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cart_id', None, None, ), # 1
    (2, TType.I64, 'application_id', None, None, ), # 2
    (3, TType.I64, 'merchant_tx_id', None, None, ), # 3
    None, # 4
    (5, TType.LIST, 'params', (TType.STRUCT,(Param, Param.thrift_spec)), None, ), # 5
  )

  def __init__(self, cart_id=None, application_id=None, merchant_tx_id=None, params=None,):
    self.cart_id = cart_id
    self.application_id = application_id
    self.merchant_tx_id = merchant_tx_id
    self.params = params

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cart_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.application_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.merchant_tx_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.LIST:
          self.params = []
          (_etype28, _size25) = iprot.readListBegin()
          for _i29 in xrange(_size25):
            _elem30 = Param()
            _elem30.read(iprot)
            self.params.append(_elem30)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createPaymentRequest_args')
    if self.cart_id != None:
      oprot.writeFieldBegin('cart_id', TType.I64, 1)
      oprot.writeI64(self.cart_id)
      oprot.writeFieldEnd()
    if self.application_id != None:
      oprot.writeFieldBegin('application_id', TType.I64, 2)
      oprot.writeI64(self.application_id)
      oprot.writeFieldEnd()
    if self.merchant_tx_id != None:
      oprot.writeFieldBegin('merchant_tx_id', TType.I64, 3)
      oprot.writeI64(self.merchant_tx_id)
      oprot.writeFieldEnd()
    if self.params != None:
      oprot.writeFieldBegin('params', TType.LIST, 5)
      oprot.writeListBegin(TType.STRUCT, len(self.params))
      for iter31 in self.params:
        iter31.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class createPaymentRequest_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('createPaymentRequest_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addCallbackUrl_args:
  """
  Attributes:
   - application_id
   - callback_url
   - updateIfExisting
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'application_id', None, None, ), # 1
    (2, TType.STRING, 'callback_url', None, None, ), # 2
    (3, TType.BOOL, 'updateIfExisting', None, None, ), # 3
  )

  def __init__(self, application_id=None, callback_url=None, updateIfExisting=None,):
    self.application_id = application_id
    self.callback_url = callback_url
    self.updateIfExisting = updateIfExisting

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.application_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.callback_url = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.updateIfExisting = iprot.readBool();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addCallbackUrl_args')
    if self.application_id != None:
      oprot.writeFieldBegin('application_id', TType.I64, 1)
      oprot.writeI64(self.application_id)
      oprot.writeFieldEnd()
    if self.callback_url != None:
      oprot.writeFieldBegin('callback_url', TType.STRING, 2)
      oprot.writeString(self.callback_url)
      oprot.writeFieldEnd()
    if self.updateIfExisting != None:
      oprot.writeFieldBegin('updateIfExisting', TType.BOOL, 3)
      oprot.writeBool(self.updateIfExisting)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addCallbackUrl_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addCallbackUrl_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCallbackUrl_args:
  """
  Attributes:
   - application_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'application_id', None, None, ), # 1
  )

  def __init__(self, application_id=None,):
    self.application_id = application_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.application_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCallbackUrl_args')
    if self.application_id != None:
      oprot.writeFieldBegin('application_id', TType.I64, 1)
      oprot.writeI64(self.application_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getCallbackUrl_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getCallbackUrl_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentsForUser_args:
  """
  Attributes:
   - userId
   - from_time
   - to_time
   - status
   - gateway_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'userId', None, None, ), # 1
    (2, TType.I64, 'from_time', None, None, ), # 2
    (3, TType.I64, 'to_time', None, None, ), # 3
    (4, TType.I32, 'status', None, None, ), # 4
    (5, TType.I64, 'gateway_id', None, None, ), # 5
  )

  def __init__(self, userId=None, from_time=None, to_time=None, status=None, gateway_id=None,):
    self.userId = userId
    self.from_time = from_time
    self.to_time = to_time
    self.status = status
    self.gateway_id = gateway_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.userId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.from_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.to_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.gateway_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentsForUser_args')
    if self.userId != None:
      oprot.writeFieldBegin('userId', TType.I64, 1)
      oprot.writeI64(self.userId)
      oprot.writeFieldEnd()
    if self.from_time != None:
      oprot.writeFieldBegin('from_time', TType.I64, 2)
      oprot.writeI64(self.from_time)
      oprot.writeFieldEnd()
    if self.to_time != None:
      oprot.writeFieldBegin('to_time', TType.I64, 3)
      oprot.writeI64(self.to_time)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 4)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    if self.gateway_id != None:
      oprot.writeFieldBegin('gateway_id', TType.I64, 5)
      oprot.writeI64(self.gateway_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentsForUser_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Payment, Payment.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype35, _size32) = iprot.readListBegin()
          for _i36 in xrange(_size32):
            _elem37 = Payment()
            _elem37.read(iprot)
            self.success.append(_elem37)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentsForUser_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter38 in self.success:
        iter38.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentsForCart_args:
  """
  Attributes:
   - cartId
   - from_time
   - to_time
   - status
   - gateway_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'cartId', None, None, ), # 1
    (2, TType.I64, 'from_time', None, None, ), # 2
    (3, TType.I64, 'to_time', None, None, ), # 3
    (4, TType.I32, 'status', None, None, ), # 4
    (5, TType.I64, 'gateway_id', None, None, ), # 5
  )

  def __init__(self, cartId=None, from_time=None, to_time=None, status=None, gateway_id=None,):
    self.cartId = cartId
    self.from_time = from_time
    self.to_time = to_time
    self.status = status
    self.gateway_id = gateway_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.cartId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.from_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.to_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.gateway_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentsForCart_args')
    if self.cartId != None:
      oprot.writeFieldBegin('cartId', TType.I64, 1)
      oprot.writeI64(self.cartId)
      oprot.writeFieldEnd()
    if self.from_time != None:
      oprot.writeFieldBegin('from_time', TType.I64, 2)
      oprot.writeI64(self.from_time)
      oprot.writeFieldEnd()
    if self.to_time != None:
      oprot.writeFieldBegin('to_time', TType.I64, 3)
      oprot.writeI64(self.to_time)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 4)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    if self.gateway_id != None:
      oprot.writeFieldBegin('gateway_id', TType.I64, 5)
      oprot.writeI64(self.gateway_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentsForCart_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Payment, Payment.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype42, _size39) = iprot.readListBegin()
          for _i43 in xrange(_size39):
            _elem44 = Payment()
            _elem44.read(iprot)
            self.success.append(_elem44)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentsForCart_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter45 in self.success:
        iter45.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPayments_args:
  """
  Attributes:
   - from_time
   - to_time
   - status
   - gateway_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'from_time', None, None, ), # 1
    (2, TType.I64, 'to_time', None, None, ), # 2
    (3, TType.I32, 'status', None, None, ), # 3
    (4, TType.I64, 'gateway_id', None, None, ), # 4
  )

  def __init__(self, from_time=None, to_time=None, status=None, gateway_id=None,):
    self.from_time = from_time
    self.to_time = to_time
    self.status = status
    self.gateway_id = gateway_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.from_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.to_time = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.gateway_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPayments_args')
    if self.from_time != None:
      oprot.writeFieldBegin('from_time', TType.I64, 1)
      oprot.writeI64(self.from_time)
      oprot.writeFieldEnd()
    if self.to_time != None:
      oprot.writeFieldBegin('to_time', TType.I64, 2)
      oprot.writeI64(self.to_time)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 3)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    if self.gateway_id != None:
      oprot.writeFieldBegin('gateway_id', TType.I64, 4)
      oprot.writeI64(self.gateway_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPayments_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Payment, Payment.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype49, _size46) = iprot.readListBegin()
          for _i50 in xrange(_size46):
            _elem51 = Payment()
            _elem51.read(iprot)
            self.success.append(_elem51)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPayments_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter52 in self.success:
        iter52.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentForMerchantId_args:
  """
  Attributes:
   - merchant_tx_id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'merchant_tx_id', None, None, ), # 1
  )

  def __init__(self, merchant_tx_id=None,):
    self.merchant_tx_id = merchant_tx_id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.merchant_tx_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentForMerchantId_args')
    if self.merchant_tx_id != None:
      oprot.writeFieldBegin('merchant_tx_id', TType.I64, 1)
      oprot.writeI64(self.merchant_tx_id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentForMerchantId_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(Payment, Payment.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype56, _size53) = iprot.readListBegin()
          for _i57 in xrange(_size53):
            _elem58 = Payment()
            _elem58.read(iprot)
            self.success.append(_elem58)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentForMerchantId_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter59 in self.success:
        iter59.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changePaymentStatus_args:
  """
  Attributes:
   - id
   - newStatus
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    (2, TType.I32, 'newStatus', None, None, ), # 2
  )

  def __init__(self, id=None, newStatus=None,):
    self.id = id
    self.newStatus = newStatus

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.newStatus = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changePaymentStatus_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.newStatus != None:
      oprot.writeFieldBegin('newStatus', TType.I32, 2)
      oprot.writeI32(self.newStatus)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changePaymentStatus_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changePaymentStatus_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changePaymentRequestStatus_args:
  """
  Attributes:
   - request_id
   - requestStatus
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'request_id', None, None, ), # 1
    (2, TType.I32, 'requestStatus', None, None, ), # 2
  )

  def __init__(self, request_id=None, requestStatus=None,):
    self.request_id = request_id
    self.requestStatus = requestStatus

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.request_id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.requestStatus = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changePaymentRequestStatus_args')
    if self.request_id != None:
      oprot.writeFieldBegin('request_id', TType.I64, 1)
      oprot.writeI64(self.request_id)
      oprot.writeFieldEnd()
    if self.requestStatus != None:
      oprot.writeFieldBegin('requestStatus', TType.I32, 2)
      oprot.writeI32(self.requestStatus)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changePaymentRequestStatus_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changePaymentRequestStatus_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentGateways_args:
  """
  Attributes:
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'status', None, None, ), # 1
  )

  def __init__(self, status=None,):
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentGateways_args')
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 1)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentGateways_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.LIST, 'success', (TType.STRUCT,(PaymentGateway, PaymentGateway.thrift_spec)), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.LIST:
          self.success = []
          (_etype63, _size60) = iprot.readListBegin()
          for _i64 in xrange(_size60):
            _elem65 = PaymentGateway()
            _elem65.read(iprot)
            self.success.append(_elem65)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentGateways_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.LIST, 0)
      oprot.writeListBegin(TType.STRUCT, len(self.success))
      for iter66 in self.success:
        iter66.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentGateway_args:
  """
  Attributes:
   - id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
  )

  def __init__(self, id=None,):
    self.id = id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentGateway_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPaymentGateway_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (PaymentGateway, PaymentGateway.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = PaymentGateway()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPaymentGateway_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeGatewayStatus_args:
  """
  Attributes:
   - id
   - status
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    (2, TType.I32, 'status', None, None, ), # 2
  )

  def __init__(self, id=None, status=None,):
    self.id = id
    self.status = status

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.status = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeGatewayStatus_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.status != None:
      oprot.writeFieldBegin('status', TType.I32, 2)
      oprot.writeI32(self.status)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class changeGatewayStatus_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('changeGatewayStatus_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPayment_args:
  """
  Attributes:
   - id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
  )

  def __init__(self, id=None,):
    self.id = id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPayment_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class getPayment_result:
  """
  Attributes:
   - success
   - pe
  """

  thrift_spec = (
    (0, TType.STRUCT, 'success', (Payment, Payment.thrift_spec), None, ), # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, success=None, pe=None,):
    self.success = success
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 0:
        if ftype == TType.STRUCT:
          self.success = Payment()
          self.success.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('getPayment_result')
    if self.success != None:
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
      self.success.write(oprot)
      oprot.writeFieldEnd()
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addBankDetails_args:
  """
  Attributes:
   - id
   - bid
   - btxid
   - error_code
   - session_id
   - postdate
   - auth_code
   - ref_code
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    (2, TType.STRING, 'bid', None, None, ), # 2
    (3, TType.STRING, 'btxid', None, None, ), # 3
    (4, TType.STRING, 'error_code', None, None, ), # 4
    (5, TType.STRING, 'session_id', None, None, ), # 5
    (6, TType.STRING, 'postdate', None, None, ), # 6
    (7, TType.STRING, 'auth_code', None, None, ), # 7
    (8, TType.STRING, 'ref_code', None, None, ), # 8
  )

  def __init__(self, id=None, bid=None, btxid=None, error_code=None, session_id=None, postdate=None, auth_code=None, ref_code=None,):
    self.id = id
    self.bid = bid
    self.btxid = btxid
    self.error_code = error_code
    self.session_id = session_id
    self.postdate = postdate
    self.auth_code = auth_code
    self.ref_code = ref_code

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.bid = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.btxid = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.error_code = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.session_id = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.postdate = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.auth_code = iprot.readString();
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.ref_code = iprot.readString();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addBankDetails_args')
    if self.id != None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.bid != None:
      oprot.writeFieldBegin('bid', TType.STRING, 2)
      oprot.writeString(self.bid)
      oprot.writeFieldEnd()
    if self.btxid != None:
      oprot.writeFieldBegin('btxid', TType.STRING, 3)
      oprot.writeString(self.btxid)
      oprot.writeFieldEnd()
    if self.error_code != None:
      oprot.writeFieldBegin('error_code', TType.STRING, 4)
      oprot.writeString(self.error_code)
      oprot.writeFieldEnd()
    if self.session_id != None:
      oprot.writeFieldBegin('session_id', TType.STRING, 5)
      oprot.writeString(self.session_id)
      oprot.writeFieldEnd()
    if self.postdate != None:
      oprot.writeFieldBegin('postdate', TType.STRING, 6)
      oprot.writeString(self.postdate)
      oprot.writeFieldEnd()
    if self.auth_code != None:
      oprot.writeFieldBegin('auth_code', TType.STRING, 7)
      oprot.writeString(self.auth_code)
      oprot.writeFieldEnd()
    if self.ref_code != None:
      oprot.writeFieldBegin('ref_code', TType.STRING, 8)
      oprot.writeString(self.ref_code)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class addBankDetails_result:
  """
  Attributes:
   - pe
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRUCT, 'pe', (PaymentException, PaymentException.thrift_spec), None, ), # 1
  )

  def __init__(self, pe=None,):
    self.pe = pe

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.pe = PaymentException()
          self.pe.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('addBankDetails_result')
    if self.pe != None:
      oprot.writeFieldBegin('pe', TType.STRUCT, 1)
      self.pe.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)