Subversion Repositories SmartDukaan

Rev

Rev 18577 | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * Autogenerated by Thrift Compiler (0.7.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */
package in.shop2020.payments;

import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PaymentService {

  public interface Iface extends in.shop2020.generic.GenericService.Iface {

    /**
     * create a new payment and return payment id, throws an exception if gateway is not active
     * 
     * @param userId
     * @param amount
     * @param gatewayId
     * @param txnId
     * @param isDigital
     */
    public long createPayment(long userId, double amount, long gatewayId, long txnId, boolean isDigital) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get all payments for user. If status and gateway are null, they are ignored. Same for times as well.
     * 
     * @param userId
     * @param fromTime
     * @param toTime
     * @param status
     * @param gatewayId
     */
    public List<Payment> getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get all payments in the given status for the given gateway. If gatewayId is 0, then it is ignored.
     * 
     * @param fromTime
     * @param toTime
     * @param status
     * @param gatewayId
     */
    public List<Payment> getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get all payments for the given gateway which were captured between the given dates. If the gatewayId is 0, it's ignored.
     * 
     * @param fromTime
     * @param toTime
     * @param gatewayId
     */
    public List<Payment> getPaymentsByCapturedDate(long fromTime, long toTime, long gatewayId) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get the gateway for the given id.
     * 
     * @param id
     */
    public PaymentGateway getPaymentGateway(long id) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get all active Payment Gateways
     * 
     */
    public List<PaymentGateway> getActivePaymentGateways() throws PaymentException, org.apache.thrift.TException;

    /**
     * Get a particular payment info
     * 
     * 
     * @param id
     */
    public Payment getPayment(long id) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get payments for a transaction. Will raise exception.
     * 
     * 
     * @param txnId
     */
    public List<Payment> getPaymentForTxnId(long txnId) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get payments for a recharge transaction id. Will raise exception.
     * 
     * 
     * @param txnId
     */
    public List<Payment> getPaymentForRechargeTxnId(long txnId) throws PaymentException, org.apache.thrift.TException;

    /**
     * Get successful payment for a transaction. Will raise exception.
     * 
     * 
     * @param txnId
     */
    public Payment getSuccessfulPaymentForTxnId(long txnId) throws PaymentException, org.apache.thrift.TException;

    /**
     * mark payment successful and store parameters
     * 
     * 
     * @param id
     * @param gatewayPaymentId
     * @param sessionId
     * @param gatewayTxnStatus
     * @param description
     * @param gatewayTxnId
     * @param authCode
     * @param referenceCode
     * @param errorCode
     * @param status
     * @param gatewayTxnDate
     * @param attributes
     */
    public boolean updatePaymentDetails(long id, String gatewayPaymentId, String sessionId, String gatewayTxnStatus, String description, String gatewayTxnId, String authCode, String referenceCode, String errorCode, PaymentStatus status, String gatewayTxnDate, List<Attribute> attributes) throws PaymentException, org.apache.thrift.TException;

    /**
     * Returns the minimum and maximum amounts among successful payments.
     * List contains two double values, first minimum and second maximum amount.
     */
    public List<Double> getSuccessfulPaymentsAmountRange() throws org.apache.thrift.TException;

    /**
     * Initialize the payment pipe for a HDFC payment. The URL the user should be redirected to is returned.
     * In case of any processing error, an exception is raised.
     * 
     * @param merchantPaymentId
     * @param isMobile
     */
    public String initializeHdfcPayment(long merchantPaymentId, boolean isMobile) throws PaymentException, org.apache.thrift.TException;

    /**
     * Initialize the payment pipe for a HDFC payment in case of a digital order. The URL the user should be redirected to is returned.
     * In case of any processing error, an exception is raised. The phone is a madatory field and is required in case of dth payments.
     * 
     * @param merchantPaymentId
     * @param rechargeOrderId
     * @param phone
     * @param isMobile
     */
    public String doHdfcPaymentForDigitalOrder(long merchantPaymentId, long rechargeOrderId, String phone, boolean isMobile) throws PaymentException, org.apache.thrift.TException;

    /**
     * Initialize the payment pipe for a HDFC EMI payment. The URL the user should be redirected to is returned.
     * In case of any processing error, an exception is raised.
     * 
     * @param merchantPaymentId
     * @param isMobile
     */
    public String initializeHdfcEmiPayment(long merchantPaymentId, boolean isMobile) throws PaymentException, org.apache.thrift.TException;

    /**
     * Create a refund of the given amount corresponding to the given order to be processed through the same
     * payment gateway which processed the payment for the corresponding transaction.
     * Returns the id of the newly created Refund.
     * 
     * @param orderId
     * @param merchantTxnId
     * @param amount
     */
    public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, org.apache.thrift.TException;

    /**
     * Capture the payment for the given merchant transaction id. It processes the last payment for the given
     * transaction. If the capture attempt failed, the payment is marked as failed. PaymentException with error
     * code 104 is      thrown in case no payments are found for the transaction id passed. PaymentException is also
     * thrown with error code 106 in case capture was not possible due to connection
     * issue.
     * 
     * @param merchantTxnId
     * @param isDigital
     */
    public boolean capturePayment(long merchantTxnId, boolean isDigital) throws PaymentException, org.apache.thrift.TException;

    /**
     * Refund the payment for the given merchant transaction id. It processes the last payment for the given
     * transaction. If refund will be failed nothing will be updated in database.
     * 
     * @param merchantTxnId
     * @param amount
     * @param isDigital
     */
    public boolean refundPayment(long merchantTxnId, double amount, boolean isDigital) throws PaymentException, org.apache.thrift.TException;

    /**
     * Adds the given amount to the captured amount of a COD payment.
     * Updates the captured amount for the corresponding payment and marks it as PARTIALLY CAPTURED.
     * If the captured amount becomes equal to total amount, then the payment status is set as SUCCESS.
     * Also sets the name of the entity which transferred the money, the date on which it was transferred
     * and the corresponding transaction id.
     * 
     * Returns false if the payment couldn't be captured.
     * Throws exception if no such payment could be found or if the captured amount will exceed the total amount after capturing.
     * 
     * @param merchantTxnId
     * @param amount
     * @param xferBy
     * @param xferTxnId
     * @param xferDate
     */
    public boolean partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate) throws PaymentException, org.apache.thrift.TException;

    /**
     * Returns the list of payments that require some extra processing and
     * which belong to a particular category. This is currently used by CRM
     * application.
     * 
     * @param category
     */
    public List<Long> getPaymentsRequiringExtraProcessing(ExtraPaymentProcessingType category) throws org.apache.thrift.TException;

    /**
     * Marks a particular payment as processed for a particular cateogory.
     * It essentially deletes the payment if it is processed for a particular
     * category. This is currently used by CRM application.
     * 
     * @param paymentId
     * @param category
     */
    public void markPaymentAsProcessed(long paymentId, ExtraPaymentProcessingType category) throws org.apache.thrift.TException;

    public PaymentStatus getPaymentStatusAtGateway(long merchantTxnId, double amount, boolean isDigital) throws PaymentException, org.apache.thrift.TException;

  }

  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {

    public void createPayment(long userId, double amount, long gatewayId, long txnId, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPayment_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentsForUser_call> resultHandler) throws org.apache.thrift.TException;

    public void getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPayments_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentsByCapturedDate(long fromTime, long toTime, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentsByCapturedDate_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentGateway(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentGateway_call> resultHandler) throws org.apache.thrift.TException;

    public void getActivePaymentGateways(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActivePaymentGateways_call> resultHandler) throws org.apache.thrift.TException;

    public void getPayment(long id, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPayment_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentForTxnId(long txnId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentForTxnId_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentForRechargeTxnId(long txnId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentForRechargeTxnId_call> resultHandler) throws org.apache.thrift.TException;

    public void getSuccessfulPaymentForTxnId(long txnId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentForTxnId_call> resultHandler) throws org.apache.thrift.TException;

    public void updatePaymentDetails(long id, String gatewayPaymentId, String sessionId, String gatewayTxnStatus, String description, String gatewayTxnId, String authCode, String referenceCode, String errorCode, PaymentStatus status, String gatewayTxnDate, List<Attribute> attributes, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.updatePaymentDetails_call> resultHandler) throws org.apache.thrift.TException;

    public void getSuccessfulPaymentsAmountRange(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentsAmountRange_call> resultHandler) throws org.apache.thrift.TException;

    public void initializeHdfcPayment(long merchantPaymentId, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.initializeHdfcPayment_call> resultHandler) throws org.apache.thrift.TException;

    public void doHdfcPaymentForDigitalOrder(long merchantPaymentId, long rechargeOrderId, String phone, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.doHdfcPaymentForDigitalOrder_call> resultHandler) throws org.apache.thrift.TException;

    public void initializeHdfcEmiPayment(long merchantPaymentId, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.initializeHdfcEmiPayment_call> resultHandler) throws org.apache.thrift.TException;

    public void createRefund(long orderId, long merchantTxnId, double amount, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createRefund_call> resultHandler) throws org.apache.thrift.TException;

    public void capturePayment(long merchantTxnId, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.capturePayment_call> resultHandler) throws org.apache.thrift.TException;

    public void refundPayment(long merchantTxnId, double amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.refundPayment_call> resultHandler) throws org.apache.thrift.TException;

    public void partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.partiallyCapturePayment_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentsRequiringExtraProcessing(ExtraPaymentProcessingType category, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentsRequiringExtraProcessing_call> resultHandler) throws org.apache.thrift.TException;

    public void markPaymentAsProcessed(long paymentId, ExtraPaymentProcessingType category, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markPaymentAsProcessed_call> resultHandler) throws org.apache.thrift.TException;

    public void getPaymentStatusAtGateway(long merchantTxnId, double amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPaymentStatusAtGateway_call> resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
      public Factory() {}
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
        return new Client(prot);
      }
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
        return new Client(iprot, oprot);
      }
    }

    public Client(org.apache.thrift.protocol.TProtocol prot)
    {
      super(prot, prot);
    }

    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
      super(iprot, oprot);
    }

    public long createPayment(long userId, double amount, long gatewayId, long txnId, boolean isDigital) throws PaymentException, org.apache.thrift.TException
    {
      send_createPayment(userId, amount, gatewayId, txnId, isDigital);
      return recv_createPayment();
    }

    public void send_createPayment(long userId, double amount, long gatewayId, long txnId, boolean isDigital) throws org.apache.thrift.TException
    {
      createPayment_args args = new createPayment_args();
      args.setUserId(userId);
      args.setAmount(amount);
      args.setGatewayId(gatewayId);
      args.setTxnId(txnId);
      args.setIsDigital(isDigital);
      sendBase("createPayment", args);
    }

    public long recv_createPayment() throws PaymentException, org.apache.thrift.TException
    {
      createPayment_result result = new createPayment_result();
      receiveBase(result, "createPayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createPayment failed: unknown result");
    }

    public List<Payment> getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, org.apache.thrift.TException
    {
      send_getPaymentsForUser(userId, fromTime, toTime, status, gatewayId);
      return recv_getPaymentsForUser();
    }

    public void send_getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws org.apache.thrift.TException
    {
      getPaymentsForUser_args args = new getPaymentsForUser_args();
      args.setUserId(userId);
      args.setFromTime(fromTime);
      args.setToTime(toTime);
      args.setStatus(status);
      args.setGatewayId(gatewayId);
      sendBase("getPaymentsForUser", args);
    }

    public List<Payment> recv_getPaymentsForUser() throws PaymentException, org.apache.thrift.TException
    {
      getPaymentsForUser_result result = new getPaymentsForUser_result();
      receiveBase(result, "getPaymentsForUser");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentsForUser failed: unknown result");
    }

    public List<Payment> getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, org.apache.thrift.TException
    {
      send_getPayments(fromTime, toTime, status, gatewayId);
      return recv_getPayments();
    }

    public void send_getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId) throws org.apache.thrift.TException
    {
      getPayments_args args = new getPayments_args();
      args.setFromTime(fromTime);
      args.setToTime(toTime);
      args.setStatus(status);
      args.setGatewayId(gatewayId);
      sendBase("getPayments", args);
    }

    public List<Payment> recv_getPayments() throws PaymentException, org.apache.thrift.TException
    {
      getPayments_result result = new getPayments_result();
      receiveBase(result, "getPayments");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPayments failed: unknown result");
    }

    public List<Payment> getPaymentsByCapturedDate(long fromTime, long toTime, long gatewayId) throws PaymentException, org.apache.thrift.TException
    {
      send_getPaymentsByCapturedDate(fromTime, toTime, gatewayId);
      return recv_getPaymentsByCapturedDate();
    }

    public void send_getPaymentsByCapturedDate(long fromTime, long toTime, long gatewayId) throws org.apache.thrift.TException
    {
      getPaymentsByCapturedDate_args args = new getPaymentsByCapturedDate_args();
      args.setFromTime(fromTime);
      args.setToTime(toTime);
      args.setGatewayId(gatewayId);
      sendBase("getPaymentsByCapturedDate", args);
    }

    public List<Payment> recv_getPaymentsByCapturedDate() throws PaymentException, org.apache.thrift.TException
    {
      getPaymentsByCapturedDate_result result = new getPaymentsByCapturedDate_result();
      receiveBase(result, "getPaymentsByCapturedDate");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentsByCapturedDate failed: unknown result");
    }

    public PaymentGateway getPaymentGateway(long id) throws PaymentException, org.apache.thrift.TException
    {
      send_getPaymentGateway(id);
      return recv_getPaymentGateway();
    }

    public void send_getPaymentGateway(long id) throws org.apache.thrift.TException
    {
      getPaymentGateway_args args = new getPaymentGateway_args();
      args.setId(id);
      sendBase("getPaymentGateway", args);
    }

    public PaymentGateway recv_getPaymentGateway() throws PaymentException, org.apache.thrift.TException
    {
      getPaymentGateway_result result = new getPaymentGateway_result();
      receiveBase(result, "getPaymentGateway");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentGateway failed: unknown result");
    }

    public List<PaymentGateway> getActivePaymentGateways() throws PaymentException, org.apache.thrift.TException
    {
      send_getActivePaymentGateways();
      return recv_getActivePaymentGateways();
    }

    public void send_getActivePaymentGateways() throws org.apache.thrift.TException
    {
      getActivePaymentGateways_args args = new getActivePaymentGateways_args();
      sendBase("getActivePaymentGateways", args);
    }

    public List<PaymentGateway> recv_getActivePaymentGateways() throws PaymentException, org.apache.thrift.TException
    {
      getActivePaymentGateways_result result = new getActivePaymentGateways_result();
      receiveBase(result, "getActivePaymentGateways");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActivePaymentGateways failed: unknown result");
    }

    public Payment getPayment(long id) throws PaymentException, org.apache.thrift.TException
    {
      send_getPayment(id);
      return recv_getPayment();
    }

    public void send_getPayment(long id) throws org.apache.thrift.TException
    {
      getPayment_args args = new getPayment_args();
      args.setId(id);
      sendBase("getPayment", args);
    }

    public Payment recv_getPayment() throws PaymentException, org.apache.thrift.TException
    {
      getPayment_result result = new getPayment_result();
      receiveBase(result, "getPayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPayment failed: unknown result");
    }

    public List<Payment> getPaymentForTxnId(long txnId) throws PaymentException, org.apache.thrift.TException
    {
      send_getPaymentForTxnId(txnId);
      return recv_getPaymentForTxnId();
    }

    public void send_getPaymentForTxnId(long txnId) throws org.apache.thrift.TException
    {
      getPaymentForTxnId_args args = new getPaymentForTxnId_args();
      args.setTxnId(txnId);
      sendBase("getPaymentForTxnId", args);
    }

    public List<Payment> recv_getPaymentForTxnId() throws PaymentException, org.apache.thrift.TException
    {
      getPaymentForTxnId_result result = new getPaymentForTxnId_result();
      receiveBase(result, "getPaymentForTxnId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentForTxnId failed: unknown result");
    }

    public List<Payment> getPaymentForRechargeTxnId(long txnId) throws PaymentException, org.apache.thrift.TException
    {
      send_getPaymentForRechargeTxnId(txnId);
      return recv_getPaymentForRechargeTxnId();
    }

    public void send_getPaymentForRechargeTxnId(long txnId) throws org.apache.thrift.TException
    {
      getPaymentForRechargeTxnId_args args = new getPaymentForRechargeTxnId_args();
      args.setTxnId(txnId);
      sendBase("getPaymentForRechargeTxnId", args);
    }

    public List<Payment> recv_getPaymentForRechargeTxnId() throws PaymentException, org.apache.thrift.TException
    {
      getPaymentForRechargeTxnId_result result = new getPaymentForRechargeTxnId_result();
      receiveBase(result, "getPaymentForRechargeTxnId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentForRechargeTxnId failed: unknown result");
    }

    public Payment getSuccessfulPaymentForTxnId(long txnId) throws PaymentException, org.apache.thrift.TException
    {
      send_getSuccessfulPaymentForTxnId(txnId);
      return recv_getSuccessfulPaymentForTxnId();
    }

    public void send_getSuccessfulPaymentForTxnId(long txnId) throws org.apache.thrift.TException
    {
      getSuccessfulPaymentForTxnId_args args = new getSuccessfulPaymentForTxnId_args();
      args.setTxnId(txnId);
      sendBase("getSuccessfulPaymentForTxnId", args);
    }

    public Payment recv_getSuccessfulPaymentForTxnId() throws PaymentException, org.apache.thrift.TException
    {
      getSuccessfulPaymentForTxnId_result result = new getSuccessfulPaymentForTxnId_result();
      receiveBase(result, "getSuccessfulPaymentForTxnId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentForTxnId failed: unknown result");
    }

    public boolean updatePaymentDetails(long id, String gatewayPaymentId, String sessionId, String gatewayTxnStatus, String description, String gatewayTxnId, String authCode, String referenceCode, String errorCode, PaymentStatus status, String gatewayTxnDate, List<Attribute> attributes) throws PaymentException, org.apache.thrift.TException
    {
      send_updatePaymentDetails(id, gatewayPaymentId, sessionId, gatewayTxnStatus, description, gatewayTxnId, authCode, referenceCode, errorCode, status, gatewayTxnDate, attributes);
      return recv_updatePaymentDetails();
    }

    public void send_updatePaymentDetails(long id, String gatewayPaymentId, String sessionId, String gatewayTxnStatus, String description, String gatewayTxnId, String authCode, String referenceCode, String errorCode, PaymentStatus status, String gatewayTxnDate, List<Attribute> attributes) throws org.apache.thrift.TException
    {
      updatePaymentDetails_args args = new updatePaymentDetails_args();
      args.setId(id);
      args.setGatewayPaymentId(gatewayPaymentId);
      args.setSessionId(sessionId);
      args.setGatewayTxnStatus(gatewayTxnStatus);
      args.setDescription(description);
      args.setGatewayTxnId(gatewayTxnId);
      args.setAuthCode(authCode);
      args.setReferenceCode(referenceCode);
      args.setErrorCode(errorCode);
      args.setStatus(status);
      args.setGatewayTxnDate(gatewayTxnDate);
      args.setAttributes(attributes);
      sendBase("updatePaymentDetails", args);
    }

    public boolean recv_updatePaymentDetails() throws PaymentException, org.apache.thrift.TException
    {
      updatePaymentDetails_result result = new updatePaymentDetails_result();
      receiveBase(result, "updatePaymentDetails");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updatePaymentDetails failed: unknown result");
    }

    public List<Double> getSuccessfulPaymentsAmountRange() throws org.apache.thrift.TException
    {
      send_getSuccessfulPaymentsAmountRange();
      return recv_getSuccessfulPaymentsAmountRange();
    }

    public void send_getSuccessfulPaymentsAmountRange() throws org.apache.thrift.TException
    {
      getSuccessfulPaymentsAmountRange_args args = new getSuccessfulPaymentsAmountRange_args();
      sendBase("getSuccessfulPaymentsAmountRange", args);
    }

    public List<Double> recv_getSuccessfulPaymentsAmountRange() throws org.apache.thrift.TException
    {
      getSuccessfulPaymentsAmountRange_result result = new getSuccessfulPaymentsAmountRange_result();
      receiveBase(result, "getSuccessfulPaymentsAmountRange");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentsAmountRange failed: unknown result");
    }

    public String initializeHdfcPayment(long merchantPaymentId, boolean isMobile) throws PaymentException, org.apache.thrift.TException
    {
      send_initializeHdfcPayment(merchantPaymentId, isMobile);
      return recv_initializeHdfcPayment();
    }

    public void send_initializeHdfcPayment(long merchantPaymentId, boolean isMobile) throws org.apache.thrift.TException
    {
      initializeHdfcPayment_args args = new initializeHdfcPayment_args();
      args.setMerchantPaymentId(merchantPaymentId);
      args.setIsMobile(isMobile);
      sendBase("initializeHdfcPayment", args);
    }

    public String recv_initializeHdfcPayment() throws PaymentException, org.apache.thrift.TException
    {
      initializeHdfcPayment_result result = new initializeHdfcPayment_result();
      receiveBase(result, "initializeHdfcPayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "initializeHdfcPayment failed: unknown result");
    }

    public String doHdfcPaymentForDigitalOrder(long merchantPaymentId, long rechargeOrderId, String phone, boolean isMobile) throws PaymentException, org.apache.thrift.TException
    {
      send_doHdfcPaymentForDigitalOrder(merchantPaymentId, rechargeOrderId, phone, isMobile);
      return recv_doHdfcPaymentForDigitalOrder();
    }

    public void send_doHdfcPaymentForDigitalOrder(long merchantPaymentId, long rechargeOrderId, String phone, boolean isMobile) throws org.apache.thrift.TException
    {
      doHdfcPaymentForDigitalOrder_args args = new doHdfcPaymentForDigitalOrder_args();
      args.setMerchantPaymentId(merchantPaymentId);
      args.setRechargeOrderId(rechargeOrderId);
      args.setPhone(phone);
      args.setIsMobile(isMobile);
      sendBase("doHdfcPaymentForDigitalOrder", args);
    }

    public String recv_doHdfcPaymentForDigitalOrder() throws PaymentException, org.apache.thrift.TException
    {
      doHdfcPaymentForDigitalOrder_result result = new doHdfcPaymentForDigitalOrder_result();
      receiveBase(result, "doHdfcPaymentForDigitalOrder");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "doHdfcPaymentForDigitalOrder failed: unknown result");
    }

    public String initializeHdfcEmiPayment(long merchantPaymentId, boolean isMobile) throws PaymentException, org.apache.thrift.TException
    {
      send_initializeHdfcEmiPayment(merchantPaymentId, isMobile);
      return recv_initializeHdfcEmiPayment();
    }

    public void send_initializeHdfcEmiPayment(long merchantPaymentId, boolean isMobile) throws org.apache.thrift.TException
    {
      initializeHdfcEmiPayment_args args = new initializeHdfcEmiPayment_args();
      args.setMerchantPaymentId(merchantPaymentId);
      args.setIsMobile(isMobile);
      sendBase("initializeHdfcEmiPayment", args);
    }

    public String recv_initializeHdfcEmiPayment() throws PaymentException, org.apache.thrift.TException
    {
      initializeHdfcEmiPayment_result result = new initializeHdfcEmiPayment_result();
      receiveBase(result, "initializeHdfcEmiPayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "initializeHdfcEmiPayment failed: unknown result");
    }

    public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, org.apache.thrift.TException
    {
      send_createRefund(orderId, merchantTxnId, amount);
      return recv_createRefund();
    }

    public void send_createRefund(long orderId, long merchantTxnId, double amount) throws org.apache.thrift.TException
    {
      createRefund_args args = new createRefund_args();
      args.setOrderId(orderId);
      args.setMerchantTxnId(merchantTxnId);
      args.setAmount(amount);
      sendBase("createRefund", args);
    }

    public long recv_createRefund() throws PaymentException, org.apache.thrift.TException
    {
      createRefund_result result = new createRefund_result();
      receiveBase(result, "createRefund");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createRefund failed: unknown result");
    }

    public boolean capturePayment(long merchantTxnId, boolean isDigital) throws PaymentException, org.apache.thrift.TException
    {
      send_capturePayment(merchantTxnId, isDigital);
      return recv_capturePayment();
    }

    public void send_capturePayment(long merchantTxnId, boolean isDigital) throws org.apache.thrift.TException
    {
      capturePayment_args args = new capturePayment_args();
      args.setMerchantTxnId(merchantTxnId);
      args.setIsDigital(isDigital);
      sendBase("capturePayment", args);
    }

    public boolean recv_capturePayment() throws PaymentException, org.apache.thrift.TException
    {
      capturePayment_result result = new capturePayment_result();
      receiveBase(result, "capturePayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "capturePayment failed: unknown result");
    }

    public boolean refundPayment(long merchantTxnId, double amount, boolean isDigital) throws PaymentException, org.apache.thrift.TException
    {
      send_refundPayment(merchantTxnId, amount, isDigital);
      return recv_refundPayment();
    }

    public void send_refundPayment(long merchantTxnId, double amount, boolean isDigital) throws org.apache.thrift.TException
    {
      refundPayment_args args = new refundPayment_args();
      args.setMerchantTxnId(merchantTxnId);
      args.setAmount(amount);
      args.setIsDigital(isDigital);
      sendBase("refundPayment", args);
    }

    public boolean recv_refundPayment() throws PaymentException, org.apache.thrift.TException
    {
      refundPayment_result result = new refundPayment_result();
      receiveBase(result, "refundPayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "refundPayment failed: unknown result");
    }

    public boolean partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate) throws PaymentException, org.apache.thrift.TException
    {
      send_partiallyCapturePayment(merchantTxnId, amount, xferBy, xferTxnId, xferDate);
      return recv_partiallyCapturePayment();
    }

    public void send_partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate) throws org.apache.thrift.TException
    {
      partiallyCapturePayment_args args = new partiallyCapturePayment_args();
      args.setMerchantTxnId(merchantTxnId);
      args.setAmount(amount);
      args.setXferBy(xferBy);
      args.setXferTxnId(xferTxnId);
      args.setXferDate(xferDate);
      sendBase("partiallyCapturePayment", args);
    }

    public boolean recv_partiallyCapturePayment() throws PaymentException, org.apache.thrift.TException
    {
      partiallyCapturePayment_result result = new partiallyCapturePayment_result();
      receiveBase(result, "partiallyCapturePayment");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "partiallyCapturePayment failed: unknown result");
    }

    public List<Long> getPaymentsRequiringExtraProcessing(ExtraPaymentProcessingType category) throws org.apache.thrift.TException
    {
      send_getPaymentsRequiringExtraProcessing(category);
      return recv_getPaymentsRequiringExtraProcessing();
    }

    public void send_getPaymentsRequiringExtraProcessing(ExtraPaymentProcessingType category) throws org.apache.thrift.TException
    {
      getPaymentsRequiringExtraProcessing_args args = new getPaymentsRequiringExtraProcessing_args();
      args.setCategory(category);
      sendBase("getPaymentsRequiringExtraProcessing", args);
    }

    public List<Long> recv_getPaymentsRequiringExtraProcessing() throws org.apache.thrift.TException
    {
      getPaymentsRequiringExtraProcessing_result result = new getPaymentsRequiringExtraProcessing_result();
      receiveBase(result, "getPaymentsRequiringExtraProcessing");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentsRequiringExtraProcessing failed: unknown result");
    }

    public void markPaymentAsProcessed(long paymentId, ExtraPaymentProcessingType category) throws org.apache.thrift.TException
    {
      send_markPaymentAsProcessed(paymentId, category);
      recv_markPaymentAsProcessed();
    }

    public void send_markPaymentAsProcessed(long paymentId, ExtraPaymentProcessingType category) throws org.apache.thrift.TException
    {
      markPaymentAsProcessed_args args = new markPaymentAsProcessed_args();
      args.setPaymentId(paymentId);
      args.setCategory(category);
      sendBase("markPaymentAsProcessed", args);
    }

    public void recv_markPaymentAsProcessed() throws org.apache.thrift.TException
    {
      markPaymentAsProcessed_result result = new markPaymentAsProcessed_result();
      receiveBase(result, "markPaymentAsProcessed");
      return;
    }

    public PaymentStatus getPaymentStatusAtGateway(long merchantTxnId, double amount, boolean isDigital) throws PaymentException, org.apache.thrift.TException
    {
      send_getPaymentStatusAtGateway(merchantTxnId, amount, isDigital);
      return recv_getPaymentStatusAtGateway();
    }

    public void send_getPaymentStatusAtGateway(long merchantTxnId, double amount, boolean isDigital) throws org.apache.thrift.TException
    {
      getPaymentStatusAtGateway_args args = new getPaymentStatusAtGateway_args();
      args.setMerchantTxnId(merchantTxnId);
      args.setAmount(amount);
      args.setIsDigital(isDigital);
      sendBase("getPaymentStatusAtGateway", args);
    }

    public PaymentStatus recv_getPaymentStatusAtGateway() throws PaymentException, org.apache.thrift.TException
    {
      getPaymentStatusAtGateway_result result = new getPaymentStatusAtGateway_result();
      receiveBase(result, "getPaymentStatusAtGateway");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.pe != null) {
        throw result.pe;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPaymentStatusAtGateway failed: unknown result");
    }

  }
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
      private org.apache.thrift.async.TAsyncClientManager clientManager;
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
        this.clientManager = clientManager;
        this.protocolFactory = protocolFactory;
      }
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
        return new AsyncClient(protocolFactory, clientManager, transport);
      }
    }

    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
      super(protocolFactory, clientManager, transport);
    }

    public void createPayment(long userId, double amount, long gatewayId, long txnId, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<createPayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      createPayment_call method_call = new createPayment_call(userId, amount, gatewayId, txnId, isDigital, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class createPayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long userId;
      private double amount;
      private long gatewayId;
      private long txnId;
      private boolean isDigital;
      public createPayment_call(long userId, double amount, long gatewayId, long txnId, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<createPayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.userId = userId;
        this.amount = amount;
        this.gatewayId = gatewayId;
        this.txnId = txnId;
        this.isDigital = isDigital;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        createPayment_args args = new createPayment_args();
        args.setUserId(userId);
        args.setAmount(amount);
        args.setGatewayId(gatewayId);
        args.setTxnId(txnId);
        args.setIsDigital(isDigital);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_createPayment();
      }
    }

    public void getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<getPaymentsForUser_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentsForUser_call method_call = new getPaymentsForUser_call(userId, fromTime, toTime, status, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentsForUser_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long userId;
      private long fromTime;
      private long toTime;
      private PaymentStatus status;
      private long gatewayId;
      public getPaymentsForUser_call(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<getPaymentsForUser_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.userId = userId;
        this.fromTime = fromTime;
        this.toTime = toTime;
        this.status = status;
        this.gatewayId = gatewayId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentsForUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentsForUser_args args = new getPaymentsForUser_args();
        args.setUserId(userId);
        args.setFromTime(fromTime);
        args.setToTime(toTime);
        args.setStatus(status);
        args.setGatewayId(gatewayId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Payment> getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentsForUser();
      }
    }

    public void getPayments(long fromTime, long toTime, PaymentStatus status, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<getPayments_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPayments_call method_call = new getPayments_call(fromTime, toTime, status, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPayments_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long fromTime;
      private long toTime;
      private PaymentStatus status;
      private long gatewayId;
      public getPayments_call(long fromTime, long toTime, PaymentStatus status, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<getPayments_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.fromTime = fromTime;
        this.toTime = toTime;
        this.status = status;
        this.gatewayId = gatewayId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPayments", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPayments_args args = new getPayments_args();
        args.setFromTime(fromTime);
        args.setToTime(toTime);
        args.setStatus(status);
        args.setGatewayId(gatewayId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Payment> getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPayments();
      }
    }

    public void getPaymentsByCapturedDate(long fromTime, long toTime, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<getPaymentsByCapturedDate_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentsByCapturedDate_call method_call = new getPaymentsByCapturedDate_call(fromTime, toTime, gatewayId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentsByCapturedDate_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long fromTime;
      private long toTime;
      private long gatewayId;
      public getPaymentsByCapturedDate_call(long fromTime, long toTime, long gatewayId, org.apache.thrift.async.AsyncMethodCallback<getPaymentsByCapturedDate_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.fromTime = fromTime;
        this.toTime = toTime;
        this.gatewayId = gatewayId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentsByCapturedDate", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentsByCapturedDate_args args = new getPaymentsByCapturedDate_args();
        args.setFromTime(fromTime);
        args.setToTime(toTime);
        args.setGatewayId(gatewayId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Payment> getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentsByCapturedDate();
      }
    }

    public void getPaymentGateway(long id, org.apache.thrift.async.AsyncMethodCallback<getPaymentGateway_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentGateway_call method_call = new getPaymentGateway_call(id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentGateway_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public getPaymentGateway_call(long id, org.apache.thrift.async.AsyncMethodCallback<getPaymentGateway_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentGateway", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentGateway_args args = new getPaymentGateway_args();
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public PaymentGateway getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentGateway();
      }
    }

    public void getActivePaymentGateways(org.apache.thrift.async.AsyncMethodCallback<getActivePaymentGateways_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getActivePaymentGateways_call method_call = new getActivePaymentGateways_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getActivePaymentGateways_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getActivePaymentGateways_call(org.apache.thrift.async.AsyncMethodCallback<getActivePaymentGateways_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActivePaymentGateways", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getActivePaymentGateways_args args = new getActivePaymentGateways_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<PaymentGateway> getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getActivePaymentGateways();
      }
    }

    public void getPayment(long id, org.apache.thrift.async.AsyncMethodCallback<getPayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPayment_call method_call = new getPayment_call(id, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      public getPayment_call(long id, org.apache.thrift.async.AsyncMethodCallback<getPayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPayment_args args = new getPayment_args();
        args.setId(id);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Payment getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPayment();
      }
    }

    public void getPaymentForTxnId(long txnId, org.apache.thrift.async.AsyncMethodCallback<getPaymentForTxnId_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentForTxnId_call method_call = new getPaymentForTxnId_call(txnId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentForTxnId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long txnId;
      public getPaymentForTxnId_call(long txnId, org.apache.thrift.async.AsyncMethodCallback<getPaymentForTxnId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.txnId = txnId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentForTxnId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentForTxnId_args args = new getPaymentForTxnId_args();
        args.setTxnId(txnId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Payment> getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentForTxnId();
      }
    }

    public void getPaymentForRechargeTxnId(long txnId, org.apache.thrift.async.AsyncMethodCallback<getPaymentForRechargeTxnId_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentForRechargeTxnId_call method_call = new getPaymentForRechargeTxnId_call(txnId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentForRechargeTxnId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long txnId;
      public getPaymentForRechargeTxnId_call(long txnId, org.apache.thrift.async.AsyncMethodCallback<getPaymentForRechargeTxnId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.txnId = txnId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentForRechargeTxnId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentForRechargeTxnId_args args = new getPaymentForRechargeTxnId_args();
        args.setTxnId(txnId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Payment> getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentForRechargeTxnId();
      }
    }

    public void getSuccessfulPaymentForTxnId(long txnId, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentForTxnId_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getSuccessfulPaymentForTxnId_call method_call = new getSuccessfulPaymentForTxnId_call(txnId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getSuccessfulPaymentForTxnId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long txnId;
      public getSuccessfulPaymentForTxnId_call(long txnId, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentForTxnId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.txnId = txnId;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentForTxnId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getSuccessfulPaymentForTxnId_args args = new getSuccessfulPaymentForTxnId_args();
        args.setTxnId(txnId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Payment getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getSuccessfulPaymentForTxnId();
      }
    }

    public void updatePaymentDetails(long id, String gatewayPaymentId, String sessionId, String gatewayTxnStatus, String description, String gatewayTxnId, String authCode, String referenceCode, String errorCode, PaymentStatus status, String gatewayTxnDate, List<Attribute> attributes, org.apache.thrift.async.AsyncMethodCallback<updatePaymentDetails_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      updatePaymentDetails_call method_call = new updatePaymentDetails_call(id, gatewayPaymentId, sessionId, gatewayTxnStatus, description, gatewayTxnId, authCode, referenceCode, errorCode, status, gatewayTxnDate, attributes, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class updatePaymentDetails_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long id;
      private String gatewayPaymentId;
      private String sessionId;
      private String gatewayTxnStatus;
      private String description;
      private String gatewayTxnId;
      private String authCode;
      private String referenceCode;
      private String errorCode;
      private PaymentStatus status;
      private String gatewayTxnDate;
      private List<Attribute> attributes;
      public updatePaymentDetails_call(long id, String gatewayPaymentId, String sessionId, String gatewayTxnStatus, String description, String gatewayTxnId, String authCode, String referenceCode, String errorCode, PaymentStatus status, String gatewayTxnDate, List<Attribute> attributes, org.apache.thrift.async.AsyncMethodCallback<updatePaymentDetails_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.id = id;
        this.gatewayPaymentId = gatewayPaymentId;
        this.sessionId = sessionId;
        this.gatewayTxnStatus = gatewayTxnStatus;
        this.description = description;
        this.gatewayTxnId = gatewayTxnId;
        this.authCode = authCode;
        this.referenceCode = referenceCode;
        this.errorCode = errorCode;
        this.status = status;
        this.gatewayTxnDate = gatewayTxnDate;
        this.attributes = attributes;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updatePaymentDetails", org.apache.thrift.protocol.TMessageType.CALL, 0));
        updatePaymentDetails_args args = new updatePaymentDetails_args();
        args.setId(id);
        args.setGatewayPaymentId(gatewayPaymentId);
        args.setSessionId(sessionId);
        args.setGatewayTxnStatus(gatewayTxnStatus);
        args.setDescription(description);
        args.setGatewayTxnId(gatewayTxnId);
        args.setAuthCode(authCode);
        args.setReferenceCode(referenceCode);
        args.setErrorCode(errorCode);
        args.setStatus(status);
        args.setGatewayTxnDate(gatewayTxnDate);
        args.setAttributes(attributes);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_updatePaymentDetails();
      }
    }

    public void getSuccessfulPaymentsAmountRange(org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentsAmountRange_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getSuccessfulPaymentsAmountRange_call method_call = new getSuccessfulPaymentsAmountRange_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getSuccessfulPaymentsAmountRange_call extends org.apache.thrift.async.TAsyncMethodCall {
      public getSuccessfulPaymentsAmountRange_call(org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentsAmountRange_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentsAmountRange", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getSuccessfulPaymentsAmountRange_args args = new getSuccessfulPaymentsAmountRange_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Double> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getSuccessfulPaymentsAmountRange();
      }
    }

    public void initializeHdfcPayment(long merchantPaymentId, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<initializeHdfcPayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      initializeHdfcPayment_call method_call = new initializeHdfcPayment_call(merchantPaymentId, isMobile, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class initializeHdfcPayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantPaymentId;
      private boolean isMobile;
      public initializeHdfcPayment_call(long merchantPaymentId, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<initializeHdfcPayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantPaymentId = merchantPaymentId;
        this.isMobile = isMobile;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("initializeHdfcPayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        initializeHdfcPayment_args args = new initializeHdfcPayment_args();
        args.setMerchantPaymentId(merchantPaymentId);
        args.setIsMobile(isMobile);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public String getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_initializeHdfcPayment();
      }
    }

    public void doHdfcPaymentForDigitalOrder(long merchantPaymentId, long rechargeOrderId, String phone, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<doHdfcPaymentForDigitalOrder_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      doHdfcPaymentForDigitalOrder_call method_call = new doHdfcPaymentForDigitalOrder_call(merchantPaymentId, rechargeOrderId, phone, isMobile, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class doHdfcPaymentForDigitalOrder_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantPaymentId;
      private long rechargeOrderId;
      private String phone;
      private boolean isMobile;
      public doHdfcPaymentForDigitalOrder_call(long merchantPaymentId, long rechargeOrderId, String phone, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<doHdfcPaymentForDigitalOrder_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantPaymentId = merchantPaymentId;
        this.rechargeOrderId = rechargeOrderId;
        this.phone = phone;
        this.isMobile = isMobile;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("doHdfcPaymentForDigitalOrder", org.apache.thrift.protocol.TMessageType.CALL, 0));
        doHdfcPaymentForDigitalOrder_args args = new doHdfcPaymentForDigitalOrder_args();
        args.setMerchantPaymentId(merchantPaymentId);
        args.setRechargeOrderId(rechargeOrderId);
        args.setPhone(phone);
        args.setIsMobile(isMobile);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public String getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_doHdfcPaymentForDigitalOrder();
      }
    }

    public void initializeHdfcEmiPayment(long merchantPaymentId, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<initializeHdfcEmiPayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      initializeHdfcEmiPayment_call method_call = new initializeHdfcEmiPayment_call(merchantPaymentId, isMobile, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class initializeHdfcEmiPayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantPaymentId;
      private boolean isMobile;
      public initializeHdfcEmiPayment_call(long merchantPaymentId, boolean isMobile, org.apache.thrift.async.AsyncMethodCallback<initializeHdfcEmiPayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantPaymentId = merchantPaymentId;
        this.isMobile = isMobile;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("initializeHdfcEmiPayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        initializeHdfcEmiPayment_args args = new initializeHdfcEmiPayment_args();
        args.setMerchantPaymentId(merchantPaymentId);
        args.setIsMobile(isMobile);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public String getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_initializeHdfcEmiPayment();
      }
    }

    public void createRefund(long orderId, long merchantTxnId, double amount, org.apache.thrift.async.AsyncMethodCallback<createRefund_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      createRefund_call method_call = new createRefund_call(orderId, merchantTxnId, amount, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class createRefund_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long orderId;
      private long merchantTxnId;
      private double amount;
      public createRefund_call(long orderId, long merchantTxnId, double amount, org.apache.thrift.async.AsyncMethodCallback<createRefund_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.orderId = orderId;
        this.merchantTxnId = merchantTxnId;
        this.amount = amount;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createRefund", org.apache.thrift.protocol.TMessageType.CALL, 0));
        createRefund_args args = new createRefund_args();
        args.setOrderId(orderId);
        args.setMerchantTxnId(merchantTxnId);
        args.setAmount(amount);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public long getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_createRefund();
      }
    }

    public void capturePayment(long merchantTxnId, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<capturePayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      capturePayment_call method_call = new capturePayment_call(merchantTxnId, isDigital, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class capturePayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantTxnId;
      private boolean isDigital;
      public capturePayment_call(long merchantTxnId, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<capturePayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantTxnId = merchantTxnId;
        this.isDigital = isDigital;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("capturePayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        capturePayment_args args = new capturePayment_args();
        args.setMerchantTxnId(merchantTxnId);
        args.setIsDigital(isDigital);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_capturePayment();
      }
    }

    public void refundPayment(long merchantTxnId, double amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<refundPayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      refundPayment_call method_call = new refundPayment_call(merchantTxnId, amount, isDigital, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class refundPayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantTxnId;
      private double amount;
      private boolean isDigital;
      public refundPayment_call(long merchantTxnId, double amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<refundPayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantTxnId = merchantTxnId;
        this.amount = amount;
        this.isDigital = isDigital;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("refundPayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        refundPayment_args args = new refundPayment_args();
        args.setMerchantTxnId(merchantTxnId);
        args.setAmount(amount);
        args.setIsDigital(isDigital);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_refundPayment();
      }
    }

    public void partiallyCapturePayment(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate, org.apache.thrift.async.AsyncMethodCallback<partiallyCapturePayment_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      partiallyCapturePayment_call method_call = new partiallyCapturePayment_call(merchantTxnId, amount, xferBy, xferTxnId, xferDate, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class partiallyCapturePayment_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantTxnId;
      private double amount;
      private String xferBy;
      private String xferTxnId;
      private long xferDate;
      public partiallyCapturePayment_call(long merchantTxnId, double amount, String xferBy, String xferTxnId, long xferDate, org.apache.thrift.async.AsyncMethodCallback<partiallyCapturePayment_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantTxnId = merchantTxnId;
        this.amount = amount;
        this.xferBy = xferBy;
        this.xferTxnId = xferTxnId;
        this.xferDate = xferDate;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("partiallyCapturePayment", org.apache.thrift.protocol.TMessageType.CALL, 0));
        partiallyCapturePayment_args args = new partiallyCapturePayment_args();
        args.setMerchantTxnId(merchantTxnId);
        args.setAmount(amount);
        args.setXferBy(xferBy);
        args.setXferTxnId(xferTxnId);
        args.setXferDate(xferDate);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public boolean getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_partiallyCapturePayment();
      }
    }

    public void getPaymentsRequiringExtraProcessing(ExtraPaymentProcessingType category, org.apache.thrift.async.AsyncMethodCallback<getPaymentsRequiringExtraProcessing_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentsRequiringExtraProcessing_call method_call = new getPaymentsRequiringExtraProcessing_call(category, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentsRequiringExtraProcessing_call extends org.apache.thrift.async.TAsyncMethodCall {
      private ExtraPaymentProcessingType category;
      public getPaymentsRequiringExtraProcessing_call(ExtraPaymentProcessingType category, org.apache.thrift.async.AsyncMethodCallback<getPaymentsRequiringExtraProcessing_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.category = category;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentsRequiringExtraProcessing", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentsRequiringExtraProcessing_args args = new getPaymentsRequiringExtraProcessing_args();
        args.setCategory(category);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public List<Long> getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentsRequiringExtraProcessing();
      }
    }

    public void markPaymentAsProcessed(long paymentId, ExtraPaymentProcessingType category, org.apache.thrift.async.AsyncMethodCallback<markPaymentAsProcessed_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      markPaymentAsProcessed_call method_call = new markPaymentAsProcessed_call(paymentId, category, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class markPaymentAsProcessed_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long paymentId;
      private ExtraPaymentProcessingType category;
      public markPaymentAsProcessed_call(long paymentId, ExtraPaymentProcessingType category, org.apache.thrift.async.AsyncMethodCallback<markPaymentAsProcessed_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.paymentId = paymentId;
        this.category = category;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markPaymentAsProcessed", org.apache.thrift.protocol.TMessageType.CALL, 0));
        markPaymentAsProcessed_args args = new markPaymentAsProcessed_args();
        args.setPaymentId(paymentId);
        args.setCategory(category);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        (new Client(prot)).recv_markPaymentAsProcessed();
      }
    }

    public void getPaymentStatusAtGateway(long merchantTxnId, double amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<getPaymentStatusAtGateway_call> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getPaymentStatusAtGateway_call method_call = new getPaymentStatusAtGateway_call(merchantTxnId, amount, isDigital, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getPaymentStatusAtGateway_call extends org.apache.thrift.async.TAsyncMethodCall {
      private long merchantTxnId;
      private double amount;
      private boolean isDigital;
      public getPaymentStatusAtGateway_call(long merchantTxnId, double amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<getPaymentStatusAtGateway_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
        super(client, protocolFactory, transport, resultHandler, false);
        this.merchantTxnId = merchantTxnId;
        this.amount = amount;
        this.isDigital = isDigital;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPaymentStatusAtGateway", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getPaymentStatusAtGateway_args args = new getPaymentStatusAtGateway_args();
        args.setMerchantTxnId(merchantTxnId);
        args.setAmount(amount);
        args.setIsDigital(isDigital);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public PaymentStatus getResult() throws PaymentException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getPaymentStatusAtGateway();
      }
    }

  }

  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
    }

    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      processMap.put("createPayment", new createPayment());
      processMap.put("getPaymentsForUser", new getPaymentsForUser());
      processMap.put("getPayments", new getPayments());
      processMap.put("getPaymentsByCapturedDate", new getPaymentsByCapturedDate());
      processMap.put("getPaymentGateway", new getPaymentGateway());
      processMap.put("getActivePaymentGateways", new getActivePaymentGateways());
      processMap.put("getPayment", new getPayment());
      processMap.put("getPaymentForTxnId", new getPaymentForTxnId());
      processMap.put("getPaymentForRechargeTxnId", new getPaymentForRechargeTxnId());
      processMap.put("getSuccessfulPaymentForTxnId", new getSuccessfulPaymentForTxnId());
      processMap.put("updatePaymentDetails", new updatePaymentDetails());
      processMap.put("getSuccessfulPaymentsAmountRange", new getSuccessfulPaymentsAmountRange());
      processMap.put("initializeHdfcPayment", new initializeHdfcPayment());
      processMap.put("doHdfcPaymentForDigitalOrder", new doHdfcPaymentForDigitalOrder());
      processMap.put("initializeHdfcEmiPayment", new initializeHdfcEmiPayment());
      processMap.put("createRefund", new createRefund());
      processMap.put("capturePayment", new capturePayment());
      processMap.put("refundPayment", new refundPayment());
      processMap.put("partiallyCapturePayment", new partiallyCapturePayment());
      processMap.put("getPaymentsRequiringExtraProcessing", new getPaymentsRequiringExtraProcessing());
      processMap.put("markPaymentAsProcessed", new markPaymentAsProcessed());
      processMap.put("getPaymentStatusAtGateway", new getPaymentStatusAtGateway());
      return processMap;
    }

    private static class createPayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPayment_args> {
      public createPayment() {
        super("createPayment");
      }

      protected createPayment_args getEmptyArgsInstance() {
        return new createPayment_args();
      }

      protected createPayment_result getResult(I iface, createPayment_args args) throws org.apache.thrift.TException {
        createPayment_result result = new createPayment_result();
        try {
          result.success = iface.createPayment(args.userId, args.amount, args.gatewayId, args.txnId, args.isDigital);
          result.setSuccessIsSet(true);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPaymentsForUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentsForUser_args> {
      public getPaymentsForUser() {
        super("getPaymentsForUser");
      }

      protected getPaymentsForUser_args getEmptyArgsInstance() {
        return new getPaymentsForUser_args();
      }

      protected getPaymentsForUser_result getResult(I iface, getPaymentsForUser_args args) throws org.apache.thrift.TException {
        getPaymentsForUser_result result = new getPaymentsForUser_result();
        try {
          result.success = iface.getPaymentsForUser(args.userId, args.fromTime, args.toTime, args.status, args.gatewayId);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPayments<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPayments_args> {
      public getPayments() {
        super("getPayments");
      }

      protected getPayments_args getEmptyArgsInstance() {
        return new getPayments_args();
      }

      protected getPayments_result getResult(I iface, getPayments_args args) throws org.apache.thrift.TException {
        getPayments_result result = new getPayments_result();
        try {
          result.success = iface.getPayments(args.fromTime, args.toTime, args.status, args.gatewayId);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPaymentsByCapturedDate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentsByCapturedDate_args> {
      public getPaymentsByCapturedDate() {
        super("getPaymentsByCapturedDate");
      }

      protected getPaymentsByCapturedDate_args getEmptyArgsInstance() {
        return new getPaymentsByCapturedDate_args();
      }

      protected getPaymentsByCapturedDate_result getResult(I iface, getPaymentsByCapturedDate_args args) throws org.apache.thrift.TException {
        getPaymentsByCapturedDate_result result = new getPaymentsByCapturedDate_result();
        try {
          result.success = iface.getPaymentsByCapturedDate(args.fromTime, args.toTime, args.gatewayId);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPaymentGateway<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentGateway_args> {
      public getPaymentGateway() {
        super("getPaymentGateway");
      }

      protected getPaymentGateway_args getEmptyArgsInstance() {
        return new getPaymentGateway_args();
      }

      protected getPaymentGateway_result getResult(I iface, getPaymentGateway_args args) throws org.apache.thrift.TException {
        getPaymentGateway_result result = new getPaymentGateway_result();
        try {
          result.success = iface.getPaymentGateway(args.id);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getActivePaymentGateways<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActivePaymentGateways_args> {
      public getActivePaymentGateways() {
        super("getActivePaymentGateways");
      }

      protected getActivePaymentGateways_args getEmptyArgsInstance() {
        return new getActivePaymentGateways_args();
      }

      protected getActivePaymentGateways_result getResult(I iface, getActivePaymentGateways_args args) throws org.apache.thrift.TException {
        getActivePaymentGateways_result result = new getActivePaymentGateways_result();
        try {
          result.success = iface.getActivePaymentGateways();
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPayment_args> {
      public getPayment() {
        super("getPayment");
      }

      protected getPayment_args getEmptyArgsInstance() {
        return new getPayment_args();
      }

      protected getPayment_result getResult(I iface, getPayment_args args) throws org.apache.thrift.TException {
        getPayment_result result = new getPayment_result();
        try {
          result.success = iface.getPayment(args.id);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPaymentForTxnId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentForTxnId_args> {
      public getPaymentForTxnId() {
        super("getPaymentForTxnId");
      }

      protected getPaymentForTxnId_args getEmptyArgsInstance() {
        return new getPaymentForTxnId_args();
      }

      protected getPaymentForTxnId_result getResult(I iface, getPaymentForTxnId_args args) throws org.apache.thrift.TException {
        getPaymentForTxnId_result result = new getPaymentForTxnId_result();
        try {
          result.success = iface.getPaymentForTxnId(args.txnId);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPaymentForRechargeTxnId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentForRechargeTxnId_args> {
      public getPaymentForRechargeTxnId() {
        super("getPaymentForRechargeTxnId");
      }

      protected getPaymentForRechargeTxnId_args getEmptyArgsInstance() {
        return new getPaymentForRechargeTxnId_args();
      }

      protected getPaymentForRechargeTxnId_result getResult(I iface, getPaymentForRechargeTxnId_args args) throws org.apache.thrift.TException {
        getPaymentForRechargeTxnId_result result = new getPaymentForRechargeTxnId_result();
        try {
          result.success = iface.getPaymentForRechargeTxnId(args.txnId);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getSuccessfulPaymentForTxnId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentForTxnId_args> {
      public getSuccessfulPaymentForTxnId() {
        super("getSuccessfulPaymentForTxnId");
      }

      protected getSuccessfulPaymentForTxnId_args getEmptyArgsInstance() {
        return new getSuccessfulPaymentForTxnId_args();
      }

      protected getSuccessfulPaymentForTxnId_result getResult(I iface, getSuccessfulPaymentForTxnId_args args) throws org.apache.thrift.TException {
        getSuccessfulPaymentForTxnId_result result = new getSuccessfulPaymentForTxnId_result();
        try {
          result.success = iface.getSuccessfulPaymentForTxnId(args.txnId);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class updatePaymentDetails<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updatePaymentDetails_args> {
      public updatePaymentDetails() {
        super("updatePaymentDetails");
      }

      protected updatePaymentDetails_args getEmptyArgsInstance() {
        return new updatePaymentDetails_args();
      }

      protected updatePaymentDetails_result getResult(I iface, updatePaymentDetails_args args) throws org.apache.thrift.TException {
        updatePaymentDetails_result result = new updatePaymentDetails_result();
        try {
          result.success = iface.updatePaymentDetails(args.id, args.gatewayPaymentId, args.sessionId, args.gatewayTxnStatus, args.description, args.gatewayTxnId, args.authCode, args.referenceCode, args.errorCode, args.status, args.gatewayTxnDate, args.attributes);
          result.setSuccessIsSet(true);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getSuccessfulPaymentsAmountRange<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentsAmountRange_args> {
      public getSuccessfulPaymentsAmountRange() {
        super("getSuccessfulPaymentsAmountRange");
      }

      protected getSuccessfulPaymentsAmountRange_args getEmptyArgsInstance() {
        return new getSuccessfulPaymentsAmountRange_args();
      }

      protected getSuccessfulPaymentsAmountRange_result getResult(I iface, getSuccessfulPaymentsAmountRange_args args) throws org.apache.thrift.TException {
        getSuccessfulPaymentsAmountRange_result result = new getSuccessfulPaymentsAmountRange_result();
        result.success = iface.getSuccessfulPaymentsAmountRange();
        return result;
      }
    }

    private static class initializeHdfcPayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, initializeHdfcPayment_args> {
      public initializeHdfcPayment() {
        super("initializeHdfcPayment");
      }

      protected initializeHdfcPayment_args getEmptyArgsInstance() {
        return new initializeHdfcPayment_args();
      }

      protected initializeHdfcPayment_result getResult(I iface, initializeHdfcPayment_args args) throws org.apache.thrift.TException {
        initializeHdfcPayment_result result = new initializeHdfcPayment_result();
        try {
          result.success = iface.initializeHdfcPayment(args.merchantPaymentId, args.isMobile);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class doHdfcPaymentForDigitalOrder<I extends Iface> extends org.apache.thrift.ProcessFunction<I, doHdfcPaymentForDigitalOrder_args> {
      public doHdfcPaymentForDigitalOrder() {
        super("doHdfcPaymentForDigitalOrder");
      }

      protected doHdfcPaymentForDigitalOrder_args getEmptyArgsInstance() {
        return new doHdfcPaymentForDigitalOrder_args();
      }

      protected doHdfcPaymentForDigitalOrder_result getResult(I iface, doHdfcPaymentForDigitalOrder_args args) throws org.apache.thrift.TException {
        doHdfcPaymentForDigitalOrder_result result = new doHdfcPaymentForDigitalOrder_result();
        try {
          result.success = iface.doHdfcPaymentForDigitalOrder(args.merchantPaymentId, args.rechargeOrderId, args.phone, args.isMobile);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class initializeHdfcEmiPayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, initializeHdfcEmiPayment_args> {
      public initializeHdfcEmiPayment() {
        super("initializeHdfcEmiPayment");
      }

      protected initializeHdfcEmiPayment_args getEmptyArgsInstance() {
        return new initializeHdfcEmiPayment_args();
      }

      protected initializeHdfcEmiPayment_result getResult(I iface, initializeHdfcEmiPayment_args args) throws org.apache.thrift.TException {
        initializeHdfcEmiPayment_result result = new initializeHdfcEmiPayment_result();
        try {
          result.success = iface.initializeHdfcEmiPayment(args.merchantPaymentId, args.isMobile);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class createRefund<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createRefund_args> {
      public createRefund() {
        super("createRefund");
      }

      protected createRefund_args getEmptyArgsInstance() {
        return new createRefund_args();
      }

      protected createRefund_result getResult(I iface, createRefund_args args) throws org.apache.thrift.TException {
        createRefund_result result = new createRefund_result();
        try {
          result.success = iface.createRefund(args.orderId, args.merchantTxnId, args.amount);
          result.setSuccessIsSet(true);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class capturePayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, capturePayment_args> {
      public capturePayment() {
        super("capturePayment");
      }

      protected capturePayment_args getEmptyArgsInstance() {
        return new capturePayment_args();
      }

      protected capturePayment_result getResult(I iface, capturePayment_args args) throws org.apache.thrift.TException {
        capturePayment_result result = new capturePayment_result();
        try {
          result.success = iface.capturePayment(args.merchantTxnId, args.isDigital);
          result.setSuccessIsSet(true);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class refundPayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, refundPayment_args> {
      public refundPayment() {
        super("refundPayment");
      }

      protected refundPayment_args getEmptyArgsInstance() {
        return new refundPayment_args();
      }

      protected refundPayment_result getResult(I iface, refundPayment_args args) throws org.apache.thrift.TException {
        refundPayment_result result = new refundPayment_result();
        try {
          result.success = iface.refundPayment(args.merchantTxnId, args.amount, args.isDigital);
          result.setSuccessIsSet(true);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class partiallyCapturePayment<I extends Iface> extends org.apache.thrift.ProcessFunction<I, partiallyCapturePayment_args> {
      public partiallyCapturePayment() {
        super("partiallyCapturePayment");
      }

      protected partiallyCapturePayment_args getEmptyArgsInstance() {
        return new partiallyCapturePayment_args();
      }

      protected partiallyCapturePayment_result getResult(I iface, partiallyCapturePayment_args args) throws org.apache.thrift.TException {
        partiallyCapturePayment_result result = new partiallyCapturePayment_result();
        try {
          result.success = iface.partiallyCapturePayment(args.merchantTxnId, args.amount, args.xferBy, args.xferTxnId, args.xferDate);
          result.setSuccessIsSet(true);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

    private static class getPaymentsRequiringExtraProcessing<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentsRequiringExtraProcessing_args> {
      public getPaymentsRequiringExtraProcessing() {
        super("getPaymentsRequiringExtraProcessing");
      }

      protected getPaymentsRequiringExtraProcessing_args getEmptyArgsInstance() {
        return new getPaymentsRequiringExtraProcessing_args();
      }

      protected getPaymentsRequiringExtraProcessing_result getResult(I iface, getPaymentsRequiringExtraProcessing_args args) throws org.apache.thrift.TException {
        getPaymentsRequiringExtraProcessing_result result = new getPaymentsRequiringExtraProcessing_result();
        result.success = iface.getPaymentsRequiringExtraProcessing(args.category);
        return result;
      }
    }

    private static class markPaymentAsProcessed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markPaymentAsProcessed_args> {
      public markPaymentAsProcessed() {
        super("markPaymentAsProcessed");
      }

      protected markPaymentAsProcessed_args getEmptyArgsInstance() {
        return new markPaymentAsProcessed_args();
      }

      protected markPaymentAsProcessed_result getResult(I iface, markPaymentAsProcessed_args args) throws org.apache.thrift.TException {
        markPaymentAsProcessed_result result = new markPaymentAsProcessed_result();
        iface.markPaymentAsProcessed(args.paymentId, args.category);
        return result;
      }
    }

    private static class getPaymentStatusAtGateway<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPaymentStatusAtGateway_args> {
      public getPaymentStatusAtGateway() {
        super("getPaymentStatusAtGateway");
      }

      protected getPaymentStatusAtGateway_args getEmptyArgsInstance() {
        return new getPaymentStatusAtGateway_args();
      }

      protected getPaymentStatusAtGateway_result getResult(I iface, getPaymentStatusAtGateway_args args) throws org.apache.thrift.TException {
        getPaymentStatusAtGateway_result result = new getPaymentStatusAtGateway_result();
        try {
          result.success = iface.getPaymentStatusAtGateway(args.merchantTxnId, args.amount, args.isDigital);
        } catch (PaymentException pe) {
          result.pe = pe;
        }
        return result;
      }
    }

  }

  public static class createPayment_args implements org.apache.thrift.TBase<createPayment_args, createPayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPayment_args");

    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
    private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnId", org.apache.thrift.protocol.TType.I64, (short)4);
    private static final org.apache.thrift.protocol.TField IS_DIGITAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDigital", org.apache.thrift.protocol.TType.BOOL, (short)5);

    private long userId; // required
    private double amount; // required
    private long gatewayId; // required
    private long txnId; // required
    private boolean isDigital; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      USER_ID((short)1, "userId"),
      AMOUNT((short)2, "amount"),
      GATEWAY_ID((short)3, "gatewayId"),
      TXN_ID((short)4, "txnId"),
      IS_DIGITAL((short)5, "isDigital");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USER_ID
            return USER_ID;
          case 2: // AMOUNT
            return AMOUNT;
          case 3: // GATEWAY_ID
            return GATEWAY_ID;
          case 4: // TXN_ID
            return TXN_ID;
          case 5: // IS_DIGITAL
            return IS_DIGITAL;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __AMOUNT_ISSET_ID = 1;
    private static final int __GATEWAYID_ISSET_ID = 2;
    private static final int __TXNID_ISSET_ID = 3;
    private static final int __ISDIGITAL_ISSET_ID = 4;
    private BitSet __isset_bit_vector = new BitSet(5);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.IS_DIGITAL, new org.apache.thrift.meta_data.FieldMetaData("isDigital", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPayment_args.class, metaDataMap);
    }

    public createPayment_args() {
    }

    public createPayment_args(
      long userId,
      double amount,
      long gatewayId,
      long txnId,
      boolean isDigital)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.amount = amount;
      setAmountIsSet(true);
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
      this.txnId = txnId;
      setTxnIdIsSet(true);
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createPayment_args(createPayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.amount = other.amount;
      this.gatewayId = other.gatewayId;
      this.txnId = other.txnId;
      this.isDigital = other.isDigital;
    }

    public createPayment_args deepCopy() {
      return new createPayment_args(this);
    }

    @Override
    public void clear() {
      setUserIdIsSet(false);
      this.userId = 0;
      setAmountIsSet(false);
      this.amount = 0.0;
      setGatewayIdIsSet(false);
      this.gatewayId = 0;
      setTxnIdIsSet(false);
      this.txnId = 0;
      setIsDigitalIsSet(false);
      this.isDigital = false;
    }

    public long getUserId() {
      return this.userId;
    }

    public void setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public double getAmount() {
      return this.amount;
    }

    public void setAmount(double amount) {
      this.amount = amount;
      setAmountIsSet(true);
    }

    public void unsetAmount() {
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
    }

    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
    public boolean isSetAmount() {
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
    }

    public void setAmountIsSet(boolean value) {
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
    }

    public long getGatewayId() {
      return this.gatewayId;
    }

    public void setGatewayId(long gatewayId) {
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    public void unsetGatewayId() {
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
    }

    /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayId() {
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
    }

    public void setGatewayIdIsSet(boolean value) {
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
    }

    public long getTxnId() {
      return this.txnId;
    }

    public void setTxnId(long txnId) {
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    public void unsetTxnId() {
      __isset_bit_vector.clear(__TXNID_ISSET_ID);
    }

    /** Returns true if field txnId is set (has been assigned a value) and false otherwise */
    public boolean isSetTxnId() {
      return __isset_bit_vector.get(__TXNID_ISSET_ID);
    }

    public void setTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__TXNID_ISSET_ID, value);
    }

    public boolean isIsDigital() {
      return this.isDigital;
    }

    public void setIsDigital(boolean isDigital) {
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    public void unsetIsDigital() {
      __isset_bit_vector.clear(__ISDIGITAL_ISSET_ID);
    }

    /** Returns true if field isDigital is set (has been assigned a value) and false otherwise */
    public boolean isSetIsDigital() {
      return __isset_bit_vector.get(__ISDIGITAL_ISSET_ID);
    }

    public void setIsDigitalIsSet(boolean value) {
      __isset_bit_vector.set(__ISDIGITAL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case AMOUNT:
        if (value == null) {
          unsetAmount();
        } else {
          setAmount((Double)value);
        }
        break;

      case GATEWAY_ID:
        if (value == null) {
          unsetGatewayId();
        } else {
          setGatewayId((Long)value);
        }
        break;

      case TXN_ID:
        if (value == null) {
          unsetTxnId();
        } else {
          setTxnId((Long)value);
        }
        break;

      case IS_DIGITAL:
        if (value == null) {
          unsetIsDigital();
        } else {
          setIsDigital((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return Long.valueOf(getUserId());

      case AMOUNT:
        return Double.valueOf(getAmount());

      case GATEWAY_ID:
        return Long.valueOf(getGatewayId());

      case TXN_ID:
        return Long.valueOf(getTxnId());

      case IS_DIGITAL:
        return Boolean.valueOf(isIsDigital());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USER_ID:
        return isSetUserId();
      case AMOUNT:
        return isSetAmount();
      case GATEWAY_ID:
        return isSetGatewayId();
      case TXN_ID:
        return isSetTxnId();
      case IS_DIGITAL:
        return isSetIsDigital();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createPayment_args)
        return this.equals((createPayment_args)that);
      return false;
    }

    public boolean equals(createPayment_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_amount = true;
      boolean that_present_amount = true;
      if (this_present_amount || that_present_amount) {
        if (!(this_present_amount && that_present_amount))
          return false;
        if (this.amount != that.amount)
          return false;
      }

      boolean this_present_gatewayId = true;
      boolean that_present_gatewayId = true;
      if (this_present_gatewayId || that_present_gatewayId) {
        if (!(this_present_gatewayId && that_present_gatewayId))
          return false;
        if (this.gatewayId != that.gatewayId)
          return false;
      }

      boolean this_present_txnId = true;
      boolean that_present_txnId = true;
      if (this_present_txnId || that_present_txnId) {
        if (!(this_present_txnId && that_present_txnId))
          return false;
        if (this.txnId != that.txnId)
          return false;
      }

      boolean this_present_isDigital = true;
      boolean that_present_isDigital = true;
      if (this_present_isDigital || that_present_isDigital) {
        if (!(this_present_isDigital && that_present_isDigital))
          return false;
        if (this.isDigital != that.isDigital)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createPayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createPayment_args typedOther = (createPayment_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUserId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAmount()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(typedOther.isSetGatewayId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, typedOther.gatewayId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(typedOther.isSetTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnId, typedOther.txnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsDigital()).compareTo(typedOther.isSetIsDigital());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsDigital()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDigital, typedOther.isDigital);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // USER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.userId = iprot.readI64();
              setUserIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // AMOUNT
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.amount = iprot.readDouble();
              setAmountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // GATEWAY_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.gatewayId = iprot.readI64();
              setGatewayIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.txnId = iprot.readI64();
              setTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // IS_DIGITAL
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isDigital = iprot.readBool();
              setIsDigitalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
      oprot.writeDouble(this.amount);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
      oprot.writeI64(this.gatewayId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
      oprot.writeI64(this.txnId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
      oprot.writeBool(this.isDigital);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createPayment_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("amount:");
      sb.append(this.amount);
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayId:");
      sb.append(this.gatewayId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("txnId:");
      sb.append(this.txnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isDigital:");
      sb.append(this.isDigital);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createPayment_result implements org.apache.thrift.TBase<createPayment_result, createPayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPayment_result.class, metaDataMap);
    }

    public createPayment_result() {
    }

    public createPayment_result(
      long success,
      PaymentException pe)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createPayment_result(createPayment_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public createPayment_result deepCopy() {
      return new createPayment_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.pe = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createPayment_result)
        return this.equals((createPayment_result)that);
      return false;
    }

    public boolean equals(createPayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createPayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createPayment_result typedOther = (createPayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createPayment_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentsForUser_args implements org.apache.thrift.TBase<getPaymentsForUser_args, getPaymentsForUser_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentsForUser_args");

    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField FROM_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("fromTime", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField TO_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("toTime", org.apache.thrift.protocol.TType.I64, (short)3);
    private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4);
    private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.I64, (short)5);

    private long userId; // required
    private long fromTime; // required
    private long toTime; // required
    private PaymentStatus status; // required
    private long gatewayId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      USER_ID((short)1, "userId"),
      FROM_TIME((short)2, "fromTime"),
      TO_TIME((short)3, "toTime"),
      /**
       * 
       * @see PaymentStatus
       */
      STATUS((short)4, "status"),
      GATEWAY_ID((short)5, "gatewayId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USER_ID
            return USER_ID;
          case 2: // FROM_TIME
            return FROM_TIME;
          case 3: // TO_TIME
            return TO_TIME;
          case 4: // STATUS
            return STATUS;
          case 5: // GATEWAY_ID
            return GATEWAY_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERID_ISSET_ID = 0;
    private static final int __FROMTIME_ISSET_ID = 1;
    private static final int __TOTIME_ISSET_ID = 2;
    private static final int __GATEWAYID_ISSET_ID = 3;
    private BitSet __isset_bit_vector = new BitSet(4);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.FROM_TIME, new org.apache.thrift.meta_data.FieldMetaData("fromTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TO_TIME, new org.apache.thrift.meta_data.FieldMetaData("toTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PaymentStatus.class)));
      tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentsForUser_args.class, metaDataMap);
    }

    public getPaymentsForUser_args() {
    }

    public getPaymentsForUser_args(
      long userId,
      long fromTime,
      long toTime,
      PaymentStatus status,
      long gatewayId)
    {
      this();
      this.userId = userId;
      setUserIdIsSet(true);
      this.fromTime = fromTime;
      setFromTimeIsSet(true);
      this.toTime = toTime;
      setToTimeIsSet(true);
      this.status = status;
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentsForUser_args(getPaymentsForUser_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.userId = other.userId;
      this.fromTime = other.fromTime;
      this.toTime = other.toTime;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      this.gatewayId = other.gatewayId;
    }

    public getPaymentsForUser_args deepCopy() {
      return new getPaymentsForUser_args(this);
    }

    @Override
    public void clear() {
      setUserIdIsSet(false);
      this.userId = 0;
      setFromTimeIsSet(false);
      this.fromTime = 0;
      setToTimeIsSet(false);
      this.toTime = 0;
      this.status = null;
      setGatewayIdIsSet(false);
      this.gatewayId = 0;
    }

    public long getUserId() {
      return this.userId;
    }

    public void setUserId(long userId) {
      this.userId = userId;
      setUserIdIsSet(true);
    }

    public void unsetUserId() {
      __isset_bit_vector.clear(__USERID_ISSET_ID);
    }

    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
    public boolean isSetUserId() {
      return __isset_bit_vector.get(__USERID_ISSET_ID);
    }

    public void setUserIdIsSet(boolean value) {
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
    }

    public long getFromTime() {
      return this.fromTime;
    }

    public void setFromTime(long fromTime) {
      this.fromTime = fromTime;
      setFromTimeIsSet(true);
    }

    public void unsetFromTime() {
      __isset_bit_vector.clear(__FROMTIME_ISSET_ID);
    }

    /** Returns true if field fromTime is set (has been assigned a value) and false otherwise */
    public boolean isSetFromTime() {
      return __isset_bit_vector.get(__FROMTIME_ISSET_ID);
    }

    public void setFromTimeIsSet(boolean value) {
      __isset_bit_vector.set(__FROMTIME_ISSET_ID, value);
    }

    public long getToTime() {
      return this.toTime;
    }

    public void setToTime(long toTime) {
      this.toTime = toTime;
      setToTimeIsSet(true);
    }

    public void unsetToTime() {
      __isset_bit_vector.clear(__TOTIME_ISSET_ID);
    }

    /** Returns true if field toTime is set (has been assigned a value) and false otherwise */
    public boolean isSetToTime() {
      return __isset_bit_vector.get(__TOTIME_ISSET_ID);
    }

    public void setToTimeIsSet(boolean value) {
      __isset_bit_vector.set(__TOTIME_ISSET_ID, value);
    }

    /**
     * 
     * @see PaymentStatus
     */
    public PaymentStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see PaymentStatus
     */
    public void setStatus(PaymentStatus status) {
      this.status = status;
    }

    public void unsetStatus() {
      this.status = null;
    }

    /** Returns true if field status is set (has been assigned a value) and false otherwise */
    public boolean isSetStatus() {
      return this.status != null;
    }

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public long getGatewayId() {
      return this.gatewayId;
    }

    public void setGatewayId(long gatewayId) {
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    public void unsetGatewayId() {
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
    }

    /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayId() {
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
    }

    public void setGatewayIdIsSet(boolean value) {
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((Long)value);
        }
        break;

      case FROM_TIME:
        if (value == null) {
          unsetFromTime();
        } else {
          setFromTime((Long)value);
        }
        break;

      case TO_TIME:
        if (value == null) {
          unsetToTime();
        } else {
          setToTime((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((PaymentStatus)value);
        }
        break;

      case GATEWAY_ID:
        if (value == null) {
          unsetGatewayId();
        } else {
          setGatewayId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return Long.valueOf(getUserId());

      case FROM_TIME:
        return Long.valueOf(getFromTime());

      case TO_TIME:
        return Long.valueOf(getToTime());

      case STATUS:
        return getStatus();

      case GATEWAY_ID:
        return Long.valueOf(getGatewayId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case USER_ID:
        return isSetUserId();
      case FROM_TIME:
        return isSetFromTime();
      case TO_TIME:
        return isSetToTime();
      case STATUS:
        return isSetStatus();
      case GATEWAY_ID:
        return isSetGatewayId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentsForUser_args)
        return this.equals((getPaymentsForUser_args)that);
      return false;
    }

    public boolean equals(getPaymentsForUser_args that) {
      if (that == null)
        return false;

      boolean this_present_userId = true;
      boolean that_present_userId = true;
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (this.userId != that.userId)
          return false;
      }

      boolean this_present_fromTime = true;
      boolean that_present_fromTime = true;
      if (this_present_fromTime || that_present_fromTime) {
        if (!(this_present_fromTime && that_present_fromTime))
          return false;
        if (this.fromTime != that.fromTime)
          return false;
      }

      boolean this_present_toTime = true;
      boolean that_present_toTime = true;
      if (this_present_toTime || that_present_toTime) {
        if (!(this_present_toTime && that_present_toTime))
          return false;
        if (this.toTime != that.toTime)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_gatewayId = true;
      boolean that_present_gatewayId = true;
      if (this_present_gatewayId || that_present_gatewayId) {
        if (!(this_present_gatewayId && that_present_gatewayId))
          return false;
        if (this.gatewayId != that.gatewayId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentsForUser_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentsForUser_args typedOther = (getPaymentsForUser_args)other;

      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUserId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetFromTime()).compareTo(typedOther.isSetFromTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFromTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fromTime, typedOther.fromTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToTime()).compareTo(typedOther.isSetToTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.toTime, typedOther.toTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(typedOther.isSetGatewayId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, typedOther.gatewayId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // USER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.userId = iprot.readI64();
              setUserIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // FROM_TIME
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fromTime = iprot.readI64();
              setFromTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // TO_TIME
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.toTime = iprot.readI64();
              setToTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // STATUS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.status = PaymentStatus.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // GATEWAY_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.gatewayId = iprot.readI64();
              setGatewayIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
      oprot.writeI64(this.userId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
      oprot.writeI64(this.fromTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
      oprot.writeI64(this.toTime);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
      oprot.writeI64(this.gatewayId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentsForUser_args(");
      boolean first = true;

      sb.append("userId:");
      sb.append(this.userId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("fromTime:");
      sb.append(this.fromTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toTime:");
      sb.append(this.toTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        sb.append(this.status);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayId:");
      sb.append(this.gatewayId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentsForUser_result implements org.apache.thrift.TBase<getPaymentsForUser_result, getPaymentsForUser_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentsForUser_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Payment> success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class))));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentsForUser_result.class, metaDataMap);
    }

    public getPaymentsForUser_result() {
    }

    public getPaymentsForUser_result(
      List<Payment> success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentsForUser_result(getPaymentsForUser_result other) {
      if (other.isSetSuccess()) {
        List<Payment> __this__success = new ArrayList<Payment>();
        for (Payment other_element : other.success) {
          __this__success.add(new Payment(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPaymentsForUser_result deepCopy() {
      return new getPaymentsForUser_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Payment> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Payment elem) {
      if (this.success == null) {
        this.success = new ArrayList<Payment>();
      }
      this.success.add(elem);
    }

    public List<Payment> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Payment> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Payment>)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentsForUser_result)
        return this.equals((getPaymentsForUser_result)that);
      return false;
    }

    public boolean equals(getPaymentsForUser_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentsForUser_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentsForUser_result typedOther = (getPaymentsForUser_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
                this.success = new ArrayList<Payment>(_list12.size);
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
                {
                  Payment _elem14; // required
                  _elem14 = new Payment();
                  _elem14.read(iprot);
                  this.success.add(_elem14);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Payment _iter15 : this.success)
          {
            _iter15.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentsForUser_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPayments_args implements org.apache.thrift.TBase<getPayments_args, getPayments_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPayments_args");

    private static final org.apache.thrift.protocol.TField FROM_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("fromTime", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TO_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("toTime", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)3);
    private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.I64, (short)4);

    private long fromTime; // required
    private long toTime; // required
    private PaymentStatus status; // required
    private long gatewayId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      FROM_TIME((short)1, "fromTime"),
      TO_TIME((short)2, "toTime"),
      /**
       * 
       * @see PaymentStatus
       */
      STATUS((short)3, "status"),
      GATEWAY_ID((short)4, "gatewayId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // FROM_TIME
            return FROM_TIME;
          case 2: // TO_TIME
            return TO_TIME;
          case 3: // STATUS
            return STATUS;
          case 4: // GATEWAY_ID
            return GATEWAY_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __FROMTIME_ISSET_ID = 0;
    private static final int __TOTIME_ISSET_ID = 1;
    private static final int __GATEWAYID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.FROM_TIME, new org.apache.thrift.meta_data.FieldMetaData("fromTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TO_TIME, new org.apache.thrift.meta_data.FieldMetaData("toTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PaymentStatus.class)));
      tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPayments_args.class, metaDataMap);
    }

    public getPayments_args() {
    }

    public getPayments_args(
      long fromTime,
      long toTime,
      PaymentStatus status,
      long gatewayId)
    {
      this();
      this.fromTime = fromTime;
      setFromTimeIsSet(true);
      this.toTime = toTime;
      setToTimeIsSet(true);
      this.status = status;
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPayments_args(getPayments_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.fromTime = other.fromTime;
      this.toTime = other.toTime;
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      this.gatewayId = other.gatewayId;
    }

    public getPayments_args deepCopy() {
      return new getPayments_args(this);
    }

    @Override
    public void clear() {
      setFromTimeIsSet(false);
      this.fromTime = 0;
      setToTimeIsSet(false);
      this.toTime = 0;
      this.status = null;
      setGatewayIdIsSet(false);
      this.gatewayId = 0;
    }

    public long getFromTime() {
      return this.fromTime;
    }

    public void setFromTime(long fromTime) {
      this.fromTime = fromTime;
      setFromTimeIsSet(true);
    }

    public void unsetFromTime() {
      __isset_bit_vector.clear(__FROMTIME_ISSET_ID);
    }

    /** Returns true if field fromTime is set (has been assigned a value) and false otherwise */
    public boolean isSetFromTime() {
      return __isset_bit_vector.get(__FROMTIME_ISSET_ID);
    }

    public void setFromTimeIsSet(boolean value) {
      __isset_bit_vector.set(__FROMTIME_ISSET_ID, value);
    }

    public long getToTime() {
      return this.toTime;
    }

    public void setToTime(long toTime) {
      this.toTime = toTime;
      setToTimeIsSet(true);
    }

    public void unsetToTime() {
      __isset_bit_vector.clear(__TOTIME_ISSET_ID);
    }

    /** Returns true if field toTime is set (has been assigned a value) and false otherwise */
    public boolean isSetToTime() {
      return __isset_bit_vector.get(__TOTIME_ISSET_ID);
    }

    public void setToTimeIsSet(boolean value) {
      __isset_bit_vector.set(__TOTIME_ISSET_ID, value);
    }

    /**
     * 
     * @see PaymentStatus
     */
    public PaymentStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see PaymentStatus
     */
    public void setStatus(PaymentStatus status) {
      this.status = status;
    }

    public void unsetStatus() {
      this.status = null;
    }

    /** Returns true if field status is set (has been assigned a value) and false otherwise */
    public boolean isSetStatus() {
      return this.status != null;
    }

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public long getGatewayId() {
      return this.gatewayId;
    }

    public void setGatewayId(long gatewayId) {
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    public void unsetGatewayId() {
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
    }

    /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayId() {
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
    }

    public void setGatewayIdIsSet(boolean value) {
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FROM_TIME:
        if (value == null) {
          unsetFromTime();
        } else {
          setFromTime((Long)value);
        }
        break;

      case TO_TIME:
        if (value == null) {
          unsetToTime();
        } else {
          setToTime((Long)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((PaymentStatus)value);
        }
        break;

      case GATEWAY_ID:
        if (value == null) {
          unsetGatewayId();
        } else {
          setGatewayId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FROM_TIME:
        return Long.valueOf(getFromTime());

      case TO_TIME:
        return Long.valueOf(getToTime());

      case STATUS:
        return getStatus();

      case GATEWAY_ID:
        return Long.valueOf(getGatewayId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case FROM_TIME:
        return isSetFromTime();
      case TO_TIME:
        return isSetToTime();
      case STATUS:
        return isSetStatus();
      case GATEWAY_ID:
        return isSetGatewayId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPayments_args)
        return this.equals((getPayments_args)that);
      return false;
    }

    public boolean equals(getPayments_args that) {
      if (that == null)
        return false;

      boolean this_present_fromTime = true;
      boolean that_present_fromTime = true;
      if (this_present_fromTime || that_present_fromTime) {
        if (!(this_present_fromTime && that_present_fromTime))
          return false;
        if (this.fromTime != that.fromTime)
          return false;
      }

      boolean this_present_toTime = true;
      boolean that_present_toTime = true;
      if (this_present_toTime || that_present_toTime) {
        if (!(this_present_toTime && that_present_toTime))
          return false;
        if (this.toTime != that.toTime)
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_gatewayId = true;
      boolean that_present_gatewayId = true;
      if (this_present_gatewayId || that_present_gatewayId) {
        if (!(this_present_gatewayId && that_present_gatewayId))
          return false;
        if (this.gatewayId != that.gatewayId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPayments_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPayments_args typedOther = (getPayments_args)other;

      lastComparison = Boolean.valueOf(isSetFromTime()).compareTo(typedOther.isSetFromTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFromTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fromTime, typedOther.fromTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToTime()).compareTo(typedOther.isSetToTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.toTime, typedOther.toTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(typedOther.isSetGatewayId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, typedOther.gatewayId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // FROM_TIME
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fromTime = iprot.readI64();
              setFromTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TO_TIME
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.toTime = iprot.readI64();
              setToTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // STATUS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.status = PaymentStatus.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // GATEWAY_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.gatewayId = iprot.readI64();
              setGatewayIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
      oprot.writeI64(this.fromTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
      oprot.writeI64(this.toTime);
      oprot.writeFieldEnd();
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
      oprot.writeI64(this.gatewayId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPayments_args(");
      boolean first = true;

      sb.append("fromTime:");
      sb.append(this.fromTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toTime:");
      sb.append(this.toTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        sb.append(this.status);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayId:");
      sb.append(this.gatewayId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPayments_result implements org.apache.thrift.TBase<getPayments_result, getPayments_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPayments_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Payment> success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class))));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPayments_result.class, metaDataMap);
    }

    public getPayments_result() {
    }

    public getPayments_result(
      List<Payment> success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPayments_result(getPayments_result other) {
      if (other.isSetSuccess()) {
        List<Payment> __this__success = new ArrayList<Payment>();
        for (Payment other_element : other.success) {
          __this__success.add(new Payment(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPayments_result deepCopy() {
      return new getPayments_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Payment> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Payment elem) {
      if (this.success == null) {
        this.success = new ArrayList<Payment>();
      }
      this.success.add(elem);
    }

    public List<Payment> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Payment> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Payment>)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPayments_result)
        return this.equals((getPayments_result)that);
      return false;
    }

    public boolean equals(getPayments_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPayments_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPayments_result typedOther = (getPayments_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
                this.success = new ArrayList<Payment>(_list16.size);
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
                {
                  Payment _elem18; // required
                  _elem18 = new Payment();
                  _elem18.read(iprot);
                  this.success.add(_elem18);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Payment _iter19 : this.success)
          {
            _iter19.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPayments_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentsByCapturedDate_args implements org.apache.thrift.TBase<getPaymentsByCapturedDate_args, getPaymentsByCapturedDate_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentsByCapturedDate_args");

    private static final org.apache.thrift.protocol.TField FROM_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("fromTime", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField TO_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("toTime", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.I64, (short)3);

    private long fromTime; // required
    private long toTime; // required
    private long gatewayId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      FROM_TIME((short)1, "fromTime"),
      TO_TIME((short)2, "toTime"),
      GATEWAY_ID((short)3, "gatewayId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // FROM_TIME
            return FROM_TIME;
          case 2: // TO_TIME
            return TO_TIME;
          case 3: // GATEWAY_ID
            return GATEWAY_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __FROMTIME_ISSET_ID = 0;
    private static final int __TOTIME_ISSET_ID = 1;
    private static final int __GATEWAYID_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.FROM_TIME, new org.apache.thrift.meta_data.FieldMetaData("fromTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.TO_TIME, new org.apache.thrift.meta_data.FieldMetaData("toTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentsByCapturedDate_args.class, metaDataMap);
    }

    public getPaymentsByCapturedDate_args() {
    }

    public getPaymentsByCapturedDate_args(
      long fromTime,
      long toTime,
      long gatewayId)
    {
      this();
      this.fromTime = fromTime;
      setFromTimeIsSet(true);
      this.toTime = toTime;
      setToTimeIsSet(true);
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentsByCapturedDate_args(getPaymentsByCapturedDate_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.fromTime = other.fromTime;
      this.toTime = other.toTime;
      this.gatewayId = other.gatewayId;
    }

    public getPaymentsByCapturedDate_args deepCopy() {
      return new getPaymentsByCapturedDate_args(this);
    }

    @Override
    public void clear() {
      setFromTimeIsSet(false);
      this.fromTime = 0;
      setToTimeIsSet(false);
      this.toTime = 0;
      setGatewayIdIsSet(false);
      this.gatewayId = 0;
    }

    public long getFromTime() {
      return this.fromTime;
    }

    public void setFromTime(long fromTime) {
      this.fromTime = fromTime;
      setFromTimeIsSet(true);
    }

    public void unsetFromTime() {
      __isset_bit_vector.clear(__FROMTIME_ISSET_ID);
    }

    /** Returns true if field fromTime is set (has been assigned a value) and false otherwise */
    public boolean isSetFromTime() {
      return __isset_bit_vector.get(__FROMTIME_ISSET_ID);
    }

    public void setFromTimeIsSet(boolean value) {
      __isset_bit_vector.set(__FROMTIME_ISSET_ID, value);
    }

    public long getToTime() {
      return this.toTime;
    }

    public void setToTime(long toTime) {
      this.toTime = toTime;
      setToTimeIsSet(true);
    }

    public void unsetToTime() {
      __isset_bit_vector.clear(__TOTIME_ISSET_ID);
    }

    /** Returns true if field toTime is set (has been assigned a value) and false otherwise */
    public boolean isSetToTime() {
      return __isset_bit_vector.get(__TOTIME_ISSET_ID);
    }

    public void setToTimeIsSet(boolean value) {
      __isset_bit_vector.set(__TOTIME_ISSET_ID, value);
    }

    public long getGatewayId() {
      return this.gatewayId;
    }

    public void setGatewayId(long gatewayId) {
      this.gatewayId = gatewayId;
      setGatewayIdIsSet(true);
    }

    public void unsetGatewayId() {
      __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
    }

    /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayId() {
      return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
    }

    public void setGatewayIdIsSet(boolean value) {
      __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FROM_TIME:
        if (value == null) {
          unsetFromTime();
        } else {
          setFromTime((Long)value);
        }
        break;

      case TO_TIME:
        if (value == null) {
          unsetToTime();
        } else {
          setToTime((Long)value);
        }
        break;

      case GATEWAY_ID:
        if (value == null) {
          unsetGatewayId();
        } else {
          setGatewayId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FROM_TIME:
        return Long.valueOf(getFromTime());

      case TO_TIME:
        return Long.valueOf(getToTime());

      case GATEWAY_ID:
        return Long.valueOf(getGatewayId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case FROM_TIME:
        return isSetFromTime();
      case TO_TIME:
        return isSetToTime();
      case GATEWAY_ID:
        return isSetGatewayId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentsByCapturedDate_args)
        return this.equals((getPaymentsByCapturedDate_args)that);
      return false;
    }

    public boolean equals(getPaymentsByCapturedDate_args that) {
      if (that == null)
        return false;

      boolean this_present_fromTime = true;
      boolean that_present_fromTime = true;
      if (this_present_fromTime || that_present_fromTime) {
        if (!(this_present_fromTime && that_present_fromTime))
          return false;
        if (this.fromTime != that.fromTime)
          return false;
      }

      boolean this_present_toTime = true;
      boolean that_present_toTime = true;
      if (this_present_toTime || that_present_toTime) {
        if (!(this_present_toTime && that_present_toTime))
          return false;
        if (this.toTime != that.toTime)
          return false;
      }

      boolean this_present_gatewayId = true;
      boolean that_present_gatewayId = true;
      if (this_present_gatewayId || that_present_gatewayId) {
        if (!(this_present_gatewayId && that_present_gatewayId))
          return false;
        if (this.gatewayId != that.gatewayId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentsByCapturedDate_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentsByCapturedDate_args typedOther = (getPaymentsByCapturedDate_args)other;

      lastComparison = Boolean.valueOf(isSetFromTime()).compareTo(typedOther.isSetFromTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetFromTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fromTime, typedOther.fromTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetToTime()).compareTo(typedOther.isSetToTime());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetToTime()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.toTime, typedOther.toTime);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(typedOther.isSetGatewayId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, typedOther.gatewayId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // FROM_TIME
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.fromTime = iprot.readI64();
              setFromTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // TO_TIME
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.toTime = iprot.readI64();
              setToTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // GATEWAY_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.gatewayId = iprot.readI64();
              setGatewayIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(FROM_TIME_FIELD_DESC);
      oprot.writeI64(this.fromTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TO_TIME_FIELD_DESC);
      oprot.writeI64(this.toTime);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
      oprot.writeI64(this.gatewayId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentsByCapturedDate_args(");
      boolean first = true;

      sb.append("fromTime:");
      sb.append(this.fromTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("toTime:");
      sb.append(this.toTime);
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayId:");
      sb.append(this.gatewayId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentsByCapturedDate_result implements org.apache.thrift.TBase<getPaymentsByCapturedDate_result, getPaymentsByCapturedDate_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentsByCapturedDate_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Payment> success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class))));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentsByCapturedDate_result.class, metaDataMap);
    }

    public getPaymentsByCapturedDate_result() {
    }

    public getPaymentsByCapturedDate_result(
      List<Payment> success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentsByCapturedDate_result(getPaymentsByCapturedDate_result other) {
      if (other.isSetSuccess()) {
        List<Payment> __this__success = new ArrayList<Payment>();
        for (Payment other_element : other.success) {
          __this__success.add(new Payment(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPaymentsByCapturedDate_result deepCopy() {
      return new getPaymentsByCapturedDate_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Payment> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Payment elem) {
      if (this.success == null) {
        this.success = new ArrayList<Payment>();
      }
      this.success.add(elem);
    }

    public List<Payment> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Payment> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Payment>)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentsByCapturedDate_result)
        return this.equals((getPaymentsByCapturedDate_result)that);
      return false;
    }

    public boolean equals(getPaymentsByCapturedDate_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentsByCapturedDate_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentsByCapturedDate_result typedOther = (getPaymentsByCapturedDate_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list20 = iprot.readListBegin();
                this.success = new ArrayList<Payment>(_list20.size);
                for (int _i21 = 0; _i21 < _list20.size; ++_i21)
                {
                  Payment _elem22; // required
                  _elem22 = new Payment();
                  _elem22.read(iprot);
                  this.success.add(_elem22);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Payment _iter23 : this.success)
          {
            _iter23.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentsByCapturedDate_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentGateway_args implements org.apache.thrift.TBase<getPaymentGateway_args, getPaymentGateway_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentGateway_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long id; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentGateway_args.class, metaDataMap);
    }

    public getPaymentGateway_args() {
    }

    public getPaymentGateway_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentGateway_args(getPaymentGateway_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public getPaymentGateway_args deepCopy() {
      return new getPaymentGateway_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentGateway_args)
        return this.equals((getPaymentGateway_args)that);
      return false;
    }

    public boolean equals(getPaymentGateway_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentGateway_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentGateway_args typedOther = (getPaymentGateway_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentGateway_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentGateway_result implements org.apache.thrift.TBase<getPaymentGateway_result, getPaymentGateway_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentGateway_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private PaymentGateway success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PaymentGateway.class)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentGateway_result.class, metaDataMap);
    }

    public getPaymentGateway_result() {
    }

    public getPaymentGateway_result(
      PaymentGateway success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentGateway_result(getPaymentGateway_result other) {
      if (other.isSetSuccess()) {
        this.success = new PaymentGateway(other.success);
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPaymentGateway_result deepCopy() {
      return new getPaymentGateway_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public PaymentGateway getSuccess() {
      return this.success;
    }

    public void setSuccess(PaymentGateway success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((PaymentGateway)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentGateway_result)
        return this.equals((getPaymentGateway_result)that);
      return false;
    }

    public boolean equals(getPaymentGateway_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentGateway_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentGateway_result typedOther = (getPaymentGateway_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new PaymentGateway();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentGateway_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getActivePaymentGateways_args implements org.apache.thrift.TBase<getActivePaymentGateways_args, getActivePaymentGateways_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActivePaymentGateways_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActivePaymentGateways_args.class, metaDataMap);
    }

    public getActivePaymentGateways_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getActivePaymentGateways_args(getActivePaymentGateways_args other) {
    }

    public getActivePaymentGateways_args deepCopy() {
      return new getActivePaymentGateways_args(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getActivePaymentGateways_args)
        return this.equals((getActivePaymentGateways_args)that);
      return false;
    }

    public boolean equals(getActivePaymentGateways_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getActivePaymentGateways_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getActivePaymentGateways_args typedOther = (getActivePaymentGateways_args)other;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getActivePaymentGateways_args(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getActivePaymentGateways_result implements org.apache.thrift.TBase<getActivePaymentGateways_result, getActivePaymentGateways_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActivePaymentGateways_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<PaymentGateway> success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PaymentGateway.class))));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActivePaymentGateways_result.class, metaDataMap);
    }

    public getActivePaymentGateways_result() {
    }

    public getActivePaymentGateways_result(
      List<PaymentGateway> success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getActivePaymentGateways_result(getActivePaymentGateways_result other) {
      if (other.isSetSuccess()) {
        List<PaymentGateway> __this__success = new ArrayList<PaymentGateway>();
        for (PaymentGateway other_element : other.success) {
          __this__success.add(new PaymentGateway(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getActivePaymentGateways_result deepCopy() {
      return new getActivePaymentGateways_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<PaymentGateway> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(PaymentGateway elem) {
      if (this.success == null) {
        this.success = new ArrayList<PaymentGateway>();
      }
      this.success.add(elem);
    }

    public List<PaymentGateway> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<PaymentGateway> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<PaymentGateway>)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getActivePaymentGateways_result)
        return this.equals((getActivePaymentGateways_result)that);
      return false;
    }

    public boolean equals(getActivePaymentGateways_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getActivePaymentGateways_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getActivePaymentGateways_result typedOther = (getActivePaymentGateways_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
                this.success = new ArrayList<PaymentGateway>(_list24.size);
                for (int _i25 = 0; _i25 < _list24.size; ++_i25)
                {
                  PaymentGateway _elem26; // required
                  _elem26 = new PaymentGateway();
                  _elem26.read(iprot);
                  this.success.add(_elem26);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (PaymentGateway _iter27 : this.success)
          {
            _iter27.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getActivePaymentGateways_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPayment_args implements org.apache.thrift.TBase<getPayment_args, getPayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPayment_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);

    private long id; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPayment_args.class, metaDataMap);
    }

    public getPayment_args() {
    }

    public getPayment_args(
      long id)
    {
      this();
      this.id = id;
      setIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPayment_args(getPayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
    }

    public getPayment_args deepCopy() {
      return new getPayment_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPayment_args)
        return this.equals((getPayment_args)that);
      return false;
    }

    public boolean equals(getPayment_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPayment_args typedOther = (getPayment_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPayment_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPayment_result implements org.apache.thrift.TBase<getPayment_result, getPayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Payment success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPayment_result.class, metaDataMap);
    }

    public getPayment_result() {
    }

    public getPayment_result(
      Payment success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPayment_result(getPayment_result other) {
      if (other.isSetSuccess()) {
        this.success = new Payment(other.success);
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPayment_result deepCopy() {
      return new getPayment_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public Payment getSuccess() {
      return this.success;
    }

    public void setSuccess(Payment success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Payment)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPayment_result)
        return this.equals((getPayment_result)that);
      return false;
    }

    public boolean equals(getPayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPayment_result typedOther = (getPayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new Payment();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPayment_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentForTxnId_args implements org.apache.thrift.TBase<getPaymentForTxnId_args, getPaymentForTxnId_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentForTxnId_args");

    private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long txnId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TXN_ID((short)1, "txnId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TXN_ID
            return TXN_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TXNID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentForTxnId_args.class, metaDataMap);
    }

    public getPaymentForTxnId_args() {
    }

    public getPaymentForTxnId_args(
      long txnId)
    {
      this();
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentForTxnId_args(getPaymentForTxnId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.txnId = other.txnId;
    }

    public getPaymentForTxnId_args deepCopy() {
      return new getPaymentForTxnId_args(this);
    }

    @Override
    public void clear() {
      setTxnIdIsSet(false);
      this.txnId = 0;
    }

    public long getTxnId() {
      return this.txnId;
    }

    public void setTxnId(long txnId) {
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    public void unsetTxnId() {
      __isset_bit_vector.clear(__TXNID_ISSET_ID);
    }

    /** Returns true if field txnId is set (has been assigned a value) and false otherwise */
    public boolean isSetTxnId() {
      return __isset_bit_vector.get(__TXNID_ISSET_ID);
    }

    public void setTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__TXNID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TXN_ID:
        if (value == null) {
          unsetTxnId();
        } else {
          setTxnId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TXN_ID:
        return Long.valueOf(getTxnId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TXN_ID:
        return isSetTxnId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentForTxnId_args)
        return this.equals((getPaymentForTxnId_args)that);
      return false;
    }

    public boolean equals(getPaymentForTxnId_args that) {
      if (that == null)
        return false;

      boolean this_present_txnId = true;
      boolean that_present_txnId = true;
      if (this_present_txnId || that_present_txnId) {
        if (!(this_present_txnId && that_present_txnId))
          return false;
        if (this.txnId != that.txnId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentForTxnId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentForTxnId_args typedOther = (getPaymentForTxnId_args)other;

      lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(typedOther.isSetTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnId, typedOther.txnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.txnId = iprot.readI64();
              setTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
      oprot.writeI64(this.txnId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentForTxnId_args(");
      boolean first = true;

      sb.append("txnId:");
      sb.append(this.txnId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentForTxnId_result implements org.apache.thrift.TBase<getPaymentForTxnId_result, getPaymentForTxnId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentForTxnId_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Payment> success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class))));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentForTxnId_result.class, metaDataMap);
    }

    public getPaymentForTxnId_result() {
    }

    public getPaymentForTxnId_result(
      List<Payment> success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentForTxnId_result(getPaymentForTxnId_result other) {
      if (other.isSetSuccess()) {
        List<Payment> __this__success = new ArrayList<Payment>();
        for (Payment other_element : other.success) {
          __this__success.add(new Payment(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPaymentForTxnId_result deepCopy() {
      return new getPaymentForTxnId_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Payment> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Payment elem) {
      if (this.success == null) {
        this.success = new ArrayList<Payment>();
      }
      this.success.add(elem);
    }

    public List<Payment> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Payment> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Payment>)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentForTxnId_result)
        return this.equals((getPaymentForTxnId_result)that);
      return false;
    }

    public boolean equals(getPaymentForTxnId_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentForTxnId_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentForTxnId_result typedOther = (getPaymentForTxnId_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list28 = iprot.readListBegin();
                this.success = new ArrayList<Payment>(_list28.size);
                for (int _i29 = 0; _i29 < _list28.size; ++_i29)
                {
                  Payment _elem30; // required
                  _elem30 = new Payment();
                  _elem30.read(iprot);
                  this.success.add(_elem30);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Payment _iter31 : this.success)
          {
            _iter31.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentForTxnId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentForRechargeTxnId_args implements org.apache.thrift.TBase<getPaymentForRechargeTxnId_args, getPaymentForRechargeTxnId_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentForRechargeTxnId_args");

    private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long txnId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TXN_ID((short)1, "txnId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TXN_ID
            return TXN_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TXNID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentForRechargeTxnId_args.class, metaDataMap);
    }

    public getPaymentForRechargeTxnId_args() {
    }

    public getPaymentForRechargeTxnId_args(
      long txnId)
    {
      this();
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentForRechargeTxnId_args(getPaymentForRechargeTxnId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.txnId = other.txnId;
    }

    public getPaymentForRechargeTxnId_args deepCopy() {
      return new getPaymentForRechargeTxnId_args(this);
    }

    @Override
    public void clear() {
      setTxnIdIsSet(false);
      this.txnId = 0;
    }

    public long getTxnId() {
      return this.txnId;
    }

    public void setTxnId(long txnId) {
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    public void unsetTxnId() {
      __isset_bit_vector.clear(__TXNID_ISSET_ID);
    }

    /** Returns true if field txnId is set (has been assigned a value) and false otherwise */
    public boolean isSetTxnId() {
      return __isset_bit_vector.get(__TXNID_ISSET_ID);
    }

    public void setTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__TXNID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TXN_ID:
        if (value == null) {
          unsetTxnId();
        } else {
          setTxnId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TXN_ID:
        return Long.valueOf(getTxnId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TXN_ID:
        return isSetTxnId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentForRechargeTxnId_args)
        return this.equals((getPaymentForRechargeTxnId_args)that);
      return false;
    }

    public boolean equals(getPaymentForRechargeTxnId_args that) {
      if (that == null)
        return false;

      boolean this_present_txnId = true;
      boolean that_present_txnId = true;
      if (this_present_txnId || that_present_txnId) {
        if (!(this_present_txnId && that_present_txnId))
          return false;
        if (this.txnId != that.txnId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentForRechargeTxnId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentForRechargeTxnId_args typedOther = (getPaymentForRechargeTxnId_args)other;

      lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(typedOther.isSetTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnId, typedOther.txnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.txnId = iprot.readI64();
              setTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
      oprot.writeI64(this.txnId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentForRechargeTxnId_args(");
      boolean first = true;

      sb.append("txnId:");
      sb.append(this.txnId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentForRechargeTxnId_result implements org.apache.thrift.TBase<getPaymentForRechargeTxnId_result, getPaymentForRechargeTxnId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentForRechargeTxnId_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private List<Payment> success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class))));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentForRechargeTxnId_result.class, metaDataMap);
    }

    public getPaymentForRechargeTxnId_result() {
    }

    public getPaymentForRechargeTxnId_result(
      List<Payment> success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentForRechargeTxnId_result(getPaymentForRechargeTxnId_result other) {
      if (other.isSetSuccess()) {
        List<Payment> __this__success = new ArrayList<Payment>();
        for (Payment other_element : other.success) {
          __this__success.add(new Payment(other_element));
        }
        this.success = __this__success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPaymentForRechargeTxnId_result deepCopy() {
      return new getPaymentForRechargeTxnId_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Payment> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(Payment elem) {
      if (this.success == null) {
        this.success = new ArrayList<Payment>();
      }
      this.success.add(elem);
    }

    public List<Payment> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Payment> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Payment>)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentForRechargeTxnId_result)
        return this.equals((getPaymentForRechargeTxnId_result)that);
      return false;
    }

    public boolean equals(getPaymentForRechargeTxnId_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentForRechargeTxnId_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentForRechargeTxnId_result typedOther = (getPaymentForRechargeTxnId_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
                this.success = new ArrayList<Payment>(_list32.size);
                for (int _i33 = 0; _i33 < _list32.size; ++_i33)
                {
                  Payment _elem34; // required
                  _elem34 = new Payment();
                  _elem34.read(iprot);
                  this.success.add(_elem34);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
          for (Payment _iter35 : this.success)
          {
            _iter35.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentForRechargeTxnId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getSuccessfulPaymentForTxnId_args implements org.apache.thrift.TBase<getSuccessfulPaymentForTxnId_args, getSuccessfulPaymentForTxnId_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentForTxnId_args");

    private static final org.apache.thrift.protocol.TField TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnId", org.apache.thrift.protocol.TType.I64, (short)1);

    private long txnId; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      TXN_ID((short)1, "txnId");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // TXN_ID
            return TXN_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __TXNID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("txnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentForTxnId_args.class, metaDataMap);
    }

    public getSuccessfulPaymentForTxnId_args() {
    }

    public getSuccessfulPaymentForTxnId_args(
      long txnId)
    {
      this();
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getSuccessfulPaymentForTxnId_args(getSuccessfulPaymentForTxnId_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.txnId = other.txnId;
    }

    public getSuccessfulPaymentForTxnId_args deepCopy() {
      return new getSuccessfulPaymentForTxnId_args(this);
    }

    @Override
    public void clear() {
      setTxnIdIsSet(false);
      this.txnId = 0;
    }

    public long getTxnId() {
      return this.txnId;
    }

    public void setTxnId(long txnId) {
      this.txnId = txnId;
      setTxnIdIsSet(true);
    }

    public void unsetTxnId() {
      __isset_bit_vector.clear(__TXNID_ISSET_ID);
    }

    /** Returns true if field txnId is set (has been assigned a value) and false otherwise */
    public boolean isSetTxnId() {
      return __isset_bit_vector.get(__TXNID_ISSET_ID);
    }

    public void setTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__TXNID_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case TXN_ID:
        if (value == null) {
          unsetTxnId();
        } else {
          setTxnId((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case TXN_ID:
        return Long.valueOf(getTxnId());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case TXN_ID:
        return isSetTxnId();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSuccessfulPaymentForTxnId_args)
        return this.equals((getSuccessfulPaymentForTxnId_args)that);
      return false;
    }

    public boolean equals(getSuccessfulPaymentForTxnId_args that) {
      if (that == null)
        return false;

      boolean this_present_txnId = true;
      boolean that_present_txnId = true;
      if (this_present_txnId || that_present_txnId) {
        if (!(this_present_txnId && that_present_txnId))
          return false;
        if (this.txnId != that.txnId)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getSuccessfulPaymentForTxnId_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getSuccessfulPaymentForTxnId_args typedOther = (getSuccessfulPaymentForTxnId_args)other;

      lastComparison = Boolean.valueOf(isSetTxnId()).compareTo(typedOther.isSetTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnId, typedOther.txnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.txnId = iprot.readI64();
              setTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(TXN_ID_FIELD_DESC);
      oprot.writeI64(this.txnId);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentForTxnId_args(");
      boolean first = true;

      sb.append("txnId:");
      sb.append(this.txnId);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getSuccessfulPaymentForTxnId_result implements org.apache.thrift.TBase<getSuccessfulPaymentForTxnId_result, getSuccessfulPaymentForTxnId_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentForTxnId_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private Payment success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Payment.class)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentForTxnId_result.class, metaDataMap);
    }

    public getSuccessfulPaymentForTxnId_result() {
    }

    public getSuccessfulPaymentForTxnId_result(
      Payment success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getSuccessfulPaymentForTxnId_result(getSuccessfulPaymentForTxnId_result other) {
      if (other.isSetSuccess()) {
        this.success = new Payment(other.success);
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getSuccessfulPaymentForTxnId_result deepCopy() {
      return new getSuccessfulPaymentForTxnId_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public Payment getSuccess() {
      return this.success;
    }

    public void setSuccess(Payment success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Payment)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSuccessfulPaymentForTxnId_result)
        return this.equals((getSuccessfulPaymentForTxnId_result)that);
      return false;
    }

    public boolean equals(getSuccessfulPaymentForTxnId_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getSuccessfulPaymentForTxnId_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getSuccessfulPaymentForTxnId_result typedOther = (getSuccessfulPaymentForTxnId_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.success = new Payment();
              this.success.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        this.success.write(oprot);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentForTxnId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class updatePaymentDetails_args implements org.apache.thrift.TBase<updatePaymentDetails_args, updatePaymentDetails_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updatePaymentDetails_args");

    private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField GATEWAY_PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayPaymentId", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField GATEWAY_TXN_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayTxnStatus", org.apache.thrift.protocol.TType.STRING, (short)4);
    private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)5);
    private static final org.apache.thrift.protocol.TField GATEWAY_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayTxnId", org.apache.thrift.protocol.TType.STRING, (short)6);
    private static final org.apache.thrift.protocol.TField AUTH_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("authCode", org.apache.thrift.protocol.TType.STRING, (short)7);
    private static final org.apache.thrift.protocol.TField REFERENCE_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("referenceCode", org.apache.thrift.protocol.TType.STRING, (short)8);
    private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.STRING, (short)9);
    private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)10);
    private static final org.apache.thrift.protocol.TField GATEWAY_TXN_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayTxnDate", org.apache.thrift.protocol.TType.STRING, (short)11);
    private static final org.apache.thrift.protocol.TField ATTRIBUTES_FIELD_DESC = new org.apache.thrift.protocol.TField("attributes", org.apache.thrift.protocol.TType.LIST, (short)12);

    private long id; // required
    private String gatewayPaymentId; // required
    private String sessionId; // required
    private String gatewayTxnStatus; // required
    private String description; // required
    private String gatewayTxnId; // required
    private String authCode; // required
    private String referenceCode; // required
    private String errorCode; // required
    private PaymentStatus status; // required
    private String gatewayTxnDate; // required
    private List<Attribute> attributes; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ID((short)1, "id"),
      GATEWAY_PAYMENT_ID((short)2, "gatewayPaymentId"),
      SESSION_ID((short)3, "sessionId"),
      GATEWAY_TXN_STATUS((short)4, "gatewayTxnStatus"),
      DESCRIPTION((short)5, "description"),
      GATEWAY_TXN_ID((short)6, "gatewayTxnId"),
      AUTH_CODE((short)7, "authCode"),
      REFERENCE_CODE((short)8, "referenceCode"),
      ERROR_CODE((short)9, "errorCode"),
      /**
       * 
       * @see PaymentStatus
       */
      STATUS((short)10, "status"),
      GATEWAY_TXN_DATE((short)11, "gatewayTxnDate"),
      ATTRIBUTES((short)12, "attributes");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ID
            return ID;
          case 2: // GATEWAY_PAYMENT_ID
            return GATEWAY_PAYMENT_ID;
          case 3: // SESSION_ID
            return SESSION_ID;
          case 4: // GATEWAY_TXN_STATUS
            return GATEWAY_TXN_STATUS;
          case 5: // DESCRIPTION
            return DESCRIPTION;
          case 6: // GATEWAY_TXN_ID
            return GATEWAY_TXN_ID;
          case 7: // AUTH_CODE
            return AUTH_CODE;
          case 8: // REFERENCE_CODE
            return REFERENCE_CODE;
          case 9: // ERROR_CODE
            return ERROR_CODE;
          case 10: // STATUS
            return STATUS;
          case 11: // GATEWAY_TXN_DATE
            return GATEWAY_TXN_DATE;
          case 12: // ATTRIBUTES
            return ATTRIBUTES;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.GATEWAY_PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayPaymentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.GATEWAY_TXN_STATUS, new org.apache.thrift.meta_data.FieldMetaData("gatewayTxnStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.GATEWAY_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.AUTH_CODE, new org.apache.thrift.meta_data.FieldMetaData("authCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.REFERENCE_CODE, new org.apache.thrift.meta_data.FieldMetaData("referenceCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PaymentStatus.class)));
      tmpMap.put(_Fields.GATEWAY_TXN_DATE, new org.apache.thrift.meta_data.FieldMetaData("gatewayTxnDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.ATTRIBUTES, new org.apache.thrift.meta_data.FieldMetaData("attributes", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Attribute.class))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updatePaymentDetails_args.class, metaDataMap);
    }

    public updatePaymentDetails_args() {
    }

    public updatePaymentDetails_args(
      long id,
      String gatewayPaymentId,
      String sessionId,
      String gatewayTxnStatus,
      String description,
      String gatewayTxnId,
      String authCode,
      String referenceCode,
      String errorCode,
      PaymentStatus status,
      String gatewayTxnDate,
      List<Attribute> attributes)
    {
      this();
      this.id = id;
      setIdIsSet(true);
      this.gatewayPaymentId = gatewayPaymentId;
      this.sessionId = sessionId;
      this.gatewayTxnStatus = gatewayTxnStatus;
      this.description = description;
      this.gatewayTxnId = gatewayTxnId;
      this.authCode = authCode;
      this.referenceCode = referenceCode;
      this.errorCode = errorCode;
      this.status = status;
      this.gatewayTxnDate = gatewayTxnDate;
      this.attributes = attributes;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updatePaymentDetails_args(updatePaymentDetails_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.id = other.id;
      if (other.isSetGatewayPaymentId()) {
        this.gatewayPaymentId = other.gatewayPaymentId;
      }
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
      if (other.isSetGatewayTxnStatus()) {
        this.gatewayTxnStatus = other.gatewayTxnStatus;
      }
      if (other.isSetDescription()) {
        this.description = other.description;
      }
      if (other.isSetGatewayTxnId()) {
        this.gatewayTxnId = other.gatewayTxnId;
      }
      if (other.isSetAuthCode()) {
        this.authCode = other.authCode;
      }
      if (other.isSetReferenceCode()) {
        this.referenceCode = other.referenceCode;
      }
      if (other.isSetErrorCode()) {
        this.errorCode = other.errorCode;
      }
      if (other.isSetStatus()) {
        this.status = other.status;
      }
      if (other.isSetGatewayTxnDate()) {
        this.gatewayTxnDate = other.gatewayTxnDate;
      }
      if (other.isSetAttributes()) {
        List<Attribute> __this__attributes = new ArrayList<Attribute>();
        for (Attribute other_element : other.attributes) {
          __this__attributes.add(new Attribute(other_element));
        }
        this.attributes = __this__attributes;
      }
    }

    public updatePaymentDetails_args deepCopy() {
      return new updatePaymentDetails_args(this);
    }

    @Override
    public void clear() {
      setIdIsSet(false);
      this.id = 0;
      this.gatewayPaymentId = null;
      this.sessionId = null;
      this.gatewayTxnStatus = null;
      this.description = null;
      this.gatewayTxnId = null;
      this.authCode = null;
      this.referenceCode = null;
      this.errorCode = null;
      this.status = null;
      this.gatewayTxnDate = null;
      this.attributes = null;
    }

    public long getId() {
      return this.id;
    }

    public void setId(long id) {
      this.id = id;
      setIdIsSet(true);
    }

    public void unsetId() {
      __isset_bit_vector.clear(__ID_ISSET_ID);
    }

    /** Returns true if field id is set (has been assigned a value) and false otherwise */
    public boolean isSetId() {
      return __isset_bit_vector.get(__ID_ISSET_ID);
    }

    public void setIdIsSet(boolean value) {
      __isset_bit_vector.set(__ID_ISSET_ID, value);
    }

    public String getGatewayPaymentId() {
      return this.gatewayPaymentId;
    }

    public void setGatewayPaymentId(String gatewayPaymentId) {
      this.gatewayPaymentId = gatewayPaymentId;
    }

    public void unsetGatewayPaymentId() {
      this.gatewayPaymentId = null;
    }

    /** Returns true if field gatewayPaymentId is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayPaymentId() {
      return this.gatewayPaymentId != null;
    }

    public void setGatewayPaymentIdIsSet(boolean value) {
      if (!value) {
        this.gatewayPaymentId = null;
      }
    }

    public String getSessionId() {
      return this.sessionId;
    }

    public void setSessionId(String sessionId) {
      this.sessionId = sessionId;
    }

    public void unsetSessionId() {
      this.sessionId = null;
    }

    /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
    public boolean isSetSessionId() {
      return this.sessionId != null;
    }

    public void setSessionIdIsSet(boolean value) {
      if (!value) {
        this.sessionId = null;
      }
    }

    public String getGatewayTxnStatus() {
      return this.gatewayTxnStatus;
    }

    public void setGatewayTxnStatus(String gatewayTxnStatus) {
      this.gatewayTxnStatus = gatewayTxnStatus;
    }

    public void unsetGatewayTxnStatus() {
      this.gatewayTxnStatus = null;
    }

    /** Returns true if field gatewayTxnStatus is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayTxnStatus() {
      return this.gatewayTxnStatus != null;
    }

    public void setGatewayTxnStatusIsSet(boolean value) {
      if (!value) {
        this.gatewayTxnStatus = null;
      }
    }

    public String getDescription() {
      return this.description;
    }

    public void setDescription(String description) {
      this.description = description;
    }

    public void unsetDescription() {
      this.description = null;
    }

    /** Returns true if field description is set (has been assigned a value) and false otherwise */
    public boolean isSetDescription() {
      return this.description != null;
    }

    public void setDescriptionIsSet(boolean value) {
      if (!value) {
        this.description = null;
      }
    }

    public String getGatewayTxnId() {
      return this.gatewayTxnId;
    }

    public void setGatewayTxnId(String gatewayTxnId) {
      this.gatewayTxnId = gatewayTxnId;
    }

    public void unsetGatewayTxnId() {
      this.gatewayTxnId = null;
    }

    /** Returns true if field gatewayTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayTxnId() {
      return this.gatewayTxnId != null;
    }

    public void setGatewayTxnIdIsSet(boolean value) {
      if (!value) {
        this.gatewayTxnId = null;
      }
    }

    public String getAuthCode() {
      return this.authCode;
    }

    public void setAuthCode(String authCode) {
      this.authCode = authCode;
    }

    public void unsetAuthCode() {
      this.authCode = null;
    }

    /** Returns true if field authCode is set (has been assigned a value) and false otherwise */
    public boolean isSetAuthCode() {
      return this.authCode != null;
    }

    public void setAuthCodeIsSet(boolean value) {
      if (!value) {
        this.authCode = null;
      }
    }

    public String getReferenceCode() {
      return this.referenceCode;
    }

    public void setReferenceCode(String referenceCode) {
      this.referenceCode = referenceCode;
    }

    public void unsetReferenceCode() {
      this.referenceCode = null;
    }

    /** Returns true if field referenceCode is set (has been assigned a value) and false otherwise */
    public boolean isSetReferenceCode() {
      return this.referenceCode != null;
    }

    public void setReferenceCodeIsSet(boolean value) {
      if (!value) {
        this.referenceCode = null;
      }
    }

    public String getErrorCode() {
      return this.errorCode;
    }

    public void setErrorCode(String errorCode) {
      this.errorCode = errorCode;
    }

    public void unsetErrorCode() {
      this.errorCode = null;
    }

    /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */
    public boolean isSetErrorCode() {
      return this.errorCode != null;
    }

    public void setErrorCodeIsSet(boolean value) {
      if (!value) {
        this.errorCode = null;
      }
    }

    /**
     * 
     * @see PaymentStatus
     */
    public PaymentStatus getStatus() {
      return this.status;
    }

    /**
     * 
     * @see PaymentStatus
     */
    public void setStatus(PaymentStatus status) {
      this.status = status;
    }

    public void unsetStatus() {
      this.status = null;
    }

    /** Returns true if field status is set (has been assigned a value) and false otherwise */
    public boolean isSetStatus() {
      return this.status != null;
    }

    public void setStatusIsSet(boolean value) {
      if (!value) {
        this.status = null;
      }
    }

    public String getGatewayTxnDate() {
      return this.gatewayTxnDate;
    }

    public void setGatewayTxnDate(String gatewayTxnDate) {
      this.gatewayTxnDate = gatewayTxnDate;
    }

    public void unsetGatewayTxnDate() {
      this.gatewayTxnDate = null;
    }

    /** Returns true if field gatewayTxnDate is set (has been assigned a value) and false otherwise */
    public boolean isSetGatewayTxnDate() {
      return this.gatewayTxnDate != null;
    }

    public void setGatewayTxnDateIsSet(boolean value) {
      if (!value) {
        this.gatewayTxnDate = null;
      }
    }

    public int getAttributesSize() {
      return (this.attributes == null) ? 0 : this.attributes.size();
    }

    public java.util.Iterator<Attribute> getAttributesIterator() {
      return (this.attributes == null) ? null : this.attributes.iterator();
    }

    public void addToAttributes(Attribute elem) {
      if (this.attributes == null) {
        this.attributes = new ArrayList<Attribute>();
      }
      this.attributes.add(elem);
    }

    public List<Attribute> getAttributes() {
      return this.attributes;
    }

    public void setAttributes(List<Attribute> attributes) {
      this.attributes = attributes;
    }

    public void unsetAttributes() {
      this.attributes = null;
    }

    /** Returns true if field attributes is set (has been assigned a value) and false otherwise */
    public boolean isSetAttributes() {
      return this.attributes != null;
    }

    public void setAttributesIsSet(boolean value) {
      if (!value) {
        this.attributes = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ID:
        if (value == null) {
          unsetId();
        } else {
          setId((Long)value);
        }
        break;

      case GATEWAY_PAYMENT_ID:
        if (value == null) {
          unsetGatewayPaymentId();
        } else {
          setGatewayPaymentId((String)value);
        }
        break;

      case SESSION_ID:
        if (value == null) {
          unsetSessionId();
        } else {
          setSessionId((String)value);
        }
        break;

      case GATEWAY_TXN_STATUS:
        if (value == null) {
          unsetGatewayTxnStatus();
        } else {
          setGatewayTxnStatus((String)value);
        }
        break;

      case DESCRIPTION:
        if (value == null) {
          unsetDescription();
        } else {
          setDescription((String)value);
        }
        break;

      case GATEWAY_TXN_ID:
        if (value == null) {
          unsetGatewayTxnId();
        } else {
          setGatewayTxnId((String)value);
        }
        break;

      case AUTH_CODE:
        if (value == null) {
          unsetAuthCode();
        } else {
          setAuthCode((String)value);
        }
        break;

      case REFERENCE_CODE:
        if (value == null) {
          unsetReferenceCode();
        } else {
          setReferenceCode((String)value);
        }
        break;

      case ERROR_CODE:
        if (value == null) {
          unsetErrorCode();
        } else {
          setErrorCode((String)value);
        }
        break;

      case STATUS:
        if (value == null) {
          unsetStatus();
        } else {
          setStatus((PaymentStatus)value);
        }
        break;

      case GATEWAY_TXN_DATE:
        if (value == null) {
          unsetGatewayTxnDate();
        } else {
          setGatewayTxnDate((String)value);
        }
        break;

      case ATTRIBUTES:
        if (value == null) {
          unsetAttributes();
        } else {
          setAttributes((List<Attribute>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ID:
        return Long.valueOf(getId());

      case GATEWAY_PAYMENT_ID:
        return getGatewayPaymentId();

      case SESSION_ID:
        return getSessionId();

      case GATEWAY_TXN_STATUS:
        return getGatewayTxnStatus();

      case DESCRIPTION:
        return getDescription();

      case GATEWAY_TXN_ID:
        return getGatewayTxnId();

      case AUTH_CODE:
        return getAuthCode();

      case REFERENCE_CODE:
        return getReferenceCode();

      case ERROR_CODE:
        return getErrorCode();

      case STATUS:
        return getStatus();

      case GATEWAY_TXN_DATE:
        return getGatewayTxnDate();

      case ATTRIBUTES:
        return getAttributes();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ID:
        return isSetId();
      case GATEWAY_PAYMENT_ID:
        return isSetGatewayPaymentId();
      case SESSION_ID:
        return isSetSessionId();
      case GATEWAY_TXN_STATUS:
        return isSetGatewayTxnStatus();
      case DESCRIPTION:
        return isSetDescription();
      case GATEWAY_TXN_ID:
        return isSetGatewayTxnId();
      case AUTH_CODE:
        return isSetAuthCode();
      case REFERENCE_CODE:
        return isSetReferenceCode();
      case ERROR_CODE:
        return isSetErrorCode();
      case STATUS:
        return isSetStatus();
      case GATEWAY_TXN_DATE:
        return isSetGatewayTxnDate();
      case ATTRIBUTES:
        return isSetAttributes();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updatePaymentDetails_args)
        return this.equals((updatePaymentDetails_args)that);
      return false;
    }

    public boolean equals(updatePaymentDetails_args that) {
      if (that == null)
        return false;

      boolean this_present_id = true;
      boolean that_present_id = true;
      if (this_present_id || that_present_id) {
        if (!(this_present_id && that_present_id))
          return false;
        if (this.id != that.id)
          return false;
      }

      boolean this_present_gatewayPaymentId = true && this.isSetGatewayPaymentId();
      boolean that_present_gatewayPaymentId = true && that.isSetGatewayPaymentId();
      if (this_present_gatewayPaymentId || that_present_gatewayPaymentId) {
        if (!(this_present_gatewayPaymentId && that_present_gatewayPaymentId))
          return false;
        if (!this.gatewayPaymentId.equals(that.gatewayPaymentId))
          return false;
      }

      boolean this_present_sessionId = true && this.isSetSessionId();
      boolean that_present_sessionId = true && that.isSetSessionId();
      if (this_present_sessionId || that_present_sessionId) {
        if (!(this_present_sessionId && that_present_sessionId))
          return false;
        if (!this.sessionId.equals(that.sessionId))
          return false;
      }

      boolean this_present_gatewayTxnStatus = true && this.isSetGatewayTxnStatus();
      boolean that_present_gatewayTxnStatus = true && that.isSetGatewayTxnStatus();
      if (this_present_gatewayTxnStatus || that_present_gatewayTxnStatus) {
        if (!(this_present_gatewayTxnStatus && that_present_gatewayTxnStatus))
          return false;
        if (!this.gatewayTxnStatus.equals(that.gatewayTxnStatus))
          return false;
      }

      boolean this_present_description = true && this.isSetDescription();
      boolean that_present_description = true && that.isSetDescription();
      if (this_present_description || that_present_description) {
        if (!(this_present_description && that_present_description))
          return false;
        if (!this.description.equals(that.description))
          return false;
      }

      boolean this_present_gatewayTxnId = true && this.isSetGatewayTxnId();
      boolean that_present_gatewayTxnId = true && that.isSetGatewayTxnId();
      if (this_present_gatewayTxnId || that_present_gatewayTxnId) {
        if (!(this_present_gatewayTxnId && that_present_gatewayTxnId))
          return false;
        if (!this.gatewayTxnId.equals(that.gatewayTxnId))
          return false;
      }

      boolean this_present_authCode = true && this.isSetAuthCode();
      boolean that_present_authCode = true && that.isSetAuthCode();
      if (this_present_authCode || that_present_authCode) {
        if (!(this_present_authCode && that_present_authCode))
          return false;
        if (!this.authCode.equals(that.authCode))
          return false;
      }

      boolean this_present_referenceCode = true && this.isSetReferenceCode();
      boolean that_present_referenceCode = true && that.isSetReferenceCode();
      if (this_present_referenceCode || that_present_referenceCode) {
        if (!(this_present_referenceCode && that_present_referenceCode))
          return false;
        if (!this.referenceCode.equals(that.referenceCode))
          return false;
      }

      boolean this_present_errorCode = true && this.isSetErrorCode();
      boolean that_present_errorCode = true && that.isSetErrorCode();
      if (this_present_errorCode || that_present_errorCode) {
        if (!(this_present_errorCode && that_present_errorCode))
          return false;
        if (!this.errorCode.equals(that.errorCode))
          return false;
      }

      boolean this_present_status = true && this.isSetStatus();
      boolean that_present_status = true && that.isSetStatus();
      if (this_present_status || that_present_status) {
        if (!(this_present_status && that_present_status))
          return false;
        if (!this.status.equals(that.status))
          return false;
      }

      boolean this_present_gatewayTxnDate = true && this.isSetGatewayTxnDate();
      boolean that_present_gatewayTxnDate = true && that.isSetGatewayTxnDate();
      if (this_present_gatewayTxnDate || that_present_gatewayTxnDate) {
        if (!(this_present_gatewayTxnDate && that_present_gatewayTxnDate))
          return false;
        if (!this.gatewayTxnDate.equals(that.gatewayTxnDate))
          return false;
      }

      boolean this_present_attributes = true && this.isSetAttributes();
      boolean that_present_attributes = true && that.isSetAttributes();
      if (this_present_attributes || that_present_attributes) {
        if (!(this_present_attributes && that_present_attributes))
          return false;
        if (!this.attributes.equals(that.attributes))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updatePaymentDetails_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updatePaymentDetails_args typedOther = (updatePaymentDetails_args)other;

      lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayPaymentId()).compareTo(typedOther.isSetGatewayPaymentId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayPaymentId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayPaymentId, typedOther.gatewayPaymentId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(typedOther.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, typedOther.sessionId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayTxnStatus()).compareTo(typedOther.isSetGatewayTxnStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayTxnStatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayTxnStatus, typedOther.gatewayTxnStatus);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetDescription()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayTxnId()).compareTo(typedOther.isSetGatewayTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayTxnId, typedOther.gatewayTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAuthCode()).compareTo(typedOther.isSetAuthCode());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAuthCode()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authCode, typedOther.authCode);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetReferenceCode()).compareTo(typedOther.isSetReferenceCode());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetReferenceCode()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.referenceCode, typedOther.referenceCode);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(typedOther.isSetErrorCode());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetErrorCode()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, typedOther.errorCode);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStatus()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetGatewayTxnDate()).compareTo(typedOther.isSetGatewayTxnDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetGatewayTxnDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayTxnDate, typedOther.gatewayTxnDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(typedOther.isSetAttributes());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAttributes()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attributes, typedOther.attributes);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.id = iprot.readI64();
              setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // GATEWAY_PAYMENT_ID
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.gatewayPaymentId = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // SESSION_ID
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.sessionId = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // GATEWAY_TXN_STATUS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.gatewayTxnStatus = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // DESCRIPTION
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.description = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 6: // GATEWAY_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.gatewayTxnId = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 7: // AUTH_CODE
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.authCode = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 8: // REFERENCE_CODE
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.referenceCode = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 9: // ERROR_CODE
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.errorCode = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 10: // STATUS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.status = PaymentStatus.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 11: // GATEWAY_TXN_DATE
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.gatewayTxnDate = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 12: // ATTRIBUTES
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list36 = iprot.readListBegin();
                this.attributes = new ArrayList<Attribute>(_list36.size);
                for (int _i37 = 0; _i37 < _list36.size; ++_i37)
                {
                  Attribute _elem38; // required
                  _elem38 = new Attribute();
                  _elem38.read(iprot);
                  this.attributes.add(_elem38);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(this.id);
      oprot.writeFieldEnd();
      if (this.gatewayPaymentId != null) {
        oprot.writeFieldBegin(GATEWAY_PAYMENT_ID_FIELD_DESC);
        oprot.writeString(this.gatewayPaymentId);
        oprot.writeFieldEnd();
      }
      if (this.sessionId != null) {
        oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
        oprot.writeString(this.sessionId);
        oprot.writeFieldEnd();
      }
      if (this.gatewayTxnStatus != null) {
        oprot.writeFieldBegin(GATEWAY_TXN_STATUS_FIELD_DESC);
        oprot.writeString(this.gatewayTxnStatus);
        oprot.writeFieldEnd();
      }
      if (this.description != null) {
        oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
        oprot.writeString(this.description);
        oprot.writeFieldEnd();
      }
      if (this.gatewayTxnId != null) {
        oprot.writeFieldBegin(GATEWAY_TXN_ID_FIELD_DESC);
        oprot.writeString(this.gatewayTxnId);
        oprot.writeFieldEnd();
      }
      if (this.authCode != null) {
        oprot.writeFieldBegin(AUTH_CODE_FIELD_DESC);
        oprot.writeString(this.authCode);
        oprot.writeFieldEnd();
      }
      if (this.referenceCode != null) {
        oprot.writeFieldBegin(REFERENCE_CODE_FIELD_DESC);
        oprot.writeString(this.referenceCode);
        oprot.writeFieldEnd();
      }
      if (this.errorCode != null) {
        oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC);
        oprot.writeString(this.errorCode);
        oprot.writeFieldEnd();
      }
      if (this.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(this.status.getValue());
        oprot.writeFieldEnd();
      }
      if (this.gatewayTxnDate != null) {
        oprot.writeFieldBegin(GATEWAY_TXN_DATE_FIELD_DESC);
        oprot.writeString(this.gatewayTxnDate);
        oprot.writeFieldEnd();
      }
      if (this.attributes != null) {
        oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.attributes.size()));
          for (Attribute _iter39 : this.attributes)
          {
            _iter39.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updatePaymentDetails_args(");
      boolean first = true;

      sb.append("id:");
      sb.append(this.id);
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayPaymentId:");
      if (this.gatewayPaymentId == null) {
        sb.append("null");
      } else {
        sb.append(this.gatewayPaymentId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayTxnStatus:");
      if (this.gatewayTxnStatus == null) {
        sb.append("null");
      } else {
        sb.append(this.gatewayTxnStatus);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("description:");
      if (this.description == null) {
        sb.append("null");
      } else {
        sb.append(this.description);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayTxnId:");
      if (this.gatewayTxnId == null) {
        sb.append("null");
      } else {
        sb.append(this.gatewayTxnId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("authCode:");
      if (this.authCode == null) {
        sb.append("null");
      } else {
        sb.append(this.authCode);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("referenceCode:");
      if (this.referenceCode == null) {
        sb.append("null");
      } else {
        sb.append(this.referenceCode);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("errorCode:");
      if (this.errorCode == null) {
        sb.append("null");
      } else {
        sb.append(this.errorCode);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("status:");
      if (this.status == null) {
        sb.append("null");
      } else {
        sb.append(this.status);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("gatewayTxnDate:");
      if (this.gatewayTxnDate == null) {
        sb.append("null");
      } else {
        sb.append(this.gatewayTxnDate);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("attributes:");
      if (this.attributes == null) {
        sb.append("null");
      } else {
        sb.append(this.attributes);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class updatePaymentDetails_result implements org.apache.thrift.TBase<updatePaymentDetails_result, updatePaymentDetails_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updatePaymentDetails_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updatePaymentDetails_result.class, metaDataMap);
    }

    public updatePaymentDetails_result() {
    }

    public updatePaymentDetails_result(
      boolean success,
      PaymentException pe)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public updatePaymentDetails_result(updatePaymentDetails_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public updatePaymentDetails_result deepCopy() {
      return new updatePaymentDetails_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.pe = null;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof updatePaymentDetails_result)
        return this.equals((updatePaymentDetails_result)that);
      return false;
    }

    public boolean equals(updatePaymentDetails_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(updatePaymentDetails_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      updatePaymentDetails_result typedOther = (updatePaymentDetails_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.success = iprot.readBool();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("updatePaymentDetails_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getSuccessfulPaymentsAmountRange_args implements org.apache.thrift.TBase<getSuccessfulPaymentsAmountRange_args, getSuccessfulPaymentsAmountRange_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentsAmountRange_args");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentsAmountRange_args.class, metaDataMap);
    }

    public getSuccessfulPaymentsAmountRange_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getSuccessfulPaymentsAmountRange_args(getSuccessfulPaymentsAmountRange_args other) {
    }

    public getSuccessfulPaymentsAmountRange_args deepCopy() {
      return new getSuccessfulPaymentsAmountRange_args(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSuccessfulPaymentsAmountRange_args)
        return this.equals((getSuccessfulPaymentsAmountRange_args)that);
      return false;
    }

    public boolean equals(getSuccessfulPaymentsAmountRange_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getSuccessfulPaymentsAmountRange_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getSuccessfulPaymentsAmountRange_args typedOther = (getSuccessfulPaymentsAmountRange_args)other;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentsAmountRange_args(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getSuccessfulPaymentsAmountRange_result implements org.apache.thrift.TBase<getSuccessfulPaymentsAmountRange_result, getSuccessfulPaymentsAmountRange_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentsAmountRange_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Double> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentsAmountRange_result.class, metaDataMap);
    }

    public getSuccessfulPaymentsAmountRange_result() {
    }

    public getSuccessfulPaymentsAmountRange_result(
      List<Double> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getSuccessfulPaymentsAmountRange_result(getSuccessfulPaymentsAmountRange_result other) {
      if (other.isSetSuccess()) {
        List<Double> __this__success = new ArrayList<Double>();
        for (Double other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

    public getSuccessfulPaymentsAmountRange_result deepCopy() {
      return new getSuccessfulPaymentsAmountRange_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Double> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(double elem) {
      if (this.success == null) {
        this.success = new ArrayList<Double>();
      }
      this.success.add(elem);
    }

    public List<Double> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Double> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Double>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getSuccessfulPaymentsAmountRange_result)
        return this.equals((getSuccessfulPaymentsAmountRange_result)that);
      return false;
    }

    public boolean equals(getSuccessfulPaymentsAmountRange_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getSuccessfulPaymentsAmountRange_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getSuccessfulPaymentsAmountRange_result typedOther = (getSuccessfulPaymentsAmountRange_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list40 = iprot.readListBegin();
                this.success = new ArrayList<Double>(_list40.size);
                for (int _i41 = 0; _i41 < _list40.size; ++_i41)
                {
                  double _elem42; // required
                  _elem42 = iprot.readDouble();
                  this.success.add(_elem42);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
          for (double _iter43 : this.success)
          {
            oprot.writeDouble(_iter43);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentsAmountRange_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class initializeHdfcPayment_args implements org.apache.thrift.TBase<initializeHdfcPayment_args, initializeHdfcPayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("initializeHdfcPayment_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantPaymentId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField IS_MOBILE_FIELD_DESC = new org.apache.thrift.protocol.TField("isMobile", org.apache.thrift.protocol.TType.BOOL, (short)2);

    private long merchantPaymentId; // required
    private boolean isMobile; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_PAYMENT_ID((short)1, "merchantPaymentId"),
      IS_MOBILE((short)2, "isMobile");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_PAYMENT_ID
            return MERCHANT_PAYMENT_ID;
          case 2: // IS_MOBILE
            return IS_MOBILE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTPAYMENTID_ISSET_ID = 0;
    private static final int __ISMOBILE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantPaymentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.IS_MOBILE, new org.apache.thrift.meta_data.FieldMetaData("isMobile", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(initializeHdfcPayment_args.class, metaDataMap);
    }

    public initializeHdfcPayment_args() {
    }

    public initializeHdfcPayment_args(
      long merchantPaymentId,
      boolean isMobile)
    {
      this();
      this.merchantPaymentId = merchantPaymentId;
      setMerchantPaymentIdIsSet(true);
      this.isMobile = isMobile;
      setIsMobileIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public initializeHdfcPayment_args(initializeHdfcPayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantPaymentId = other.merchantPaymentId;
      this.isMobile = other.isMobile;
    }

    public initializeHdfcPayment_args deepCopy() {
      return new initializeHdfcPayment_args(this);
    }

    @Override
    public void clear() {
      setMerchantPaymentIdIsSet(false);
      this.merchantPaymentId = 0;
      setIsMobileIsSet(false);
      this.isMobile = false;
    }

    public long getMerchantPaymentId() {
      return this.merchantPaymentId;
    }

    public void setMerchantPaymentId(long merchantPaymentId) {
      this.merchantPaymentId = merchantPaymentId;
      setMerchantPaymentIdIsSet(true);
    }

    public void unsetMerchantPaymentId() {
      __isset_bit_vector.clear(__MERCHANTPAYMENTID_ISSET_ID);
    }

    /** Returns true if field merchantPaymentId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantPaymentId() {
      return __isset_bit_vector.get(__MERCHANTPAYMENTID_ISSET_ID);
    }

    public void setMerchantPaymentIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTPAYMENTID_ISSET_ID, value);
    }

    public boolean isIsMobile() {
      return this.isMobile;
    }

    public void setIsMobile(boolean isMobile) {
      this.isMobile = isMobile;
      setIsMobileIsSet(true);
    }

    public void unsetIsMobile() {
      __isset_bit_vector.clear(__ISMOBILE_ISSET_ID);
    }

    /** Returns true if field isMobile is set (has been assigned a value) and false otherwise */
    public boolean isSetIsMobile() {
      return __isset_bit_vector.get(__ISMOBILE_ISSET_ID);
    }

    public void setIsMobileIsSet(boolean value) {
      __isset_bit_vector.set(__ISMOBILE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_PAYMENT_ID:
        if (value == null) {
          unsetMerchantPaymentId();
        } else {
          setMerchantPaymentId((Long)value);
        }
        break;

      case IS_MOBILE:
        if (value == null) {
          unsetIsMobile();
        } else {
          setIsMobile((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_PAYMENT_ID:
        return Long.valueOf(getMerchantPaymentId());

      case IS_MOBILE:
        return Boolean.valueOf(isIsMobile());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_PAYMENT_ID:
        return isSetMerchantPaymentId();
      case IS_MOBILE:
        return isSetIsMobile();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof initializeHdfcPayment_args)
        return this.equals((initializeHdfcPayment_args)that);
      return false;
    }

    public boolean equals(initializeHdfcPayment_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantPaymentId = true;
      boolean that_present_merchantPaymentId = true;
      if (this_present_merchantPaymentId || that_present_merchantPaymentId) {
        if (!(this_present_merchantPaymentId && that_present_merchantPaymentId))
          return false;
        if (this.merchantPaymentId != that.merchantPaymentId)
          return false;
      }

      boolean this_present_isMobile = true;
      boolean that_present_isMobile = true;
      if (this_present_isMobile || that_present_isMobile) {
        if (!(this_present_isMobile && that_present_isMobile))
          return false;
        if (this.isMobile != that.isMobile)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(initializeHdfcPayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      initializeHdfcPayment_args typedOther = (initializeHdfcPayment_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantPaymentId()).compareTo(typedOther.isSetMerchantPaymentId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantPaymentId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantPaymentId, typedOther.merchantPaymentId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsMobile()).compareTo(typedOther.isSetIsMobile());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsMobile()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isMobile, typedOther.isMobile);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_PAYMENT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantPaymentId = iprot.readI64();
              setMerchantPaymentIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // IS_MOBILE
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isMobile = iprot.readBool();
              setIsMobileIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_PAYMENT_ID_FIELD_DESC);
      oprot.writeI64(this.merchantPaymentId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_MOBILE_FIELD_DESC);
      oprot.writeBool(this.isMobile);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("initializeHdfcPayment_args(");
      boolean first = true;

      sb.append("merchantPaymentId:");
      sb.append(this.merchantPaymentId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isMobile:");
      sb.append(this.isMobile);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class initializeHdfcPayment_result implements org.apache.thrift.TBase<initializeHdfcPayment_result, initializeHdfcPayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("initializeHdfcPayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private String success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(initializeHdfcPayment_result.class, metaDataMap);
    }

    public initializeHdfcPayment_result() {
    }

    public initializeHdfcPayment_result(
      String success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public initializeHdfcPayment_result(initializeHdfcPayment_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public initializeHdfcPayment_result deepCopy() {
      return new initializeHdfcPayment_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public String getSuccess() {
      return this.success;
    }

    public void setSuccess(String success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((String)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof initializeHdfcPayment_result)
        return this.equals((initializeHdfcPayment_result)that);
      return false;
    }

    public boolean equals(initializeHdfcPayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(initializeHdfcPayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      initializeHdfcPayment_result typedOther = (initializeHdfcPayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.success = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeString(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("initializeHdfcPayment_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class doHdfcPaymentForDigitalOrder_args implements org.apache.thrift.TBase<doHdfcPaymentForDigitalOrder_args, doHdfcPaymentForDigitalOrder_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("doHdfcPaymentForDigitalOrder_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantPaymentId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField RECHARGE_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("rechargeOrderId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField PHONE_FIELD_DESC = new org.apache.thrift.protocol.TField("phone", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField IS_MOBILE_FIELD_DESC = new org.apache.thrift.protocol.TField("isMobile", org.apache.thrift.protocol.TType.BOOL, (short)4);

    private long merchantPaymentId; // required
    private long rechargeOrderId; // required
    private String phone; // required
    private boolean isMobile; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_PAYMENT_ID((short)1, "merchantPaymentId"),
      RECHARGE_ORDER_ID((short)2, "rechargeOrderId"),
      PHONE((short)3, "phone"),
      IS_MOBILE((short)4, "isMobile");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_PAYMENT_ID
            return MERCHANT_PAYMENT_ID;
          case 2: // RECHARGE_ORDER_ID
            return RECHARGE_ORDER_ID;
          case 3: // PHONE
            return PHONE;
          case 4: // IS_MOBILE
            return IS_MOBILE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTPAYMENTID_ISSET_ID = 0;
    private static final int __RECHARGEORDERID_ISSET_ID = 1;
    private static final int __ISMOBILE_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantPaymentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.RECHARGE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("rechargeOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PHONE, new org.apache.thrift.meta_data.FieldMetaData("phone", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.IS_MOBILE, new org.apache.thrift.meta_data.FieldMetaData("isMobile", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(doHdfcPaymentForDigitalOrder_args.class, metaDataMap);
    }

    public doHdfcPaymentForDigitalOrder_args() {
    }

    public doHdfcPaymentForDigitalOrder_args(
      long merchantPaymentId,
      long rechargeOrderId,
      String phone,
      boolean isMobile)
    {
      this();
      this.merchantPaymentId = merchantPaymentId;
      setMerchantPaymentIdIsSet(true);
      this.rechargeOrderId = rechargeOrderId;
      setRechargeOrderIdIsSet(true);
      this.phone = phone;
      this.isMobile = isMobile;
      setIsMobileIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public doHdfcPaymentForDigitalOrder_args(doHdfcPaymentForDigitalOrder_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantPaymentId = other.merchantPaymentId;
      this.rechargeOrderId = other.rechargeOrderId;
      if (other.isSetPhone()) {
        this.phone = other.phone;
      }
      this.isMobile = other.isMobile;
    }

    public doHdfcPaymentForDigitalOrder_args deepCopy() {
      return new doHdfcPaymentForDigitalOrder_args(this);
    }

    @Override
    public void clear() {
      setMerchantPaymentIdIsSet(false);
      this.merchantPaymentId = 0;
      setRechargeOrderIdIsSet(false);
      this.rechargeOrderId = 0;
      this.phone = null;
      setIsMobileIsSet(false);
      this.isMobile = false;
    }

    public long getMerchantPaymentId() {
      return this.merchantPaymentId;
    }

    public void setMerchantPaymentId(long merchantPaymentId) {
      this.merchantPaymentId = merchantPaymentId;
      setMerchantPaymentIdIsSet(true);
    }

    public void unsetMerchantPaymentId() {
      __isset_bit_vector.clear(__MERCHANTPAYMENTID_ISSET_ID);
    }

    /** Returns true if field merchantPaymentId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantPaymentId() {
      return __isset_bit_vector.get(__MERCHANTPAYMENTID_ISSET_ID);
    }

    public void setMerchantPaymentIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTPAYMENTID_ISSET_ID, value);
    }

    public long getRechargeOrderId() {
      return this.rechargeOrderId;
    }

    public void setRechargeOrderId(long rechargeOrderId) {
      this.rechargeOrderId = rechargeOrderId;
      setRechargeOrderIdIsSet(true);
    }

    public void unsetRechargeOrderId() {
      __isset_bit_vector.clear(__RECHARGEORDERID_ISSET_ID);
    }

    /** Returns true if field rechargeOrderId is set (has been assigned a value) and false otherwise */
    public boolean isSetRechargeOrderId() {
      return __isset_bit_vector.get(__RECHARGEORDERID_ISSET_ID);
    }

    public void setRechargeOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__RECHARGEORDERID_ISSET_ID, value);
    }

    public String getPhone() {
      return this.phone;
    }

    public void setPhone(String phone) {
      this.phone = phone;
    }

    public void unsetPhone() {
      this.phone = null;
    }

    /** Returns true if field phone is set (has been assigned a value) and false otherwise */
    public boolean isSetPhone() {
      return this.phone != null;
    }

    public void setPhoneIsSet(boolean value) {
      if (!value) {
        this.phone = null;
      }
    }

    public boolean isIsMobile() {
      return this.isMobile;
    }

    public void setIsMobile(boolean isMobile) {
      this.isMobile = isMobile;
      setIsMobileIsSet(true);
    }

    public void unsetIsMobile() {
      __isset_bit_vector.clear(__ISMOBILE_ISSET_ID);
    }

    /** Returns true if field isMobile is set (has been assigned a value) and false otherwise */
    public boolean isSetIsMobile() {
      return __isset_bit_vector.get(__ISMOBILE_ISSET_ID);
    }

    public void setIsMobileIsSet(boolean value) {
      __isset_bit_vector.set(__ISMOBILE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_PAYMENT_ID:
        if (value == null) {
          unsetMerchantPaymentId();
        } else {
          setMerchantPaymentId((Long)value);
        }
        break;

      case RECHARGE_ORDER_ID:
        if (value == null) {
          unsetRechargeOrderId();
        } else {
          setRechargeOrderId((Long)value);
        }
        break;

      case PHONE:
        if (value == null) {
          unsetPhone();
        } else {
          setPhone((String)value);
        }
        break;

      case IS_MOBILE:
        if (value == null) {
          unsetIsMobile();
        } else {
          setIsMobile((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_PAYMENT_ID:
        return Long.valueOf(getMerchantPaymentId());

      case RECHARGE_ORDER_ID:
        return Long.valueOf(getRechargeOrderId());

      case PHONE:
        return getPhone();

      case IS_MOBILE:
        return Boolean.valueOf(isIsMobile());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_PAYMENT_ID:
        return isSetMerchantPaymentId();
      case RECHARGE_ORDER_ID:
        return isSetRechargeOrderId();
      case PHONE:
        return isSetPhone();
      case IS_MOBILE:
        return isSetIsMobile();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof doHdfcPaymentForDigitalOrder_args)
        return this.equals((doHdfcPaymentForDigitalOrder_args)that);
      return false;
    }

    public boolean equals(doHdfcPaymentForDigitalOrder_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantPaymentId = true;
      boolean that_present_merchantPaymentId = true;
      if (this_present_merchantPaymentId || that_present_merchantPaymentId) {
        if (!(this_present_merchantPaymentId && that_present_merchantPaymentId))
          return false;
        if (this.merchantPaymentId != that.merchantPaymentId)
          return false;
      }

      boolean this_present_rechargeOrderId = true;
      boolean that_present_rechargeOrderId = true;
      if (this_present_rechargeOrderId || that_present_rechargeOrderId) {
        if (!(this_present_rechargeOrderId && that_present_rechargeOrderId))
          return false;
        if (this.rechargeOrderId != that.rechargeOrderId)
          return false;
      }

      boolean this_present_phone = true && this.isSetPhone();
      boolean that_present_phone = true && that.isSetPhone();
      if (this_present_phone || that_present_phone) {
        if (!(this_present_phone && that_present_phone))
          return false;
        if (!this.phone.equals(that.phone))
          return false;
      }

      boolean this_present_isMobile = true;
      boolean that_present_isMobile = true;
      if (this_present_isMobile || that_present_isMobile) {
        if (!(this_present_isMobile && that_present_isMobile))
          return false;
        if (this.isMobile != that.isMobile)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(doHdfcPaymentForDigitalOrder_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      doHdfcPaymentForDigitalOrder_args typedOther = (doHdfcPaymentForDigitalOrder_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantPaymentId()).compareTo(typedOther.isSetMerchantPaymentId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantPaymentId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantPaymentId, typedOther.merchantPaymentId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetRechargeOrderId()).compareTo(typedOther.isSetRechargeOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetRechargeOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rechargeOrderId, typedOther.rechargeOrderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPhone()).compareTo(typedOther.isSetPhone());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPhone()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.phone, typedOther.phone);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsMobile()).compareTo(typedOther.isSetIsMobile());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsMobile()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isMobile, typedOther.isMobile);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_PAYMENT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantPaymentId = iprot.readI64();
              setMerchantPaymentIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // RECHARGE_ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.rechargeOrderId = iprot.readI64();
              setRechargeOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // PHONE
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.phone = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // IS_MOBILE
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isMobile = iprot.readBool();
              setIsMobileIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_PAYMENT_ID_FIELD_DESC);
      oprot.writeI64(this.merchantPaymentId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(RECHARGE_ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.rechargeOrderId);
      oprot.writeFieldEnd();
      if (this.phone != null) {
        oprot.writeFieldBegin(PHONE_FIELD_DESC);
        oprot.writeString(this.phone);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(IS_MOBILE_FIELD_DESC);
      oprot.writeBool(this.isMobile);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("doHdfcPaymentForDigitalOrder_args(");
      boolean first = true;

      sb.append("merchantPaymentId:");
      sb.append(this.merchantPaymentId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("rechargeOrderId:");
      sb.append(this.rechargeOrderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("phone:");
      if (this.phone == null) {
        sb.append("null");
      } else {
        sb.append(this.phone);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("isMobile:");
      sb.append(this.isMobile);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class doHdfcPaymentForDigitalOrder_result implements org.apache.thrift.TBase<doHdfcPaymentForDigitalOrder_result, doHdfcPaymentForDigitalOrder_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("doHdfcPaymentForDigitalOrder_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private String success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(doHdfcPaymentForDigitalOrder_result.class, metaDataMap);
    }

    public doHdfcPaymentForDigitalOrder_result() {
    }

    public doHdfcPaymentForDigitalOrder_result(
      String success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public doHdfcPaymentForDigitalOrder_result(doHdfcPaymentForDigitalOrder_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public doHdfcPaymentForDigitalOrder_result deepCopy() {
      return new doHdfcPaymentForDigitalOrder_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public String getSuccess() {
      return this.success;
    }

    public void setSuccess(String success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((String)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof doHdfcPaymentForDigitalOrder_result)
        return this.equals((doHdfcPaymentForDigitalOrder_result)that);
      return false;
    }

    public boolean equals(doHdfcPaymentForDigitalOrder_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(doHdfcPaymentForDigitalOrder_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      doHdfcPaymentForDigitalOrder_result typedOther = (doHdfcPaymentForDigitalOrder_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.success = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeString(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("doHdfcPaymentForDigitalOrder_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class initializeHdfcEmiPayment_args implements org.apache.thrift.TBase<initializeHdfcEmiPayment_args, initializeHdfcEmiPayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("initializeHdfcEmiPayment_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantPaymentId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField IS_MOBILE_FIELD_DESC = new org.apache.thrift.protocol.TField("isMobile", org.apache.thrift.protocol.TType.BOOL, (short)2);

    private long merchantPaymentId; // required
    private boolean isMobile; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_PAYMENT_ID((short)1, "merchantPaymentId"),
      IS_MOBILE((short)2, "isMobile");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_PAYMENT_ID
            return MERCHANT_PAYMENT_ID;
          case 2: // IS_MOBILE
            return IS_MOBILE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTPAYMENTID_ISSET_ID = 0;
    private static final int __ISMOBILE_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantPaymentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.IS_MOBILE, new org.apache.thrift.meta_data.FieldMetaData("isMobile", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(initializeHdfcEmiPayment_args.class, metaDataMap);
    }

    public initializeHdfcEmiPayment_args() {
    }

    public initializeHdfcEmiPayment_args(
      long merchantPaymentId,
      boolean isMobile)
    {
      this();
      this.merchantPaymentId = merchantPaymentId;
      setMerchantPaymentIdIsSet(true);
      this.isMobile = isMobile;
      setIsMobileIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public initializeHdfcEmiPayment_args(initializeHdfcEmiPayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantPaymentId = other.merchantPaymentId;
      this.isMobile = other.isMobile;
    }

    public initializeHdfcEmiPayment_args deepCopy() {
      return new initializeHdfcEmiPayment_args(this);
    }

    @Override
    public void clear() {
      setMerchantPaymentIdIsSet(false);
      this.merchantPaymentId = 0;
      setIsMobileIsSet(false);
      this.isMobile = false;
    }

    public long getMerchantPaymentId() {
      return this.merchantPaymentId;
    }

    public void setMerchantPaymentId(long merchantPaymentId) {
      this.merchantPaymentId = merchantPaymentId;
      setMerchantPaymentIdIsSet(true);
    }

    public void unsetMerchantPaymentId() {
      __isset_bit_vector.clear(__MERCHANTPAYMENTID_ISSET_ID);
    }

    /** Returns true if field merchantPaymentId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantPaymentId() {
      return __isset_bit_vector.get(__MERCHANTPAYMENTID_ISSET_ID);
    }

    public void setMerchantPaymentIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTPAYMENTID_ISSET_ID, value);
    }

    public boolean isIsMobile() {
      return this.isMobile;
    }

    public void setIsMobile(boolean isMobile) {
      this.isMobile = isMobile;
      setIsMobileIsSet(true);
    }

    public void unsetIsMobile() {
      __isset_bit_vector.clear(__ISMOBILE_ISSET_ID);
    }

    /** Returns true if field isMobile is set (has been assigned a value) and false otherwise */
    public boolean isSetIsMobile() {
      return __isset_bit_vector.get(__ISMOBILE_ISSET_ID);
    }

    public void setIsMobileIsSet(boolean value) {
      __isset_bit_vector.set(__ISMOBILE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_PAYMENT_ID:
        if (value == null) {
          unsetMerchantPaymentId();
        } else {
          setMerchantPaymentId((Long)value);
        }
        break;

      case IS_MOBILE:
        if (value == null) {
          unsetIsMobile();
        } else {
          setIsMobile((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_PAYMENT_ID:
        return Long.valueOf(getMerchantPaymentId());

      case IS_MOBILE:
        return Boolean.valueOf(isIsMobile());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_PAYMENT_ID:
        return isSetMerchantPaymentId();
      case IS_MOBILE:
        return isSetIsMobile();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof initializeHdfcEmiPayment_args)
        return this.equals((initializeHdfcEmiPayment_args)that);
      return false;
    }

    public boolean equals(initializeHdfcEmiPayment_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantPaymentId = true;
      boolean that_present_merchantPaymentId = true;
      if (this_present_merchantPaymentId || that_present_merchantPaymentId) {
        if (!(this_present_merchantPaymentId && that_present_merchantPaymentId))
          return false;
        if (this.merchantPaymentId != that.merchantPaymentId)
          return false;
      }

      boolean this_present_isMobile = true;
      boolean that_present_isMobile = true;
      if (this_present_isMobile || that_present_isMobile) {
        if (!(this_present_isMobile && that_present_isMobile))
          return false;
        if (this.isMobile != that.isMobile)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(initializeHdfcEmiPayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      initializeHdfcEmiPayment_args typedOther = (initializeHdfcEmiPayment_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantPaymentId()).compareTo(typedOther.isSetMerchantPaymentId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantPaymentId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantPaymentId, typedOther.merchantPaymentId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsMobile()).compareTo(typedOther.isSetIsMobile());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsMobile()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isMobile, typedOther.isMobile);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_PAYMENT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantPaymentId = iprot.readI64();
              setMerchantPaymentIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // IS_MOBILE
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isMobile = iprot.readBool();
              setIsMobileIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_PAYMENT_ID_FIELD_DESC);
      oprot.writeI64(this.merchantPaymentId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_MOBILE_FIELD_DESC);
      oprot.writeBool(this.isMobile);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("initializeHdfcEmiPayment_args(");
      boolean first = true;

      sb.append("merchantPaymentId:");
      sb.append(this.merchantPaymentId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isMobile:");
      sb.append(this.isMobile);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class initializeHdfcEmiPayment_result implements org.apache.thrift.TBase<initializeHdfcEmiPayment_result, initializeHdfcEmiPayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("initializeHdfcEmiPayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private String success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(initializeHdfcEmiPayment_result.class, metaDataMap);
    }

    public initializeHdfcEmiPayment_result() {
    }

    public initializeHdfcEmiPayment_result(
      String success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public initializeHdfcEmiPayment_result(initializeHdfcEmiPayment_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public initializeHdfcEmiPayment_result deepCopy() {
      return new initializeHdfcEmiPayment_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    public String getSuccess() {
      return this.success;
    }

    public void setSuccess(String success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((String)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof initializeHdfcEmiPayment_result)
        return this.equals((initializeHdfcEmiPayment_result)that);
      return false;
    }

    public boolean equals(initializeHdfcEmiPayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(initializeHdfcEmiPayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      initializeHdfcEmiPayment_result typedOther = (initializeHdfcEmiPayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.success = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeString(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("initializeHdfcEmiPayment_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createRefund_args implements org.apache.thrift.TBase<createRefund_args, createRefund_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createRefund_args");

    private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField MERCHANT_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantTxnId", org.apache.thrift.protocol.TType.I64, (short)2);
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.DOUBLE, (short)3);

    private long orderId; // required
    private long merchantTxnId; // required
    private double amount; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      ORDER_ID((short)1, "orderId"),
      MERCHANT_TXN_ID((short)2, "merchantTxnId"),
      AMOUNT((short)3, "amount");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // ORDER_ID
            return ORDER_ID;
          case 2: // MERCHANT_TXN_ID
            return MERCHANT_TXN_ID;
          case 3: // AMOUNT
            return AMOUNT;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __ORDERID_ISSET_ID = 0;
    private static final int __MERCHANTTXNID_ISSET_ID = 1;
    private static final int __AMOUNT_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.MERCHANT_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createRefund_args.class, metaDataMap);
    }

    public createRefund_args() {
    }

    public createRefund_args(
      long orderId,
      long merchantTxnId,
      double amount)
    {
      this();
      this.orderId = orderId;
      setOrderIdIsSet(true);
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
      this.amount = amount;
      setAmountIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createRefund_args(createRefund_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.orderId = other.orderId;
      this.merchantTxnId = other.merchantTxnId;
      this.amount = other.amount;
    }

    public createRefund_args deepCopy() {
      return new createRefund_args(this);
    }

    @Override
    public void clear() {
      setOrderIdIsSet(false);
      this.orderId = 0;
      setMerchantTxnIdIsSet(false);
      this.merchantTxnId = 0;
      setAmountIsSet(false);
      this.amount = 0.0;
    }

    public long getOrderId() {
      return this.orderId;
    }

    public void setOrderId(long orderId) {
      this.orderId = orderId;
      setOrderIdIsSet(true);
    }

    public void unsetOrderId() {
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
    }

    /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
    public boolean isSetOrderId() {
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
    }

    public void setOrderIdIsSet(boolean value) {
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
    }

    public long getMerchantTxnId() {
      return this.merchantTxnId;
    }

    public void setMerchantTxnId(long merchantTxnId) {
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
    }

    public void unsetMerchantTxnId() {
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
    }

    /** Returns true if field merchantTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantTxnId() {
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
    }

    public void setMerchantTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
    }

    public double getAmount() {
      return this.amount;
    }

    public void setAmount(double amount) {
      this.amount = amount;
      setAmountIsSet(true);
    }

    public void unsetAmount() {
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
    }

    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
    public boolean isSetAmount() {
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
    }

    public void setAmountIsSet(boolean value) {
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case ORDER_ID:
        if (value == null) {
          unsetOrderId();
        } else {
          setOrderId((Long)value);
        }
        break;

      case MERCHANT_TXN_ID:
        if (value == null) {
          unsetMerchantTxnId();
        } else {
          setMerchantTxnId((Long)value);
        }
        break;

      case AMOUNT:
        if (value == null) {
          unsetAmount();
        } else {
          setAmount((Double)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case ORDER_ID:
        return Long.valueOf(getOrderId());

      case MERCHANT_TXN_ID:
        return Long.valueOf(getMerchantTxnId());

      case AMOUNT:
        return Double.valueOf(getAmount());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case ORDER_ID:
        return isSetOrderId();
      case MERCHANT_TXN_ID:
        return isSetMerchantTxnId();
      case AMOUNT:
        return isSetAmount();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createRefund_args)
        return this.equals((createRefund_args)that);
      return false;
    }

    public boolean equals(createRefund_args that) {
      if (that == null)
        return false;

      boolean this_present_orderId = true;
      boolean that_present_orderId = true;
      if (this_present_orderId || that_present_orderId) {
        if (!(this_present_orderId && that_present_orderId))
          return false;
        if (this.orderId != that.orderId)
          return false;
      }

      boolean this_present_merchantTxnId = true;
      boolean that_present_merchantTxnId = true;
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
          return false;
        if (this.merchantTxnId != that.merchantTxnId)
          return false;
      }

      boolean this_present_amount = true;
      boolean that_present_amount = true;
      if (this_present_amount || that_present_amount) {
        if (!(this_present_amount && that_present_amount))
          return false;
        if (this.amount != that.amount)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createRefund_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createRefund_args typedOther = (createRefund_args)other;

      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetOrderId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(typedOther.isSetMerchantTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantTxnId, typedOther.merchantTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAmount()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // ORDER_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.orderId = iprot.readI64();
              setOrderIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // MERCHANT_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantTxnId = iprot.readI64();
              setMerchantTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // AMOUNT
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.amount = iprot.readDouble();
              setAmountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
      oprot.writeI64(this.orderId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
      oprot.writeI64(this.merchantTxnId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
      oprot.writeDouble(this.amount);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createRefund_args(");
      boolean first = true;

      sb.append("orderId:");
      sb.append(this.orderId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("merchantTxnId:");
      sb.append(this.merchantTxnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("amount:");
      sb.append(this.amount);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class createRefund_result implements org.apache.thrift.TBase<createRefund_result, createRefund_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createRefund_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private long success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createRefund_result.class, metaDataMap);
    }

    public createRefund_result() {
    }

    public createRefund_result(
      long success,
      PaymentException pe)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public createRefund_result(createRefund_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public createRefund_result deepCopy() {
      return new createRefund_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = 0;
      this.pe = null;
    }

    public long getSuccess() {
      return this.success;
    }

    public void setSuccess(long success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Long)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Long.valueOf(getSuccess());

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof createRefund_result)
        return this.equals((createRefund_result)that);
      return false;
    }

    public boolean equals(createRefund_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(createRefund_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      createRefund_result typedOther = (createRefund_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.success = iprot.readI64();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI64(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("createRefund_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class capturePayment_args implements org.apache.thrift.TBase<capturePayment_args, capturePayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("capturePayment_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantTxnId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField IS_DIGITAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDigital", org.apache.thrift.protocol.TType.BOOL, (short)2);

    private long merchantTxnId; // required
    private boolean isDigital; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_TXN_ID((short)1, "merchantTxnId"),
      IS_DIGITAL((short)2, "isDigital");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_TXN_ID
            return MERCHANT_TXN_ID;
          case 2: // IS_DIGITAL
            return IS_DIGITAL;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTTXNID_ISSET_ID = 0;
    private static final int __ISDIGITAL_ISSET_ID = 1;
    private BitSet __isset_bit_vector = new BitSet(2);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.IS_DIGITAL, new org.apache.thrift.meta_data.FieldMetaData("isDigital", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(capturePayment_args.class, metaDataMap);
    }

    public capturePayment_args() {
    }

    public capturePayment_args(
      long merchantTxnId,
      boolean isDigital)
    {
      this();
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public capturePayment_args(capturePayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantTxnId = other.merchantTxnId;
      this.isDigital = other.isDigital;
    }

    public capturePayment_args deepCopy() {
      return new capturePayment_args(this);
    }

    @Override
    public void clear() {
      setMerchantTxnIdIsSet(false);
      this.merchantTxnId = 0;
      setIsDigitalIsSet(false);
      this.isDigital = false;
    }

    public long getMerchantTxnId() {
      return this.merchantTxnId;
    }

    public void setMerchantTxnId(long merchantTxnId) {
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
    }

    public void unsetMerchantTxnId() {
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
    }

    /** Returns true if field merchantTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantTxnId() {
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
    }

    public void setMerchantTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
    }

    public boolean isIsDigital() {
      return this.isDigital;
    }

    public void setIsDigital(boolean isDigital) {
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    public void unsetIsDigital() {
      __isset_bit_vector.clear(__ISDIGITAL_ISSET_ID);
    }

    /** Returns true if field isDigital is set (has been assigned a value) and false otherwise */
    public boolean isSetIsDigital() {
      return __isset_bit_vector.get(__ISDIGITAL_ISSET_ID);
    }

    public void setIsDigitalIsSet(boolean value) {
      __isset_bit_vector.set(__ISDIGITAL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_TXN_ID:
        if (value == null) {
          unsetMerchantTxnId();
        } else {
          setMerchantTxnId((Long)value);
        }
        break;

      case IS_DIGITAL:
        if (value == null) {
          unsetIsDigital();
        } else {
          setIsDigital((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_TXN_ID:
        return Long.valueOf(getMerchantTxnId());

      case IS_DIGITAL:
        return Boolean.valueOf(isIsDigital());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_TXN_ID:
        return isSetMerchantTxnId();
      case IS_DIGITAL:
        return isSetIsDigital();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof capturePayment_args)
        return this.equals((capturePayment_args)that);
      return false;
    }

    public boolean equals(capturePayment_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantTxnId = true;
      boolean that_present_merchantTxnId = true;
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
          return false;
        if (this.merchantTxnId != that.merchantTxnId)
          return false;
      }

      boolean this_present_isDigital = true;
      boolean that_present_isDigital = true;
      if (this_present_isDigital || that_present_isDigital) {
        if (!(this_present_isDigital && that_present_isDigital))
          return false;
        if (this.isDigital != that.isDigital)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(capturePayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      capturePayment_args typedOther = (capturePayment_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(typedOther.isSetMerchantTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantTxnId, typedOther.merchantTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsDigital()).compareTo(typedOther.isSetIsDigital());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsDigital()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDigital, typedOther.isDigital);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantTxnId = iprot.readI64();
              setMerchantTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // IS_DIGITAL
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isDigital = iprot.readBool();
              setIsDigitalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
      oprot.writeI64(this.merchantTxnId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
      oprot.writeBool(this.isDigital);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("capturePayment_args(");
      boolean first = true;

      sb.append("merchantTxnId:");
      sb.append(this.merchantTxnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isDigital:");
      sb.append(this.isDigital);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class capturePayment_result implements org.apache.thrift.TBase<capturePayment_result, capturePayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("capturePayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(capturePayment_result.class, metaDataMap);
    }

    public capturePayment_result() {
    }

    public capturePayment_result(
      boolean success,
      PaymentException pe)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public capturePayment_result(capturePayment_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public capturePayment_result deepCopy() {
      return new capturePayment_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.pe = null;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof capturePayment_result)
        return this.equals((capturePayment_result)that);
      return false;
    }

    public boolean equals(capturePayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(capturePayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      capturePayment_result typedOther = (capturePayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.success = iprot.readBool();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("capturePayment_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class refundPayment_args implements org.apache.thrift.TBase<refundPayment_args, refundPayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("refundPayment_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantTxnId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
    private static final org.apache.thrift.protocol.TField IS_DIGITAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDigital", org.apache.thrift.protocol.TType.BOOL, (short)3);

    private long merchantTxnId; // required
    private double amount; // required
    private boolean isDigital; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_TXN_ID((short)1, "merchantTxnId"),
      AMOUNT((short)2, "amount"),
      IS_DIGITAL((short)3, "isDigital");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_TXN_ID
            return MERCHANT_TXN_ID;
          case 2: // AMOUNT
            return AMOUNT;
          case 3: // IS_DIGITAL
            return IS_DIGITAL;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTTXNID_ISSET_ID = 0;
    private static final int __AMOUNT_ISSET_ID = 1;
    private static final int __ISDIGITAL_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.IS_DIGITAL, new org.apache.thrift.meta_data.FieldMetaData("isDigital", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(refundPayment_args.class, metaDataMap);
    }

    public refundPayment_args() {
    }

    public refundPayment_args(
      long merchantTxnId,
      double amount,
      boolean isDigital)
    {
      this();
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
      this.amount = amount;
      setAmountIsSet(true);
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public refundPayment_args(refundPayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantTxnId = other.merchantTxnId;
      this.amount = other.amount;
      this.isDigital = other.isDigital;
    }

    public refundPayment_args deepCopy() {
      return new refundPayment_args(this);
    }

    @Override
    public void clear() {
      setMerchantTxnIdIsSet(false);
      this.merchantTxnId = 0;
      setAmountIsSet(false);
      this.amount = 0.0;
      setIsDigitalIsSet(false);
      this.isDigital = false;
    }

    public long getMerchantTxnId() {
      return this.merchantTxnId;
    }

    public void setMerchantTxnId(long merchantTxnId) {
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
    }

    public void unsetMerchantTxnId() {
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
    }

    /** Returns true if field merchantTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantTxnId() {
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
    }

    public void setMerchantTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
    }

    public double getAmount() {
      return this.amount;
    }

    public void setAmount(double amount) {
      this.amount = amount;
      setAmountIsSet(true);
    }

    public void unsetAmount() {
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
    }

    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
    public boolean isSetAmount() {
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
    }

    public void setAmountIsSet(boolean value) {
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
    }

    public boolean isIsDigital() {
      return this.isDigital;
    }

    public void setIsDigital(boolean isDigital) {
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    public void unsetIsDigital() {
      __isset_bit_vector.clear(__ISDIGITAL_ISSET_ID);
    }

    /** Returns true if field isDigital is set (has been assigned a value) and false otherwise */
    public boolean isSetIsDigital() {
      return __isset_bit_vector.get(__ISDIGITAL_ISSET_ID);
    }

    public void setIsDigitalIsSet(boolean value) {
      __isset_bit_vector.set(__ISDIGITAL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_TXN_ID:
        if (value == null) {
          unsetMerchantTxnId();
        } else {
          setMerchantTxnId((Long)value);
        }
        break;

      case AMOUNT:
        if (value == null) {
          unsetAmount();
        } else {
          setAmount((Double)value);
        }
        break;

      case IS_DIGITAL:
        if (value == null) {
          unsetIsDigital();
        } else {
          setIsDigital((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_TXN_ID:
        return Long.valueOf(getMerchantTxnId());

      case AMOUNT:
        return Double.valueOf(getAmount());

      case IS_DIGITAL:
        return Boolean.valueOf(isIsDigital());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_TXN_ID:
        return isSetMerchantTxnId();
      case AMOUNT:
        return isSetAmount();
      case IS_DIGITAL:
        return isSetIsDigital();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof refundPayment_args)
        return this.equals((refundPayment_args)that);
      return false;
    }

    public boolean equals(refundPayment_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantTxnId = true;
      boolean that_present_merchantTxnId = true;
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
          return false;
        if (this.merchantTxnId != that.merchantTxnId)
          return false;
      }

      boolean this_present_amount = true;
      boolean that_present_amount = true;
      if (this_present_amount || that_present_amount) {
        if (!(this_present_amount && that_present_amount))
          return false;
        if (this.amount != that.amount)
          return false;
      }

      boolean this_present_isDigital = true;
      boolean that_present_isDigital = true;
      if (this_present_isDigital || that_present_isDigital) {
        if (!(this_present_isDigital && that_present_isDigital))
          return false;
        if (this.isDigital != that.isDigital)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(refundPayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      refundPayment_args typedOther = (refundPayment_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(typedOther.isSetMerchantTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantTxnId, typedOther.merchantTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAmount()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsDigital()).compareTo(typedOther.isSetIsDigital());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsDigital()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDigital, typedOther.isDigital);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantTxnId = iprot.readI64();
              setMerchantTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // AMOUNT
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.amount = iprot.readDouble();
              setAmountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // IS_DIGITAL
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isDigital = iprot.readBool();
              setIsDigitalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
      oprot.writeI64(this.merchantTxnId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
      oprot.writeDouble(this.amount);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
      oprot.writeBool(this.isDigital);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("refundPayment_args(");
      boolean first = true;

      sb.append("merchantTxnId:");
      sb.append(this.merchantTxnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("amount:");
      sb.append(this.amount);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isDigital:");
      sb.append(this.isDigital);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class refundPayment_result implements org.apache.thrift.TBase<refundPayment_result, refundPayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("refundPayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(refundPayment_result.class, metaDataMap);
    }

    public refundPayment_result() {
    }

    public refundPayment_result(
      boolean success,
      PaymentException pe)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public refundPayment_result(refundPayment_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public refundPayment_result deepCopy() {
      return new refundPayment_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.pe = null;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof refundPayment_result)
        return this.equals((refundPayment_result)that);
      return false;
    }

    public boolean equals(refundPayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(refundPayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      refundPayment_result typedOther = (refundPayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.success = iprot.readBool();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("refundPayment_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class partiallyCapturePayment_args implements org.apache.thrift.TBase<partiallyCapturePayment_args, partiallyCapturePayment_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("partiallyCapturePayment_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantTxnId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
    private static final org.apache.thrift.protocol.TField XFER_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("xferBy", org.apache.thrift.protocol.TType.STRING, (short)3);
    private static final org.apache.thrift.protocol.TField XFER_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("xferTxnId", org.apache.thrift.protocol.TType.STRING, (short)4);
    private static final org.apache.thrift.protocol.TField XFER_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("xferDate", org.apache.thrift.protocol.TType.I64, (short)5);

    private long merchantTxnId; // required
    private double amount; // required
    private String xferBy; // required
    private String xferTxnId; // required
    private long xferDate; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_TXN_ID((short)1, "merchantTxnId"),
      AMOUNT((short)2, "amount"),
      XFER_BY((short)3, "xferBy"),
      XFER_TXN_ID((short)4, "xferTxnId"),
      XFER_DATE((short)5, "xferDate");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_TXN_ID
            return MERCHANT_TXN_ID;
          case 2: // AMOUNT
            return AMOUNT;
          case 3: // XFER_BY
            return XFER_BY;
          case 4: // XFER_TXN_ID
            return XFER_TXN_ID;
          case 5: // XFER_DATE
            return XFER_DATE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTTXNID_ISSET_ID = 0;
    private static final int __AMOUNT_ISSET_ID = 1;
    private static final int __XFERDATE_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.XFER_BY, new org.apache.thrift.meta_data.FieldMetaData("xferBy", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.XFER_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("xferTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.XFER_DATE, new org.apache.thrift.meta_data.FieldMetaData("xferDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(partiallyCapturePayment_args.class, metaDataMap);
    }

    public partiallyCapturePayment_args() {
    }

    public partiallyCapturePayment_args(
      long merchantTxnId,
      double amount,
      String xferBy,
      String xferTxnId,
      long xferDate)
    {
      this();
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
      this.amount = amount;
      setAmountIsSet(true);
      this.xferBy = xferBy;
      this.xferTxnId = xferTxnId;
      this.xferDate = xferDate;
      setXferDateIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public partiallyCapturePayment_args(partiallyCapturePayment_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantTxnId = other.merchantTxnId;
      this.amount = other.amount;
      if (other.isSetXferBy()) {
        this.xferBy = other.xferBy;
      }
      if (other.isSetXferTxnId()) {
        this.xferTxnId = other.xferTxnId;
      }
      this.xferDate = other.xferDate;
    }

    public partiallyCapturePayment_args deepCopy() {
      return new partiallyCapturePayment_args(this);
    }

    @Override
    public void clear() {
      setMerchantTxnIdIsSet(false);
      this.merchantTxnId = 0;
      setAmountIsSet(false);
      this.amount = 0.0;
      this.xferBy = null;
      this.xferTxnId = null;
      setXferDateIsSet(false);
      this.xferDate = 0;
    }

    public long getMerchantTxnId() {
      return this.merchantTxnId;
    }

    public void setMerchantTxnId(long merchantTxnId) {
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
    }

    public void unsetMerchantTxnId() {
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
    }

    /** Returns true if field merchantTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantTxnId() {
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
    }

    public void setMerchantTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
    }

    public double getAmount() {
      return this.amount;
    }

    public void setAmount(double amount) {
      this.amount = amount;
      setAmountIsSet(true);
    }

    public void unsetAmount() {
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
    }

    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
    public boolean isSetAmount() {
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
    }

    public void setAmountIsSet(boolean value) {
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
    }

    public String getXferBy() {
      return this.xferBy;
    }

    public void setXferBy(String xferBy) {
      this.xferBy = xferBy;
    }

    public void unsetXferBy() {
      this.xferBy = null;
    }

    /** Returns true if field xferBy is set (has been assigned a value) and false otherwise */
    public boolean isSetXferBy() {
      return this.xferBy != null;
    }

    public void setXferByIsSet(boolean value) {
      if (!value) {
        this.xferBy = null;
      }
    }

    public String getXferTxnId() {
      return this.xferTxnId;
    }

    public void setXferTxnId(String xferTxnId) {
      this.xferTxnId = xferTxnId;
    }

    public void unsetXferTxnId() {
      this.xferTxnId = null;
    }

    /** Returns true if field xferTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetXferTxnId() {
      return this.xferTxnId != null;
    }

    public void setXferTxnIdIsSet(boolean value) {
      if (!value) {
        this.xferTxnId = null;
      }
    }

    public long getXferDate() {
      return this.xferDate;
    }

    public void setXferDate(long xferDate) {
      this.xferDate = xferDate;
      setXferDateIsSet(true);
    }

    public void unsetXferDate() {
      __isset_bit_vector.clear(__XFERDATE_ISSET_ID);
    }

    /** Returns true if field xferDate is set (has been assigned a value) and false otherwise */
    public boolean isSetXferDate() {
      return __isset_bit_vector.get(__XFERDATE_ISSET_ID);
    }

    public void setXferDateIsSet(boolean value) {
      __isset_bit_vector.set(__XFERDATE_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_TXN_ID:
        if (value == null) {
          unsetMerchantTxnId();
        } else {
          setMerchantTxnId((Long)value);
        }
        break;

      case AMOUNT:
        if (value == null) {
          unsetAmount();
        } else {
          setAmount((Double)value);
        }
        break;

      case XFER_BY:
        if (value == null) {
          unsetXferBy();
        } else {
          setXferBy((String)value);
        }
        break;

      case XFER_TXN_ID:
        if (value == null) {
          unsetXferTxnId();
        } else {
          setXferTxnId((String)value);
        }
        break;

      case XFER_DATE:
        if (value == null) {
          unsetXferDate();
        } else {
          setXferDate((Long)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_TXN_ID:
        return Long.valueOf(getMerchantTxnId());

      case AMOUNT:
        return Double.valueOf(getAmount());

      case XFER_BY:
        return getXferBy();

      case XFER_TXN_ID:
        return getXferTxnId();

      case XFER_DATE:
        return Long.valueOf(getXferDate());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_TXN_ID:
        return isSetMerchantTxnId();
      case AMOUNT:
        return isSetAmount();
      case XFER_BY:
        return isSetXferBy();
      case XFER_TXN_ID:
        return isSetXferTxnId();
      case XFER_DATE:
        return isSetXferDate();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof partiallyCapturePayment_args)
        return this.equals((partiallyCapturePayment_args)that);
      return false;
    }

    public boolean equals(partiallyCapturePayment_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantTxnId = true;
      boolean that_present_merchantTxnId = true;
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
          return false;
        if (this.merchantTxnId != that.merchantTxnId)
          return false;
      }

      boolean this_present_amount = true;
      boolean that_present_amount = true;
      if (this_present_amount || that_present_amount) {
        if (!(this_present_amount && that_present_amount))
          return false;
        if (this.amount != that.amount)
          return false;
      }

      boolean this_present_xferBy = true && this.isSetXferBy();
      boolean that_present_xferBy = true && that.isSetXferBy();
      if (this_present_xferBy || that_present_xferBy) {
        if (!(this_present_xferBy && that_present_xferBy))
          return false;
        if (!this.xferBy.equals(that.xferBy))
          return false;
      }

      boolean this_present_xferTxnId = true && this.isSetXferTxnId();
      boolean that_present_xferTxnId = true && that.isSetXferTxnId();
      if (this_present_xferTxnId || that_present_xferTxnId) {
        if (!(this_present_xferTxnId && that_present_xferTxnId))
          return false;
        if (!this.xferTxnId.equals(that.xferTxnId))
          return false;
      }

      boolean this_present_xferDate = true;
      boolean that_present_xferDate = true;
      if (this_present_xferDate || that_present_xferDate) {
        if (!(this_present_xferDate && that_present_xferDate))
          return false;
        if (this.xferDate != that.xferDate)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(partiallyCapturePayment_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      partiallyCapturePayment_args typedOther = (partiallyCapturePayment_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(typedOther.isSetMerchantTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantTxnId, typedOther.merchantTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAmount()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXferBy()).compareTo(typedOther.isSetXferBy());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXferBy()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xferBy, typedOther.xferBy);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXferTxnId()).compareTo(typedOther.isSetXferTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXferTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xferTxnId, typedOther.xferTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetXferDate()).compareTo(typedOther.isSetXferDate());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetXferDate()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.xferDate, typedOther.xferDate);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantTxnId = iprot.readI64();
              setMerchantTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // AMOUNT
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.amount = iprot.readDouble();
              setAmountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // XFER_BY
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.xferBy = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 4: // XFER_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.xferTxnId = iprot.readString();
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 5: // XFER_DATE
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.xferDate = iprot.readI64();
              setXferDateIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
      oprot.writeI64(this.merchantTxnId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
      oprot.writeDouble(this.amount);
      oprot.writeFieldEnd();
      if (this.xferBy != null) {
        oprot.writeFieldBegin(XFER_BY_FIELD_DESC);
        oprot.writeString(this.xferBy);
        oprot.writeFieldEnd();
      }
      if (this.xferTxnId != null) {
        oprot.writeFieldBegin(XFER_TXN_ID_FIELD_DESC);
        oprot.writeString(this.xferTxnId);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(XFER_DATE_FIELD_DESC);
      oprot.writeI64(this.xferDate);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("partiallyCapturePayment_args(");
      boolean first = true;

      sb.append("merchantTxnId:");
      sb.append(this.merchantTxnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("amount:");
      sb.append(this.amount);
      first = false;
      if (!first) sb.append(", ");
      sb.append("xferBy:");
      if (this.xferBy == null) {
        sb.append("null");
      } else {
        sb.append(this.xferBy);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("xferTxnId:");
      if (this.xferTxnId == null) {
        sb.append("null");
      } else {
        sb.append(this.xferTxnId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("xferDate:");
      sb.append(this.xferDate);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class partiallyCapturePayment_result implements org.apache.thrift.TBase<partiallyCapturePayment_result, partiallyCapturePayment_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("partiallyCapturePayment_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private boolean success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __SUCCESS_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(partiallyCapturePayment_result.class, metaDataMap);
    }

    public partiallyCapturePayment_result() {
    }

    public partiallyCapturePayment_result(
      boolean success,
      PaymentException pe)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public partiallyCapturePayment_result(partiallyCapturePayment_result other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.success = other.success;
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public partiallyCapturePayment_result deepCopy() {
      return new partiallyCapturePayment_result(this);
    }

    @Override
    public void clear() {
      setSuccessIsSet(false);
      this.success = false;
      this.pe = null;
    }

    public boolean isSuccess() {
      return this.success;
    }

    public void setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
    }

    public void unsetSuccess() {
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
    }

    public void setSuccessIsSet(boolean value) {
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((Boolean)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return Boolean.valueOf(isSuccess());

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof partiallyCapturePayment_result)
        return this.equals((partiallyCapturePayment_result)that);
      return false;
    }

    public boolean equals(partiallyCapturePayment_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true;
      boolean that_present_success = true;
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (this.success != that.success)
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(partiallyCapturePayment_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      partiallyCapturePayment_result typedOther = (partiallyCapturePayment_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.success = iprot.readBool();
              setSuccessIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeBool(this.success);
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("partiallyCapturePayment_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentsRequiringExtraProcessing_args implements org.apache.thrift.TBase<getPaymentsRequiringExtraProcessing_args, getPaymentsRequiringExtraProcessing_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentsRequiringExtraProcessing_args");

    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.I32, (short)1);

    private ExtraPaymentProcessingType category; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      /**
       * 
       * @see ExtraPaymentProcessingType
       */
      CATEGORY((short)1, "category");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // CATEGORY
            return CATEGORY;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ExtraPaymentProcessingType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentsRequiringExtraProcessing_args.class, metaDataMap);
    }

    public getPaymentsRequiringExtraProcessing_args() {
    }

    public getPaymentsRequiringExtraProcessing_args(
      ExtraPaymentProcessingType category)
    {
      this();
      this.category = category;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentsRequiringExtraProcessing_args(getPaymentsRequiringExtraProcessing_args other) {
      if (other.isSetCategory()) {
        this.category = other.category;
      }
    }

    public getPaymentsRequiringExtraProcessing_args deepCopy() {
      return new getPaymentsRequiringExtraProcessing_args(this);
    }

    @Override
    public void clear() {
      this.category = null;
    }

    /**
     * 
     * @see ExtraPaymentProcessingType
     */
    public ExtraPaymentProcessingType getCategory() {
      return this.category;
    }

    /**
     * 
     * @see ExtraPaymentProcessingType
     */
    public void setCategory(ExtraPaymentProcessingType category) {
      this.category = category;
    }

    public void unsetCategory() {
      this.category = null;
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return this.category != null;
    }

    public void setCategoryIsSet(boolean value) {
      if (!value) {
        this.category = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((ExtraPaymentProcessingType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CATEGORY:
        return getCategory();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentsRequiringExtraProcessing_args)
        return this.equals((getPaymentsRequiringExtraProcessing_args)that);
      return false;
    }

    public boolean equals(getPaymentsRequiringExtraProcessing_args that) {
      if (that == null)
        return false;

      boolean this_present_category = true && this.isSetCategory();
      boolean that_present_category = true && that.isSetCategory();
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (!this.category.equals(that.category))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentsRequiringExtraProcessing_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentsRequiringExtraProcessing_args typedOther = (getPaymentsRequiringExtraProcessing_args)other;

      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.category = ExtraPaymentProcessingType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (this.category != null) {
        oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
        oprot.writeI32(this.category.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentsRequiringExtraProcessing_args(");
      boolean first = true;

      sb.append("category:");
      if (this.category == null) {
        sb.append("null");
      } else {
        sb.append(this.category);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentsRequiringExtraProcessing_result implements org.apache.thrift.TBase<getPaymentsRequiringExtraProcessing_result, getPaymentsRequiringExtraProcessing_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentsRequiringExtraProcessing_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);

    private List<Long> success; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentsRequiringExtraProcessing_result.class, metaDataMap);
    }

    public getPaymentsRequiringExtraProcessing_result() {
    }

    public getPaymentsRequiringExtraProcessing_result(
      List<Long> success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentsRequiringExtraProcessing_result(getPaymentsRequiringExtraProcessing_result other) {
      if (other.isSetSuccess()) {
        List<Long> __this__success = new ArrayList<Long>();
        for (Long other_element : other.success) {
          __this__success.add(other_element);
        }
        this.success = __this__success;
      }
    }

    public getPaymentsRequiringExtraProcessing_result deepCopy() {
      return new getPaymentsRequiringExtraProcessing_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
    }

    public int getSuccessSize() {
      return (this.success == null) ? 0 : this.success.size();
    }

    public java.util.Iterator<Long> getSuccessIterator() {
      return (this.success == null) ? null : this.success.iterator();
    }

    public void addToSuccess(long elem) {
      if (this.success == null) {
        this.success = new ArrayList<Long>();
      }
      this.success.add(elem);
    }

    public List<Long> getSuccess() {
      return this.success;
    }

    public void setSuccess(List<Long> success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((List<Long>)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentsRequiringExtraProcessing_result)
        return this.equals((getPaymentsRequiringExtraProcessing_result)that);
      return false;
    }

    public boolean equals(getPaymentsRequiringExtraProcessing_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentsRequiringExtraProcessing_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentsRequiringExtraProcessing_result typedOther = (getPaymentsRequiringExtraProcessing_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list44 = iprot.readListBegin();
                this.success = new ArrayList<Long>(_list44.size);
                for (int _i45 = 0; _i45 < _list44.size; ++_i45)
                {
                  long _elem46; // required
                  _elem46 = iprot.readI64();
                  this.success.add(_elem46);
                }
                iprot.readListEnd();
              }
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.success.size()));
          for (long _iter47 : this.success)
          {
            oprot.writeI64(_iter47);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentsRequiringExtraProcessing_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markPaymentAsProcessed_args implements org.apache.thrift.TBase<markPaymentAsProcessed_args, markPaymentAsProcessed_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markPaymentAsProcessed_args");

    private static final org.apache.thrift.protocol.TField PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("paymentId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("category", org.apache.thrift.protocol.TType.I32, (short)2);

    private long paymentId; // required
    private ExtraPaymentProcessingType category; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      PAYMENT_ID((short)1, "paymentId"),
      /**
       * 
       * @see ExtraPaymentProcessingType
       */
      CATEGORY((short)2, "category");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // PAYMENT_ID
            return PAYMENT_ID;
          case 2: // CATEGORY
            return CATEGORY;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __PAYMENTID_ISSET_ID = 0;
    private BitSet __isset_bit_vector = new BitSet(1);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("paymentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("category", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ExtraPaymentProcessingType.class)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markPaymentAsProcessed_args.class, metaDataMap);
    }

    public markPaymentAsProcessed_args() {
    }

    public markPaymentAsProcessed_args(
      long paymentId,
      ExtraPaymentProcessingType category)
    {
      this();
      this.paymentId = paymentId;
      setPaymentIdIsSet(true);
      this.category = category;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markPaymentAsProcessed_args(markPaymentAsProcessed_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.paymentId = other.paymentId;
      if (other.isSetCategory()) {
        this.category = other.category;
      }
    }

    public markPaymentAsProcessed_args deepCopy() {
      return new markPaymentAsProcessed_args(this);
    }

    @Override
    public void clear() {
      setPaymentIdIsSet(false);
      this.paymentId = 0;
      this.category = null;
    }

    public long getPaymentId() {
      return this.paymentId;
    }

    public void setPaymentId(long paymentId) {
      this.paymentId = paymentId;
      setPaymentIdIsSet(true);
    }

    public void unsetPaymentId() {
      __isset_bit_vector.clear(__PAYMENTID_ISSET_ID);
    }

    /** Returns true if field paymentId is set (has been assigned a value) and false otherwise */
    public boolean isSetPaymentId() {
      return __isset_bit_vector.get(__PAYMENTID_ISSET_ID);
    }

    public void setPaymentIdIsSet(boolean value) {
      __isset_bit_vector.set(__PAYMENTID_ISSET_ID, value);
    }

    /**
     * 
     * @see ExtraPaymentProcessingType
     */
    public ExtraPaymentProcessingType getCategory() {
      return this.category;
    }

    /**
     * 
     * @see ExtraPaymentProcessingType
     */
    public void setCategory(ExtraPaymentProcessingType category) {
      this.category = category;
    }

    public void unsetCategory() {
      this.category = null;
    }

    /** Returns true if field category is set (has been assigned a value) and false otherwise */
    public boolean isSetCategory() {
      return this.category != null;
    }

    public void setCategoryIsSet(boolean value) {
      if (!value) {
        this.category = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case PAYMENT_ID:
        if (value == null) {
          unsetPaymentId();
        } else {
          setPaymentId((Long)value);
        }
        break;

      case CATEGORY:
        if (value == null) {
          unsetCategory();
        } else {
          setCategory((ExtraPaymentProcessingType)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case PAYMENT_ID:
        return Long.valueOf(getPaymentId());

      case CATEGORY:
        return getCategory();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case PAYMENT_ID:
        return isSetPaymentId();
      case CATEGORY:
        return isSetCategory();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markPaymentAsProcessed_args)
        return this.equals((markPaymentAsProcessed_args)that);
      return false;
    }

    public boolean equals(markPaymentAsProcessed_args that) {
      if (that == null)
        return false;

      boolean this_present_paymentId = true;
      boolean that_present_paymentId = true;
      if (this_present_paymentId || that_present_paymentId) {
        if (!(this_present_paymentId && that_present_paymentId))
          return false;
        if (this.paymentId != that.paymentId)
          return false;
      }

      boolean this_present_category = true && this.isSetCategory();
      boolean that_present_category = true && that.isSetCategory();
      if (this_present_category || that_present_category) {
        if (!(this_present_category && that_present_category))
          return false;
        if (!this.category.equals(that.category))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markPaymentAsProcessed_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markPaymentAsProcessed_args typedOther = (markPaymentAsProcessed_args)other;

      lastComparison = Boolean.valueOf(isSetPaymentId()).compareTo(typedOther.isSetPaymentId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPaymentId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paymentId, typedOther.paymentId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCategory()).compareTo(typedOther.isSetCategory());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCategory()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.category, typedOther.category);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // PAYMENT_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.paymentId = iprot.readI64();
              setPaymentIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // CATEGORY
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.category = ExtraPaymentProcessingType.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);
      oprot.writeI64(this.paymentId);
      oprot.writeFieldEnd();
      if (this.category != null) {
        oprot.writeFieldBegin(CATEGORY_FIELD_DESC);
        oprot.writeI32(this.category.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markPaymentAsProcessed_args(");
      boolean first = true;

      sb.append("paymentId:");
      sb.append(this.paymentId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("category:");
      if (this.category == null) {
        sb.append("null");
      } else {
        sb.append(this.category);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class markPaymentAsProcessed_result implements org.apache.thrift.TBase<markPaymentAsProcessed_result, markPaymentAsProcessed_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markPaymentAsProcessed_result");



    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markPaymentAsProcessed_result.class, metaDataMap);
    }

    public markPaymentAsProcessed_result() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public markPaymentAsProcessed_result(markPaymentAsProcessed_result other) {
    }

    public markPaymentAsProcessed_result deepCopy() {
      return new markPaymentAsProcessed_result(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof markPaymentAsProcessed_result)
        return this.equals((markPaymentAsProcessed_result)that);
      return false;
    }

    public boolean equals(markPaymentAsProcessed_result that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(markPaymentAsProcessed_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      markPaymentAsProcessed_result typedOther = (markPaymentAsProcessed_result)other;

      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("markPaymentAsProcessed_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentStatusAtGateway_args implements org.apache.thrift.TBase<getPaymentStatusAtGateway_args, getPaymentStatusAtGateway_args._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentStatusAtGateway_args");

    private static final org.apache.thrift.protocol.TField MERCHANT_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("merchantTxnId", org.apache.thrift.protocol.TType.I64, (short)1);
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
    private static final org.apache.thrift.protocol.TField IS_DIGITAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDigital", org.apache.thrift.protocol.TType.BOOL, (short)3);

    private long merchantTxnId; // required
    private double amount; // required
    private boolean isDigital; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      MERCHANT_TXN_ID((short)1, "merchantTxnId"),
      AMOUNT((short)2, "amount"),
      IS_DIGITAL((short)3, "isDigital");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // MERCHANT_TXN_ID
            return MERCHANT_TXN_ID;
          case 2: // AMOUNT
            return AMOUNT;
          case 3: // IS_DIGITAL
            return IS_DIGITAL;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __MERCHANTTXNID_ISSET_ID = 0;
    private static final int __AMOUNT_ISSET_ID = 1;
    private static final int __ISDIGITAL_ISSET_ID = 2;
    private BitSet __isset_bit_vector = new BitSet(3);

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.MERCHANT_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("merchantTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
      tmpMap.put(_Fields.IS_DIGITAL, new org.apache.thrift.meta_data.FieldMetaData("isDigital", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentStatusAtGateway_args.class, metaDataMap);
    }

    public getPaymentStatusAtGateway_args() {
    }

    public getPaymentStatusAtGateway_args(
      long merchantTxnId,
      double amount,
      boolean isDigital)
    {
      this();
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
      this.amount = amount;
      setAmountIsSet(true);
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentStatusAtGateway_args(getPaymentStatusAtGateway_args other) {
      __isset_bit_vector.clear();
      __isset_bit_vector.or(other.__isset_bit_vector);
      this.merchantTxnId = other.merchantTxnId;
      this.amount = other.amount;
      this.isDigital = other.isDigital;
    }

    public getPaymentStatusAtGateway_args deepCopy() {
      return new getPaymentStatusAtGateway_args(this);
    }

    @Override
    public void clear() {
      setMerchantTxnIdIsSet(false);
      this.merchantTxnId = 0;
      setAmountIsSet(false);
      this.amount = 0.0;
      setIsDigitalIsSet(false);
      this.isDigital = false;
    }

    public long getMerchantTxnId() {
      return this.merchantTxnId;
    }

    public void setMerchantTxnId(long merchantTxnId) {
      this.merchantTxnId = merchantTxnId;
      setMerchantTxnIdIsSet(true);
    }

    public void unsetMerchantTxnId() {
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
    }

    /** Returns true if field merchantTxnId is set (has been assigned a value) and false otherwise */
    public boolean isSetMerchantTxnId() {
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
    }

    public void setMerchantTxnIdIsSet(boolean value) {
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
    }

    public double getAmount() {
      return this.amount;
    }

    public void setAmount(double amount) {
      this.amount = amount;
      setAmountIsSet(true);
    }

    public void unsetAmount() {
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
    }

    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
    public boolean isSetAmount() {
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
    }

    public void setAmountIsSet(boolean value) {
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
    }

    public boolean isIsDigital() {
      return this.isDigital;
    }

    public void setIsDigital(boolean isDigital) {
      this.isDigital = isDigital;
      setIsDigitalIsSet(true);
    }

    public void unsetIsDigital() {
      __isset_bit_vector.clear(__ISDIGITAL_ISSET_ID);
    }

    /** Returns true if field isDigital is set (has been assigned a value) and false otherwise */
    public boolean isSetIsDigital() {
      return __isset_bit_vector.get(__ISDIGITAL_ISSET_ID);
    }

    public void setIsDigitalIsSet(boolean value) {
      __isset_bit_vector.set(__ISDIGITAL_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case MERCHANT_TXN_ID:
        if (value == null) {
          unsetMerchantTxnId();
        } else {
          setMerchantTxnId((Long)value);
        }
        break;

      case AMOUNT:
        if (value == null) {
          unsetAmount();
        } else {
          setAmount((Double)value);
        }
        break;

      case IS_DIGITAL:
        if (value == null) {
          unsetIsDigital();
        } else {
          setIsDigital((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case MERCHANT_TXN_ID:
        return Long.valueOf(getMerchantTxnId());

      case AMOUNT:
        return Double.valueOf(getAmount());

      case IS_DIGITAL:
        return Boolean.valueOf(isIsDigital());

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case MERCHANT_TXN_ID:
        return isSetMerchantTxnId();
      case AMOUNT:
        return isSetAmount();
      case IS_DIGITAL:
        return isSetIsDigital();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentStatusAtGateway_args)
        return this.equals((getPaymentStatusAtGateway_args)that);
      return false;
    }

    public boolean equals(getPaymentStatusAtGateway_args that) {
      if (that == null)
        return false;

      boolean this_present_merchantTxnId = true;
      boolean that_present_merchantTxnId = true;
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
          return false;
        if (this.merchantTxnId != that.merchantTxnId)
          return false;
      }

      boolean this_present_amount = true;
      boolean that_present_amount = true;
      if (this_present_amount || that_present_amount) {
        if (!(this_present_amount && that_present_amount))
          return false;
        if (this.amount != that.amount)
          return false;
      }

      boolean this_present_isDigital = true;
      boolean that_present_isDigital = true;
      if (this_present_isDigital || that_present_isDigital) {
        if (!(this_present_isDigital && that_present_isDigital))
          return false;
        if (this.isDigital != that.isDigital)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentStatusAtGateway_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentStatusAtGateway_args typedOther = (getPaymentStatusAtGateway_args)other;

      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(typedOther.isSetMerchantTxnId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMerchantTxnId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merchantTxnId, typedOther.merchantTxnId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAmount()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetIsDigital()).compareTo(typedOther.isSetIsDigital());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetIsDigital()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDigital, typedOther.isDigital);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 1: // MERCHANT_TXN_ID
            if (field.type == org.apache.thrift.protocol.TType.I64) {
              this.merchantTxnId = iprot.readI64();
              setMerchantTxnIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 2: // AMOUNT
            if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
              this.amount = iprot.readDouble();
              setAmountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 3: // IS_DIGITAL
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
              this.isDigital = iprot.readBool();
              setIsDigitalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
      oprot.writeI64(this.merchantTxnId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
      oprot.writeDouble(this.amount);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
      oprot.writeBool(this.isDigital);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentStatusAtGateway_args(");
      boolean first = true;

      sb.append("merchantTxnId:");
      sb.append(this.merchantTxnId);
      first = false;
      if (!first) sb.append(", ");
      sb.append("amount:");
      sb.append(this.amount);
      first = false;
      if (!first) sb.append(", ");
      sb.append("isDigital:");
      sb.append(this.isDigital);
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
        __isset_bit_vector = new BitSet(1);
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

  public static class getPaymentStatusAtGateway_result implements org.apache.thrift.TBase<getPaymentStatusAtGateway_result, getPaymentStatusAtGateway_result._Fields>, java.io.Serializable, Cloneable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPaymentStatusAtGateway_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
    private static final org.apache.thrift.protocol.TField PE_FIELD_DESC = new org.apache.thrift.protocol.TField("pe", org.apache.thrift.protocol.TType.STRUCT, (short)1);

    private PaymentStatus success; // required
    private PaymentException pe; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      /**
       * 
       * @see PaymentStatus
       */
      SUCCESS((short)0, "success"),
      PE((short)1, "pe");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // PE
            return PE;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments

    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PaymentStatus.class)));
      tmpMap.put(_Fields.PE, new org.apache.thrift.meta_data.FieldMetaData("pe", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPaymentStatusAtGateway_result.class, metaDataMap);
    }

    public getPaymentStatusAtGateway_result() {
    }

    public getPaymentStatusAtGateway_result(
      PaymentStatus success,
      PaymentException pe)
    {
      this();
      this.success = success;
      this.pe = pe;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getPaymentStatusAtGateway_result(getPaymentStatusAtGateway_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetPe()) {
        this.pe = new PaymentException(other.pe);
      }
    }

    public getPaymentStatusAtGateway_result deepCopy() {
      return new getPaymentStatusAtGateway_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.pe = null;
    }

    /**
     * 
     * @see PaymentStatus
     */
    public PaymentStatus getSuccess() {
      return this.success;
    }

    /**
     * 
     * @see PaymentStatus
     */
    public void setSuccess(PaymentStatus success) {
      this.success = success;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public PaymentException getPe() {
      return this.pe;
    }

    public void setPe(PaymentException pe) {
      this.pe = pe;
    }

    public void unsetPe() {
      this.pe = null;
    }

    /** Returns true if field pe is set (has been assigned a value) and false otherwise */
    public boolean isSetPe() {
      return this.pe != null;
    }

    public void setPeIsSet(boolean value) {
      if (!value) {
        this.pe = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((PaymentStatus)value);
        }
        break;

      case PE:
        if (value == null) {
          unsetPe();
        } else {
          setPe((PaymentException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case PE:
        return getPe();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case PE:
        return isSetPe();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getPaymentStatusAtGateway_result)
        return this.equals((getPaymentStatusAtGateway_result)that);
      return false;
    }

    public boolean equals(getPaymentStatusAtGateway_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_pe = true && this.isSetPe();
      boolean that_present_pe = true && that.isSetPe();
      if (this_present_pe || that_present_pe) {
        if (!(this_present_pe && that_present_pe))
          return false;
        if (!this.pe.equals(that.pe))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      return 0;
    }

    public int compareTo(getPaymentStatusAtGateway_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;
      getPaymentStatusAtGateway_result typedOther = (getPaymentStatusAtGateway_result)other;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(typedOther.isSetPe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pe, typedOther.pe);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }

    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true)
      {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
              this.success = PaymentStatus.findByValue(iprot.readI32());
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // PE
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.pe = new PaymentException();
              this.pe.read(iprot);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      oprot.writeStructBegin(STRUCT_DESC);

      if (this.isSetSuccess()) {
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
        oprot.writeI32(this.success.getValue());
        oprot.writeFieldEnd();
      } else if (this.isSetPe()) {
        oprot.writeFieldBegin(PE_FIELD_DESC);
        this.pe.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("getPaymentStatusAtGateway_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("pe:");
      if (this.pe == null) {
        sb.append("null");
      } else {
        sb.append(this.pe);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

  }

}