Subversion Repositories SmartDukaan

Rev

Rev 6050 | 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 Payment implements org.apache.thrift.TBase<Payment, Payment._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Payment");

  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 GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.I64, (short)2);
  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)3);
  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)4);
  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)5);
  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)6);
  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)7);
  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)8);
  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)9);
  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)10);
  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)11);
  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)12);
  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)13);
  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)14);
  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)15);
  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)16);
  private static final org.apache.thrift.protocol.TField INIT_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("initTimestamp", org.apache.thrift.protocol.TType.I64, (short)17);
  private static final org.apache.thrift.protocol.TField SUCCESS_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("successTimestamp", org.apache.thrift.protocol.TType.I64, (short)18);
  private static final org.apache.thrift.protocol.TField ERROR_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("errorTimestamp", org.apache.thrift.protocol.TType.I64, (short)19);
  private static final org.apache.thrift.protocol.TField PROVISIONAL_CAPTURE_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("provisionalCaptureTimestamp", org.apache.thrift.protocol.TType.I64, (short)20);
  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)21);
  private static final org.apache.thrift.protocol.TField REFUND_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("refundAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)22);

  private long paymentId; // required
  private long gatewayId; // required
  private String gatewayPaymentId; // required
  private long merchantTxnId; // required
  private String gatewayTxnId; // required
  private double amount; // required
  private String gatewayTxnStatus; // required
  private PaymentStatus status; // required
  private long userId; // required
  private String errorCode; // required
  private String description; // required
  private String authCode; // required
  private String referenceCode; // required
  private String sessionId; // required
  private String gatewayTxnDate; // required
  private List<Attribute> attributes; // required
  private long initTimestamp; // required
  private long successTimestamp; // required
  private long errorTimestamp; // required
  private long provisionalCaptureTimestamp; // required
  private boolean isDigital; // required
  private double refundAmount; // 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"),
    GATEWAY_ID((short)2, "gatewayId"),
    GATEWAY_PAYMENT_ID((short)3, "gatewayPaymentId"),
    MERCHANT_TXN_ID((short)4, "merchantTxnId"),
    GATEWAY_TXN_ID((short)5, "gatewayTxnId"),
    AMOUNT((short)6, "amount"),
    GATEWAY_TXN_STATUS((short)7, "gatewayTxnStatus"),
    /**
     * 
     * @see PaymentStatus
     */
    STATUS((short)8, "status"),
    USER_ID((short)9, "userId"),
    ERROR_CODE((short)10, "errorCode"),
    DESCRIPTION((short)11, "description"),
    AUTH_CODE((short)12, "authCode"),
    REFERENCE_CODE((short)13, "referenceCode"),
    SESSION_ID((short)14, "sessionId"),
    GATEWAY_TXN_DATE((short)15, "gatewayTxnDate"),
    ATTRIBUTES((short)16, "attributes"),
    INIT_TIMESTAMP((short)17, "initTimestamp"),
    SUCCESS_TIMESTAMP((short)18, "successTimestamp"),
    ERROR_TIMESTAMP((short)19, "errorTimestamp"),
    PROVISIONAL_CAPTURE_TIMESTAMP((short)20, "provisionalCaptureTimestamp"),
    IS_DIGITAL((short)21, "isDigital"),
    REFUND_AMOUNT((short)22, "refundAmount");

    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: // GATEWAY_ID
          return GATEWAY_ID;
        case 3: // GATEWAY_PAYMENT_ID
          return GATEWAY_PAYMENT_ID;
        case 4: // MERCHANT_TXN_ID
          return MERCHANT_TXN_ID;
        case 5: // GATEWAY_TXN_ID
          return GATEWAY_TXN_ID;
        case 6: // AMOUNT
          return AMOUNT;
        case 7: // GATEWAY_TXN_STATUS
          return GATEWAY_TXN_STATUS;
        case 8: // STATUS
          return STATUS;
        case 9: // USER_ID
          return USER_ID;
        case 10: // ERROR_CODE
          return ERROR_CODE;
        case 11: // DESCRIPTION
          return DESCRIPTION;
        case 12: // AUTH_CODE
          return AUTH_CODE;
        case 13: // REFERENCE_CODE
          return REFERENCE_CODE;
        case 14: // SESSION_ID
          return SESSION_ID;
        case 15: // GATEWAY_TXN_DATE
          return GATEWAY_TXN_DATE;
        case 16: // ATTRIBUTES
          return ATTRIBUTES;
        case 17: // INIT_TIMESTAMP
          return INIT_TIMESTAMP;
        case 18: // SUCCESS_TIMESTAMP
          return SUCCESS_TIMESTAMP;
        case 19: // ERROR_TIMESTAMP
          return ERROR_TIMESTAMP;
        case 20: // PROVISIONAL_CAPTURE_TIMESTAMP
          return PROVISIONAL_CAPTURE_TIMESTAMP;
        case 21: // IS_DIGITAL
          return IS_DIGITAL;
        case 22: // REFUND_AMOUNT
          return REFUND_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 __PAYMENTID_ISSET_ID = 0;
  private static final int __GATEWAYID_ISSET_ID = 1;
  private static final int __MERCHANTTXNID_ISSET_ID = 2;
  private static final int __AMOUNT_ISSET_ID = 3;
  private static final int __USERID_ISSET_ID = 4;
  private static final int __INITTIMESTAMP_ISSET_ID = 5;
  private static final int __SUCCESSTIMESTAMP_ISSET_ID = 6;
  private static final int __ERRORTIMESTAMP_ISSET_ID = 7;
  private static final int __PROVISIONALCAPTURETIMESTAMP_ISSET_ID = 8;
  private static final int __ISDIGITAL_ISSET_ID = 9;
  private static final int __REFUNDAMOUNT_ISSET_ID = 10;
  private BitSet __isset_bit_vector = new BitSet(11);

  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.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.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.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.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.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_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.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.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.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.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.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.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_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))));
    tmpMap.put(_Fields.INIT_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("initTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SUCCESS_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("successTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ERROR_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("errorTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.PROVISIONAL_CAPTURE_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("provisionalCaptureTimestamp", 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)));
    tmpMap.put(_Fields.REFUND_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("refundAmount", 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(Payment.class, metaDataMap);
  }

  public Payment() {
  }

  public Payment(
    long paymentId,
    long gatewayId,
    String gatewayPaymentId,
    long merchantTxnId,
    String gatewayTxnId,
    double amount,
    String gatewayTxnStatus,
    PaymentStatus status,
    long userId,
    String errorCode,
    String description,
    String authCode,
    String referenceCode,
    String sessionId,
    String gatewayTxnDate,
    List<Attribute> attributes,
    long initTimestamp,
    long successTimestamp,
    long errorTimestamp,
    long provisionalCaptureTimestamp,
    boolean isDigital,
    double refundAmount)
  {
    this();
    this.paymentId = paymentId;
    setPaymentIdIsSet(true);
    this.gatewayId = gatewayId;
    setGatewayIdIsSet(true);
    this.gatewayPaymentId = gatewayPaymentId;
    this.merchantTxnId = merchantTxnId;
    setMerchantTxnIdIsSet(true);
    this.gatewayTxnId = gatewayTxnId;
    this.amount = amount;
    setAmountIsSet(true);
    this.gatewayTxnStatus = gatewayTxnStatus;
    this.status = status;
    this.userId = userId;
    setUserIdIsSet(true);
    this.errorCode = errorCode;
    this.description = description;
    this.authCode = authCode;
    this.referenceCode = referenceCode;
    this.sessionId = sessionId;
    this.gatewayTxnDate = gatewayTxnDate;
    this.attributes = attributes;
    this.initTimestamp = initTimestamp;
    setInitTimestampIsSet(true);
    this.successTimestamp = successTimestamp;
    setSuccessTimestampIsSet(true);
    this.errorTimestamp = errorTimestamp;
    setErrorTimestampIsSet(true);
    this.provisionalCaptureTimestamp = provisionalCaptureTimestamp;
    setProvisionalCaptureTimestampIsSet(true);
    this.isDigital = isDigital;
    setIsDigitalIsSet(true);
    this.refundAmount = refundAmount;
    setRefundAmountIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Payment(Payment other) {
    __isset_bit_vector.clear();
    __isset_bit_vector.or(other.__isset_bit_vector);
    this.paymentId = other.paymentId;
    this.gatewayId = other.gatewayId;
    if (other.isSetGatewayPaymentId()) {
      this.gatewayPaymentId = other.gatewayPaymentId;
    }
    this.merchantTxnId = other.merchantTxnId;
    if (other.isSetGatewayTxnId()) {
      this.gatewayTxnId = other.gatewayTxnId;
    }
    this.amount = other.amount;
    if (other.isSetGatewayTxnStatus()) {
      this.gatewayTxnStatus = other.gatewayTxnStatus;
    }
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    this.userId = other.userId;
    if (other.isSetErrorCode()) {
      this.errorCode = other.errorCode;
    }
    if (other.isSetDescription()) {
      this.description = other.description;
    }
    if (other.isSetAuthCode()) {
      this.authCode = other.authCode;
    }
    if (other.isSetReferenceCode()) {
      this.referenceCode = other.referenceCode;
    }
    if (other.isSetSessionId()) {
      this.sessionId = other.sessionId;
    }
    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;
    }
    this.initTimestamp = other.initTimestamp;
    this.successTimestamp = other.successTimestamp;
    this.errorTimestamp = other.errorTimestamp;
    this.provisionalCaptureTimestamp = other.provisionalCaptureTimestamp;
    this.isDigital = other.isDigital;
    this.refundAmount = other.refundAmount;
  }

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

  @Override
  public void clear() {
    setPaymentIdIsSet(false);
    this.paymentId = 0;
    setGatewayIdIsSet(false);
    this.gatewayId = 0;
    this.gatewayPaymentId = null;
    setMerchantTxnIdIsSet(false);
    this.merchantTxnId = 0;
    this.gatewayTxnId = null;
    setAmountIsSet(false);
    this.amount = 0.0;
    this.gatewayTxnStatus = null;
    this.status = null;
    setUserIdIsSet(false);
    this.userId = 0;
    this.errorCode = null;
    this.description = null;
    this.authCode = null;
    this.referenceCode = null;
    this.sessionId = null;
    this.gatewayTxnDate = null;
    this.attributes = null;
    setInitTimestampIsSet(false);
    this.initTimestamp = 0;
    setSuccessTimestampIsSet(false);
    this.successTimestamp = 0;
    setErrorTimestampIsSet(false);
    this.errorTimestamp = 0;
    setProvisionalCaptureTimestampIsSet(false);
    this.provisionalCaptureTimestamp = 0;
    setIsDigitalIsSet(false);
    this.isDigital = false;
    setRefundAmountIsSet(false);
    this.refundAmount = 0.0;
  }

  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);
  }

  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 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 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 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 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 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;
    }
  }

  /**
   * 
   * @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 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 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;
    }
  }

  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 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 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 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 long getInitTimestamp() {
    return this.initTimestamp;
  }

  public void setInitTimestamp(long initTimestamp) {
    this.initTimestamp = initTimestamp;
    setInitTimestampIsSet(true);
  }

  public void unsetInitTimestamp() {
    __isset_bit_vector.clear(__INITTIMESTAMP_ISSET_ID);
  }

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

  public void setInitTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__INITTIMESTAMP_ISSET_ID, value);
  }

  public long getSuccessTimestamp() {
    return this.successTimestamp;
  }

  public void setSuccessTimestamp(long successTimestamp) {
    this.successTimestamp = successTimestamp;
    setSuccessTimestampIsSet(true);
  }

  public void unsetSuccessTimestamp() {
    __isset_bit_vector.clear(__SUCCESSTIMESTAMP_ISSET_ID);
  }

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

  public void setSuccessTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__SUCCESSTIMESTAMP_ISSET_ID, value);
  }

  public long getErrorTimestamp() {
    return this.errorTimestamp;
  }

  public void setErrorTimestamp(long errorTimestamp) {
    this.errorTimestamp = errorTimestamp;
    setErrorTimestampIsSet(true);
  }

  public void unsetErrorTimestamp() {
    __isset_bit_vector.clear(__ERRORTIMESTAMP_ISSET_ID);
  }

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

  public void setErrorTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__ERRORTIMESTAMP_ISSET_ID, value);
  }

  public long getProvisionalCaptureTimestamp() {
    return this.provisionalCaptureTimestamp;
  }

  public void setProvisionalCaptureTimestamp(long provisionalCaptureTimestamp) {
    this.provisionalCaptureTimestamp = provisionalCaptureTimestamp;
    setProvisionalCaptureTimestampIsSet(true);
  }

  public void unsetProvisionalCaptureTimestamp() {
    __isset_bit_vector.clear(__PROVISIONALCAPTURETIMESTAMP_ISSET_ID);
  }

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

  public void setProvisionalCaptureTimestampIsSet(boolean value) {
    __isset_bit_vector.set(__PROVISIONALCAPTURETIMESTAMP_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 double getRefundAmount() {
    return this.refundAmount;
  }

  public void setRefundAmount(double refundAmount) {
    this.refundAmount = refundAmount;
    setRefundAmountIsSet(true);
  }

  public void unsetRefundAmount() {
    __isset_bit_vector.clear(__REFUNDAMOUNT_ISSET_ID);
  }

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

  public void setRefundAmountIsSet(boolean value) {
    __isset_bit_vector.set(__REFUNDAMOUNT_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case PAYMENT_ID:
      if (value == null) {
        unsetPaymentId();
      } else {
        setPaymentId((Long)value);
      }
      break;

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

    case GATEWAY_PAYMENT_ID:
      if (value == null) {
        unsetGatewayPaymentId();
      } else {
        setGatewayPaymentId((String)value);
      }
      break;

    case MERCHANT_TXN_ID:
      if (value == null) {
        unsetMerchantTxnId();
      } else {
        setMerchantTxnId((Long)value);
      }
      break;

    case GATEWAY_TXN_ID:
      if (value == null) {
        unsetGatewayTxnId();
      } else {
        setGatewayTxnId((String)value);
      }
      break;

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

    case GATEWAY_TXN_STATUS:
      if (value == null) {
        unsetGatewayTxnStatus();
      } else {
        setGatewayTxnStatus((String)value);
      }
      break;

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

    case USER_ID:
      if (value == null) {
        unsetUserId();
      } else {
        setUserId((Long)value);
      }
      break;

    case ERROR_CODE:
      if (value == null) {
        unsetErrorCode();
      } else {
        setErrorCode((String)value);
      }
      break;

    case DESCRIPTION:
      if (value == null) {
        unsetDescription();
      } else {
        setDescription((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 SESSION_ID:
      if (value == null) {
        unsetSessionId();
      } else {
        setSessionId((String)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;

    case INIT_TIMESTAMP:
      if (value == null) {
        unsetInitTimestamp();
      } else {
        setInitTimestamp((Long)value);
      }
      break;

    case SUCCESS_TIMESTAMP:
      if (value == null) {
        unsetSuccessTimestamp();
      } else {
        setSuccessTimestamp((Long)value);
      }
      break;

    case ERROR_TIMESTAMP:
      if (value == null) {
        unsetErrorTimestamp();
      } else {
        setErrorTimestamp((Long)value);
      }
      break;

    case PROVISIONAL_CAPTURE_TIMESTAMP:
      if (value == null) {
        unsetProvisionalCaptureTimestamp();
      } else {
        setProvisionalCaptureTimestamp((Long)value);
      }
      break;

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

    case REFUND_AMOUNT:
      if (value == null) {
        unsetRefundAmount();
      } else {
        setRefundAmount((Double)value);
      }
      break;

    }
  }

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

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

    case GATEWAY_PAYMENT_ID:
      return getGatewayPaymentId();

    case MERCHANT_TXN_ID:
      return Long.valueOf(getMerchantTxnId());

    case GATEWAY_TXN_ID:
      return getGatewayTxnId();

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

    case GATEWAY_TXN_STATUS:
      return getGatewayTxnStatus();

    case STATUS:
      return getStatus();

    case USER_ID:
      return Long.valueOf(getUserId());

    case ERROR_CODE:
      return getErrorCode();

    case DESCRIPTION:
      return getDescription();

    case AUTH_CODE:
      return getAuthCode();

    case REFERENCE_CODE:
      return getReferenceCode();

    case SESSION_ID:
      return getSessionId();

    case GATEWAY_TXN_DATE:
      return getGatewayTxnDate();

    case ATTRIBUTES:
      return getAttributes();

    case INIT_TIMESTAMP:
      return Long.valueOf(getInitTimestamp());

    case SUCCESS_TIMESTAMP:
      return Long.valueOf(getSuccessTimestamp());

    case ERROR_TIMESTAMP:
      return Long.valueOf(getErrorTimestamp());

    case PROVISIONAL_CAPTURE_TIMESTAMP:
      return Long.valueOf(getProvisionalCaptureTimestamp());

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

    case REFUND_AMOUNT:
      return Double.valueOf(getRefundAmount());

    }
    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 GATEWAY_ID:
      return isSetGatewayId();
    case GATEWAY_PAYMENT_ID:
      return isSetGatewayPaymentId();
    case MERCHANT_TXN_ID:
      return isSetMerchantTxnId();
    case GATEWAY_TXN_ID:
      return isSetGatewayTxnId();
    case AMOUNT:
      return isSetAmount();
    case GATEWAY_TXN_STATUS:
      return isSetGatewayTxnStatus();
    case STATUS:
      return isSetStatus();
    case USER_ID:
      return isSetUserId();
    case ERROR_CODE:
      return isSetErrorCode();
    case DESCRIPTION:
      return isSetDescription();
    case AUTH_CODE:
      return isSetAuthCode();
    case REFERENCE_CODE:
      return isSetReferenceCode();
    case SESSION_ID:
      return isSetSessionId();
    case GATEWAY_TXN_DATE:
      return isSetGatewayTxnDate();
    case ATTRIBUTES:
      return isSetAttributes();
    case INIT_TIMESTAMP:
      return isSetInitTimestamp();
    case SUCCESS_TIMESTAMP:
      return isSetSuccessTimestamp();
    case ERROR_TIMESTAMP:
      return isSetErrorTimestamp();
    case PROVISIONAL_CAPTURE_TIMESTAMP:
      return isSetProvisionalCaptureTimestamp();
    case IS_DIGITAL:
      return isSetIsDigital();
    case REFUND_AMOUNT:
      return isSetRefundAmount();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(Payment 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_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_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_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_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_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_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_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_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_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_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_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_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_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;
    }

    boolean this_present_initTimestamp = true;
    boolean that_present_initTimestamp = true;
    if (this_present_initTimestamp || that_present_initTimestamp) {
      if (!(this_present_initTimestamp && that_present_initTimestamp))
        return false;
      if (this.initTimestamp != that.initTimestamp)
        return false;
    }

    boolean this_present_successTimestamp = true;
    boolean that_present_successTimestamp = true;
    if (this_present_successTimestamp || that_present_successTimestamp) {
      if (!(this_present_successTimestamp && that_present_successTimestamp))
        return false;
      if (this.successTimestamp != that.successTimestamp)
        return false;
    }

    boolean this_present_errorTimestamp = true;
    boolean that_present_errorTimestamp = true;
    if (this_present_errorTimestamp || that_present_errorTimestamp) {
      if (!(this_present_errorTimestamp && that_present_errorTimestamp))
        return false;
      if (this.errorTimestamp != that.errorTimestamp)
        return false;
    }

    boolean this_present_provisionalCaptureTimestamp = true;
    boolean that_present_provisionalCaptureTimestamp = true;
    if (this_present_provisionalCaptureTimestamp || that_present_provisionalCaptureTimestamp) {
      if (!(this_present_provisionalCaptureTimestamp && that_present_provisionalCaptureTimestamp))
        return false;
      if (this.provisionalCaptureTimestamp != that.provisionalCaptureTimestamp)
        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;
    }

    boolean this_present_refundAmount = true;
    boolean that_present_refundAmount = true;
    if (this_present_refundAmount || that_present_refundAmount) {
      if (!(this_present_refundAmount && that_present_refundAmount))
        return false;
      if (this.refundAmount != that.refundAmount)
        return false;
    }

    return true;
  }

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

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

    int lastComparison = 0;
    Payment typedOther = (Payment)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(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(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(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(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(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(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(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(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(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(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(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(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(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;
      }
    }
    lastComparison = Boolean.valueOf(isSetInitTimestamp()).compareTo(typedOther.isSetInitTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInitTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.initTimestamp, typedOther.initTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSuccessTimestamp()).compareTo(typedOther.isSetSuccessTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSuccessTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.successTimestamp, typedOther.successTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetErrorTimestamp()).compareTo(typedOther.isSetErrorTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorTimestamp, typedOther.errorTimestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetProvisionalCaptureTimestamp()).compareTo(typedOther.isSetProvisionalCaptureTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProvisionalCaptureTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.provisionalCaptureTimestamp, typedOther.provisionalCaptureTimestamp);
      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;
      }
    }
    lastComparison = Boolean.valueOf(isSetRefundAmount()).compareTo(typedOther.isSetRefundAmount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRefundAmount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.refundAmount, typedOther.refundAmount);
      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: // 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 3: // 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 4: // 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 5: // 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 6: // 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 7: // 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 8: // 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 9: // 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 10: // 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 11: // 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 12: // 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 13: // 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 14: // 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 15: // 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 16: // ATTRIBUTES
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
            {
              org.apache.thrift.protocol.TList _list4 = iprot.readListBegin();
              this.attributes = new ArrayList<Attribute>(_list4.size);
              for (int _i5 = 0; _i5 < _list4.size; ++_i5)
              {
                Attribute _elem6; // required
                _elem6 = new Attribute();
                _elem6.read(iprot);
                this.attributes.add(_elem6);
              }
              iprot.readListEnd();
            }
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 17: // INIT_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.initTimestamp = iprot.readI64();
            setInitTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 18: // SUCCESS_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.successTimestamp = iprot.readI64();
            setSuccessTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 19: // ERROR_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.errorTimestamp = iprot.readI64();
            setErrorTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 20: // PROVISIONAL_CAPTURE_TIMESTAMP
          if (field.type == org.apache.thrift.protocol.TType.I64) {
            this.provisionalCaptureTimestamp = iprot.readI64();
            setProvisionalCaptureTimestampIsSet(true);
          } else { 
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 21: // 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;
        case 22: // REFUND_AMOUNT
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
            this.refundAmount = iprot.readDouble();
            setRefundAmountIsSet(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(PAYMENT_ID_FIELD_DESC);
    oprot.writeI64(this.paymentId);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
    oprot.writeI64(this.gatewayId);
    oprot.writeFieldEnd();
    if (this.gatewayPaymentId != null) {
      oprot.writeFieldBegin(GATEWAY_PAYMENT_ID_FIELD_DESC);
      oprot.writeString(this.gatewayPaymentId);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
    oprot.writeI64(this.merchantTxnId);
    oprot.writeFieldEnd();
    if (this.gatewayTxnId != null) {
      oprot.writeFieldBegin(GATEWAY_TXN_ID_FIELD_DESC);
      oprot.writeString(this.gatewayTxnId);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
    oprot.writeDouble(this.amount);
    oprot.writeFieldEnd();
    if (this.gatewayTxnStatus != null) {
      oprot.writeFieldBegin(GATEWAY_TXN_STATUS_FIELD_DESC);
      oprot.writeString(this.gatewayTxnStatus);
      oprot.writeFieldEnd();
    }
    if (this.status != null) {
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
      oprot.writeI32(this.status.getValue());
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
    oprot.writeI64(this.userId);
    oprot.writeFieldEnd();
    if (this.errorCode != null) {
      oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC);
      oprot.writeString(this.errorCode);
      oprot.writeFieldEnd();
    }
    if (this.description != null) {
      oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
      oprot.writeString(this.description);
      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.sessionId != null) {
      oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
      oprot.writeString(this.sessionId);
      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 _iter7 : this.attributes)
        {
          _iter7.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(INIT_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.initTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(SUCCESS_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.successTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(ERROR_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.errorTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(PROVISIONAL_CAPTURE_TIMESTAMP_FIELD_DESC);
    oprot.writeI64(this.provisionalCaptureTimestamp);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
    oprot.writeBool(this.isDigital);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(REFUND_AMOUNT_FIELD_DESC);
    oprot.writeDouble(this.refundAmount);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }

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

    sb.append("paymentId:");
    sb.append(this.paymentId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("gatewayId:");
    sb.append(this.gatewayId);
    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("merchantTxnId:");
    sb.append(this.merchantTxnId);
    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("amount:");
    sb.append(this.amount);
    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("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("userId:");
    sb.append(this.userId);
    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("description:");
    if (this.description == null) {
      sb.append("null");
    } else {
      sb.append(this.description);
    }
    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("sessionId:");
    if (this.sessionId == null) {
      sb.append("null");
    } else {
      sb.append(this.sessionId);
    }
    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;
    if (!first) sb.append(", ");
    sb.append("initTimestamp:");
    sb.append(this.initTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("successTimestamp:");
    sb.append(this.successTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("errorTimestamp:");
    sb.append(this.errorTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("provisionalCaptureTimestamp:");
    sb.append(this.provisionalCaptureTimestamp);
    first = false;
    if (!first) sb.append(", ");
    sb.append("isDigital:");
    sb.append(this.isDigital);
    first = false;
    if (!first) sb.append(", ");
    sb.append("refundAmount:");
    sb.append(this.refundAmount);
    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);
    }
  }

}