Subversion Repositories SmartDukaan

Rev

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

Rev 2041 Rev 2060
Line 54... Line 54...
54
     * @param gatewayId
54
     * @param gatewayId
55
     */
55
     */
56
    public List<Payment> getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, TException;
56
    public List<Payment> getPaymentsForUser(long userId, long fromTime, long toTime, PaymentStatus status, long gatewayId) throws PaymentException, TException;
57
 
57
 
58
    /**
58
    /**
59
     * get all payments for user. Gateway is mandatory.
59
     * get all payments for user. If gatewayId is 0, then it is ignored while filtering.
60
     * 
60
     * 
61
     * 
61
     * 
62
     * @param fromTime
62
     * @param fromTime
63
     * @param toTime
63
     * @param toTime
64
     * @param status
64
     * @param status
Line 113... Line 113...
113
     * Returns the minimum and maximum amounts among successful payments.
113
     * Returns the minimum and maximum amounts among successful payments.
114
     * List contains two double values, first minimum and second maximum amount.
114
     * List contains two double values, first minimum and second maximum amount.
115
     */
115
     */
116
    public List<Double> getSuccessfulPaymentsAmountRange() throws TException;
116
    public List<Double> getSuccessfulPaymentsAmountRange() throws TException;
117
 
117
 
118
    /**
-
 
119
     * Update the authorization attributes of the payment and attempt to capture it in case it was authorized.
-
 
120
     * If either the authorization failed or the capture attempt failed, the payment is marked as failed.
-
 
121
     * 
-
 
122
     * @param paymentParams
-
 
123
     */
-
 
124
    public Payment updateAndCaptureEbsPayment(Map<String,String> paymentParams) throws PaymentException, TException;
-
 
125
 
-
 
126
  }
118
  }
127
 
119
 
128
  public static class Client implements Iface {
120
  public static class Client implements Iface {
129
    public Client(TProtocol prot)
121
    public Client(TProtocol prot)
130
    {
122
    {
Line 484... Line 476...
484
        return result.success;
476
        return result.success;
485
      }
477
      }
486
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentsAmountRange failed: unknown result");
478
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getSuccessfulPaymentsAmountRange failed: unknown result");
487
    }
479
    }
488
 
480
 
489
    public Payment updateAndCaptureEbsPayment(Map<String,String> paymentParams) throws PaymentException, TException
-
 
490
    {
-
 
491
      send_updateAndCaptureEbsPayment(paymentParams);
-
 
492
      return recv_updateAndCaptureEbsPayment();
-
 
493
    }
-
 
494
 
-
 
495
    public void send_updateAndCaptureEbsPayment(Map<String,String> paymentParams) throws TException
-
 
496
    {
-
 
497
      oprot_.writeMessageBegin(new TMessage("updateAndCaptureEbsPayment", TMessageType.CALL, seqid_));
-
 
498
      updateAndCaptureEbsPayment_args args = new updateAndCaptureEbsPayment_args();
-
 
499
      args.paymentParams = paymentParams;
-
 
500
      args.write(oprot_);
-
 
501
      oprot_.writeMessageEnd();
-
 
502
      oprot_.getTransport().flush();
-
 
503
    }
-
 
504
 
-
 
505
    public Payment recv_updateAndCaptureEbsPayment() throws PaymentException, TException
-
 
506
    {
-
 
507
      TMessage msg = iprot_.readMessageBegin();
-
 
508
      if (msg.type == TMessageType.EXCEPTION) {
-
 
509
        TApplicationException x = TApplicationException.read(iprot_);
-
 
510
        iprot_.readMessageEnd();
-
 
511
        throw x;
-
 
512
      }
-
 
513
      updateAndCaptureEbsPayment_result result = new updateAndCaptureEbsPayment_result();
-
 
514
      result.read(iprot_);
-
 
515
      iprot_.readMessageEnd();
-
 
516
      if (result.isSetSuccess()) {
-
 
517
        return result.success;
-
 
518
      }
-
 
519
      if (result.pe != null) {
-
 
520
        throw result.pe;
-
 
521
      }
-
 
522
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updateAndCaptureEbsPayment failed: unknown result");
-
 
523
    }
-
 
524
 
-
 
525
  }
481
  }
526
  public static class Processor implements TProcessor {
482
  public static class Processor implements TProcessor {
527
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
483
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
528
    public Processor(Iface iface)
484
    public Processor(Iface iface)
529
    {
485
    {
Line 535... Line 491...
535
      processMap_.put("getPaymentGateway", new getPaymentGateway());
491
      processMap_.put("getPaymentGateway", new getPaymentGateway());
536
      processMap_.put("getPayment", new getPayment());
492
      processMap_.put("getPayment", new getPayment());
537
      processMap_.put("getPaymentForTxnId", new getPaymentForTxnId());
493
      processMap_.put("getPaymentForTxnId", new getPaymentForTxnId());
538
      processMap_.put("updatePaymentDetails", new updatePaymentDetails());
494
      processMap_.put("updatePaymentDetails", new updatePaymentDetails());
539
      processMap_.put("getSuccessfulPaymentsAmountRange", new getSuccessfulPaymentsAmountRange());
495
      processMap_.put("getSuccessfulPaymentsAmountRange", new getSuccessfulPaymentsAmountRange());
540
      processMap_.put("updateAndCaptureEbsPayment", new updateAndCaptureEbsPayment());
-
 
541
    }
496
    }
542
 
497
 
543
    protected static interface ProcessFunction {
498
    protected static interface ProcessFunction {
544
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
499
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
545
    }
500
    }
Line 793... Line 748...
793
        oprot.getTransport().flush();
748
        oprot.getTransport().flush();
794
      }
749
      }
795
 
750
 
796
    }
751
    }
797
 
752
 
798
    private class updateAndCaptureEbsPayment implements ProcessFunction {
-
 
799
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
800
      {
-
 
801
        updateAndCaptureEbsPayment_args args = new updateAndCaptureEbsPayment_args();
-
 
802
        args.read(iprot);
-
 
803
        iprot.readMessageEnd();
-
 
804
        updateAndCaptureEbsPayment_result result = new updateAndCaptureEbsPayment_result();
-
 
805
        try {
-
 
806
          result.success = iface_.updateAndCaptureEbsPayment(args.paymentParams);
-
 
807
        } catch (PaymentException pe) {
-
 
808
          result.pe = pe;
-
 
809
        } catch (Throwable th) {
-
 
810
          LOGGER.error("Internal error processing updateAndCaptureEbsPayment", th);
-
 
811
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing updateAndCaptureEbsPayment");
-
 
812
          oprot.writeMessageBegin(new TMessage("updateAndCaptureEbsPayment", TMessageType.EXCEPTION, seqid));
-
 
813
          x.write(oprot);
-
 
814
          oprot.writeMessageEnd();
-
 
815
          oprot.getTransport().flush();
-
 
816
          return;
-
 
817
        }
-
 
818
        oprot.writeMessageBegin(new TMessage("updateAndCaptureEbsPayment", TMessageType.REPLY, seqid));
-
 
819
        result.write(oprot);
-
 
820
        oprot.writeMessageEnd();
-
 
821
        oprot.getTransport().flush();
-
 
822
      }
-
 
823
 
-
 
824
    }
-
 
825
 
-
 
826
  }
753
  }
827
 
754
 
828
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
755
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
829
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
756
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
830
 
757
 
Line 8127... Line 8054...
8127
      }
8054
      }
8128
      first = false;
8055
      first = false;
8129
      sb.append(")");
8056
      sb.append(")");
8130
      return sb.toString();
8057
      return sb.toString();
8131
    }
8058
    }
8132
 
-
 
8133
    public void validate() throws TException {
-
 
8134
      // check for required fields
-
 
8135
    }
-
 
8136
 
-
 
8137
  }
-
 
8138
 
-
 
8139
  public static class updateAndCaptureEbsPayment_args implements TBase<updateAndCaptureEbsPayment_args._Fields>, java.io.Serializable, Cloneable   {
-
 
8140
    private static final TStruct STRUCT_DESC = new TStruct("updateAndCaptureEbsPayment_args");
-
 
8141
 
-
 
8142
    private static final TField PAYMENT_PARAMS_FIELD_DESC = new TField("paymentParams", TType.MAP, (short)1);
-
 
8143
 
-
 
8144
    private Map<String,String> paymentParams;
-
 
8145
 
-
 
8146
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
8147
    public enum _Fields implements TFieldIdEnum {
-
 
8148
      PAYMENT_PARAMS((short)1, "paymentParams");
-
 
8149
 
-
 
8150
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
8151
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
8152
 
-
 
8153
      static {
-
 
8154
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
8155
          byId.put((int)field._thriftId, field);
-
 
8156
          byName.put(field.getFieldName(), field);
-
 
8157
        }
-
 
8158
      }
-
 
8159
 
-
 
8160
      /**
-
 
8161
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
8162
       */
-
 
8163
      public static _Fields findByThriftId(int fieldId) {
-
 
8164
        return byId.get(fieldId);
-
 
8165
      }
-
 
8166
 
-
 
8167
      /**
-
 
8168
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
8169
       * if it is not found.
-
 
8170
       */
-
 
8171
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
8172
        _Fields fields = findByThriftId(fieldId);
-
 
8173
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
8174
        return fields;
-
 
8175
      }
-
 
8176
 
-
 
8177
      /**
-
 
8178
       * Find the _Fields constant that matches name, or null if its not found.
-
 
8179
       */
-
 
8180
      public static _Fields findByName(String name) {
-
 
8181
        return byName.get(name);
-
 
8182
      }
-
 
8183
 
-
 
8184
      private final short _thriftId;
-
 
8185
      private final String _fieldName;
-
 
8186
 
-
 
8187
      _Fields(short thriftId, String fieldName) {
-
 
8188
        _thriftId = thriftId;
-
 
8189
        _fieldName = fieldName;
-
 
8190
      }
-
 
8191
 
-
 
8192
      public short getThriftFieldId() {
-
 
8193
        return _thriftId;
-
 
8194
      }
-
 
8195
 
-
 
8196
      public String getFieldName() {
-
 
8197
        return _fieldName;
-
 
8198
      }
-
 
8199
    }
-
 
8200
 
-
 
8201
    // isset id assignments
-
 
8202
 
-
 
8203
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
8204
      put(_Fields.PAYMENT_PARAMS, new FieldMetaData("paymentParams", TFieldRequirementType.DEFAULT, 
-
 
8205
          new MapMetaData(TType.MAP, 
-
 
8206
              new FieldValueMetaData(TType.STRING), 
-
 
8207
              new FieldValueMetaData(TType.STRING))));
-
 
8208
    }});
-
 
8209
 
-
 
8210
    static {
-
 
8211
      FieldMetaData.addStructMetaDataMap(updateAndCaptureEbsPayment_args.class, metaDataMap);
-
 
8212
    }
-
 
8213
 
-
 
8214
    public updateAndCaptureEbsPayment_args() {
-
 
8215
    }
-
 
8216
 
-
 
8217
    public updateAndCaptureEbsPayment_args(
-
 
8218
      Map<String,String> paymentParams)
-
 
8219
    {
-
 
8220
      this();
-
 
8221
      this.paymentParams = paymentParams;
-
 
8222
    }
-
 
8223
 
-
 
8224
    /**
-
 
8225
     * Performs a deep copy on <i>other</i>.
-
 
8226
     */
-
 
8227
    public updateAndCaptureEbsPayment_args(updateAndCaptureEbsPayment_args other) {
-
 
8228
      if (other.isSetPaymentParams()) {
-
 
8229
        Map<String,String> __this__paymentParams = new HashMap<String,String>();
-
 
8230
        for (Map.Entry<String, String> other_element : other.paymentParams.entrySet()) {
-
 
8231
 
-
 
8232
          String other_element_key = other_element.getKey();
-
 
8233
          String other_element_value = other_element.getValue();
-
 
8234
 
-
 
8235
          String __this__paymentParams_copy_key = other_element_key;
-
 
8236
 
-
 
8237
          String __this__paymentParams_copy_value = other_element_value;
-
 
8238
 
-
 
8239
          __this__paymentParams.put(__this__paymentParams_copy_key, __this__paymentParams_copy_value);
-
 
8240
        }
-
 
8241
        this.paymentParams = __this__paymentParams;
-
 
8242
      }
-
 
8243
    }
-
 
8244
 
-
 
8245
    public updateAndCaptureEbsPayment_args deepCopy() {
-
 
8246
      return new updateAndCaptureEbsPayment_args(this);
-
 
8247
    }
-
 
8248
 
-
 
8249
    @Deprecated
-
 
8250
    public updateAndCaptureEbsPayment_args clone() {
-
 
8251
      return new updateAndCaptureEbsPayment_args(this);
-
 
8252
    }
-
 
8253
 
-
 
8254
    public int getPaymentParamsSize() {
-
 
8255
      return (this.paymentParams == null) ? 0 : this.paymentParams.size();
-
 
8256
    }
-
 
8257
 
-
 
8258
    public void putToPaymentParams(String key, String val) {
-
 
8259
      if (this.paymentParams == null) {
-
 
8260
        this.paymentParams = new HashMap<String,String>();
-
 
8261
      }
-
 
8262
      this.paymentParams.put(key, val);
-
 
8263
    }
-
 
8264
 
-
 
8265
    public Map<String,String> getPaymentParams() {
-
 
8266
      return this.paymentParams;
-
 
8267
    }
-
 
8268
 
-
 
8269
    public updateAndCaptureEbsPayment_args setPaymentParams(Map<String,String> paymentParams) {
-
 
8270
      this.paymentParams = paymentParams;
-
 
8271
      return this;
-
 
8272
    }
-
 
8273
 
-
 
8274
    public void unsetPaymentParams() {
-
 
8275
      this.paymentParams = null;
-
 
8276
    }
-
 
8277
 
-
 
8278
    /** Returns true if field paymentParams is set (has been asigned a value) and false otherwise */
-
 
8279
    public boolean isSetPaymentParams() {
-
 
8280
      return this.paymentParams != null;
-
 
8281
    }
-
 
8282
 
-
 
8283
    public void setPaymentParamsIsSet(boolean value) {
-
 
8284
      if (!value) {
-
 
8285
        this.paymentParams = null;
-
 
8286
      }
-
 
8287
    }
-
 
8288
 
-
 
8289
    public void setFieldValue(_Fields field, Object value) {
-
 
8290
      switch (field) {
-
 
8291
      case PAYMENT_PARAMS:
-
 
8292
        if (value == null) {
-
 
8293
          unsetPaymentParams();
-
 
8294
        } else {
-
 
8295
          setPaymentParams((Map<String,String>)value);
-
 
8296
        }
-
 
8297
        break;
-
 
8298
 
-
 
8299
      }
-
 
8300
    }
-
 
8301
 
-
 
8302
    public void setFieldValue(int fieldID, Object value) {
-
 
8303
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
8304
    }
-
 
8305
 
-
 
8306
    public Object getFieldValue(_Fields field) {
-
 
8307
      switch (field) {
-
 
8308
      case PAYMENT_PARAMS:
-
 
8309
        return getPaymentParams();
-
 
8310
 
-
 
8311
      }
-
 
8312
      throw new IllegalStateException();
-
 
8313
    }
-
 
8314
 
-
 
8315
    public Object getFieldValue(int fieldId) {
-
 
8316
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
8317
    }
-
 
8318
 
-
 
8319
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
8320
    public boolean isSet(_Fields field) {
-
 
8321
      switch (field) {
-
 
8322
      case PAYMENT_PARAMS:
-
 
8323
        return isSetPaymentParams();
-
 
8324
      }
-
 
8325
      throw new IllegalStateException();
-
 
8326
    }
-
 
8327
 
-
 
8328
    public boolean isSet(int fieldID) {
-
 
8329
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
8330
    }
-
 
8331
 
-
 
8332
    @Override
-
 
8333
    public boolean equals(Object that) {
-
 
8334
      if (that == null)
-
 
8335
        return false;
-
 
8336
      if (that instanceof updateAndCaptureEbsPayment_args)
-
 
8337
        return this.equals((updateAndCaptureEbsPayment_args)that);
-
 
8338
      return false;
-
 
8339
    }
-
 
8340
 
-
 
8341
    public boolean equals(updateAndCaptureEbsPayment_args that) {
-
 
8342
      if (that == null)
-
 
8343
        return false;
-
 
8344
 
-
 
8345
      boolean this_present_paymentParams = true && this.isSetPaymentParams();
-
 
8346
      boolean that_present_paymentParams = true && that.isSetPaymentParams();
-
 
8347
      if (this_present_paymentParams || that_present_paymentParams) {
-
 
8348
        if (!(this_present_paymentParams && that_present_paymentParams))
-
 
8349
          return false;
-
 
8350
        if (!this.paymentParams.equals(that.paymentParams))
-
 
8351
          return false;
-
 
8352
      }
-
 
8353
 
-
 
8354
      return true;
-
 
8355
    }
-
 
8356
 
-
 
8357
    @Override
-
 
8358
    public int hashCode() {
-
 
8359
      return 0;
-
 
8360
    }
-
 
8361
 
-
 
8362
    public void read(TProtocol iprot) throws TException {
-
 
8363
      TField field;
-
 
8364
      iprot.readStructBegin();
-
 
8365
      while (true)
-
 
8366
      {
-
 
8367
        field = iprot.readFieldBegin();
-
 
8368
        if (field.type == TType.STOP) { 
-
 
8369
          break;
-
 
8370
        }
-
 
8371
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
8372
        if (fieldId == null) {
-
 
8373
          TProtocolUtil.skip(iprot, field.type);
-
 
8374
        } else {
-
 
8375
          switch (fieldId) {
-
 
8376
            case PAYMENT_PARAMS:
-
 
8377
              if (field.type == TType.MAP) {
-
 
8378
                {
-
 
8379
                  TMap _map28 = iprot.readMapBegin();
-
 
8380
                  this.paymentParams = new HashMap<String,String>(2*_map28.size);
-
 
8381
                  for (int _i29 = 0; _i29 < _map28.size; ++_i29)
-
 
8382
                  {
-
 
8383
                    String _key30;
-
 
8384
                    String _val31;
-
 
8385
                    _key30 = iprot.readString();
-
 
8386
                    _val31 = iprot.readString();
-
 
8387
                    this.paymentParams.put(_key30, _val31);
-
 
8388
                  }
-
 
8389
                  iprot.readMapEnd();
-
 
8390
                }
-
 
8391
              } else { 
-
 
8392
                TProtocolUtil.skip(iprot, field.type);
-
 
8393
              }
-
 
8394
              break;
-
 
8395
          }
-
 
8396
          iprot.readFieldEnd();
-
 
8397
        }
-
 
8398
      }
-
 
8399
      iprot.readStructEnd();
-
 
8400
      validate();
-
 
8401
    }
-
 
8402
 
-
 
8403
    public void write(TProtocol oprot) throws TException {
-
 
8404
      validate();
-
 
8405
 
-
 
8406
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8407
      if (this.paymentParams != null) {
-
 
8408
        oprot.writeFieldBegin(PAYMENT_PARAMS_FIELD_DESC);
-
 
8409
        {
-
 
8410
          oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.paymentParams.size()));
-
 
8411
          for (Map.Entry<String, String> _iter32 : this.paymentParams.entrySet())
-
 
8412
          {
-
 
8413
            oprot.writeString(_iter32.getKey());
-
 
8414
            oprot.writeString(_iter32.getValue());
-
 
8415
          }
-
 
8416
          oprot.writeMapEnd();
-
 
8417
        }
-
 
8418
        oprot.writeFieldEnd();
-
 
8419
      }
-
 
8420
      oprot.writeFieldStop();
-
 
8421
      oprot.writeStructEnd();
-
 
8422
    }
-
 
8423
 
-
 
8424
    @Override
-
 
8425
    public String toString() {
-
 
8426
      StringBuilder sb = new StringBuilder("updateAndCaptureEbsPayment_args(");
-
 
8427
      boolean first = true;
-
 
8428
 
-
 
8429
      sb.append("paymentParams:");
-
 
8430
      if (this.paymentParams == null) {
-
 
8431
        sb.append("null");
-
 
8432
      } else {
-
 
8433
        sb.append(this.paymentParams);
-
 
8434
      }
-
 
8435
      first = false;
-
 
8436
      sb.append(")");
-
 
8437
      return sb.toString();
-
 
8438
    }
-
 
8439
 
-
 
8440
    public void validate() throws TException {
-
 
8441
      // check for required fields
-
 
8442
    }
-
 
8443
 
-
 
8444
  }
-
 
8445
 
-
 
8446
  public static class updateAndCaptureEbsPayment_result implements TBase<updateAndCaptureEbsPayment_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateAndCaptureEbsPayment_result>   {
-
 
8447
    private static final TStruct STRUCT_DESC = new TStruct("updateAndCaptureEbsPayment_result");
-
 
8448
 
-
 
8449
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
8450
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
-
 
8451
 
-
 
8452
    private Payment success;
-
 
8453
    private PaymentException pe;
-
 
8454
 
-
 
8455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
8456
    public enum _Fields implements TFieldIdEnum {
-
 
8457
      SUCCESS((short)0, "success"),
-
 
8458
      PE((short)1, "pe");
-
 
8459
 
-
 
8460
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
8461
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
8462
 
-
 
8463
      static {
-
 
8464
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
8465
          byId.put((int)field._thriftId, field);
-
 
8466
          byName.put(field.getFieldName(), field);
-
 
8467
        }
-
 
8468
      }
-
 
8469
 
-
 
8470
      /**
-
 
8471
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
8472
       */
-
 
8473
      public static _Fields findByThriftId(int fieldId) {
-
 
8474
        return byId.get(fieldId);
-
 
8475
      }
-
 
8476
 
-
 
8477
      /**
-
 
8478
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
8479
       * if it is not found.
-
 
8480
       */
-
 
8481
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
8482
        _Fields fields = findByThriftId(fieldId);
-
 
8483
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
8484
        return fields;
-
 
8485
      }
-
 
8486
 
-
 
8487
      /**
-
 
8488
       * Find the _Fields constant that matches name, or null if its not found.
-
 
8489
       */
-
 
8490
      public static _Fields findByName(String name) {
-
 
8491
        return byName.get(name);
-
 
8492
      }
-
 
8493
 
-
 
8494
      private final short _thriftId;
-
 
8495
      private final String _fieldName;
-
 
8496
 
-
 
8497
      _Fields(short thriftId, String fieldName) {
-
 
8498
        _thriftId = thriftId;
-
 
8499
        _fieldName = fieldName;
-
 
8500
      }
-
 
8501
 
-
 
8502
      public short getThriftFieldId() {
-
 
8503
        return _thriftId;
-
 
8504
      }
-
 
8505
 
-
 
8506
      public String getFieldName() {
-
 
8507
        return _fieldName;
-
 
8508
      }
-
 
8509
    }
-
 
8510
 
-
 
8511
    // isset id assignments
-
 
8512
 
-
 
8513
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
8514
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
8515
          new StructMetaData(TType.STRUCT, Payment.class)));
-
 
8516
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
-
 
8517
          new FieldValueMetaData(TType.STRUCT)));
-
 
8518
    }});
-
 
8519
 
-
 
8520
    static {
-
 
8521
      FieldMetaData.addStructMetaDataMap(updateAndCaptureEbsPayment_result.class, metaDataMap);
-
 
8522
    }
-
 
8523
 
-
 
8524
    public updateAndCaptureEbsPayment_result() {
-
 
8525
    }
-
 
8526
 
-
 
8527
    public updateAndCaptureEbsPayment_result(
-
 
8528
      Payment success,
-
 
8529
      PaymentException pe)
-
 
8530
    {
-
 
8531
      this();
-
 
8532
      this.success = success;
-
 
8533
      this.pe = pe;
-
 
8534
    }
-
 
8535
 
-
 
8536
    /**
-
 
8537
     * Performs a deep copy on <i>other</i>.
-
 
8538
     */
-
 
8539
    public updateAndCaptureEbsPayment_result(updateAndCaptureEbsPayment_result other) {
-
 
8540
      if (other.isSetSuccess()) {
-
 
8541
        this.success = new Payment(other.success);
-
 
8542
      }
-
 
8543
      if (other.isSetPe()) {
-
 
8544
        this.pe = new PaymentException(other.pe);
-
 
8545
      }
-
 
8546
    }
-
 
8547
 
-
 
8548
    public updateAndCaptureEbsPayment_result deepCopy() {
-
 
8549
      return new updateAndCaptureEbsPayment_result(this);
-
 
8550
    }
-
 
8551
 
-
 
8552
    @Deprecated
-
 
8553
    public updateAndCaptureEbsPayment_result clone() {
-
 
8554
      return new updateAndCaptureEbsPayment_result(this);
-
 
8555
    }
-
 
8556
 
-
 
8557
    public Payment getSuccess() {
-
 
8558
      return this.success;
-
 
8559
    }
-
 
8560
 
-
 
8561
    public updateAndCaptureEbsPayment_result setSuccess(Payment success) {
-
 
8562
      this.success = success;
-
 
8563
      return this;
-
 
8564
    }
-
 
8565
 
-
 
8566
    public void unsetSuccess() {
-
 
8567
      this.success = null;
-
 
8568
    }
-
 
8569
 
-
 
8570
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
8571
    public boolean isSetSuccess() {
-
 
8572
      return this.success != null;
-
 
8573
    }
-
 
8574
 
-
 
8575
    public void setSuccessIsSet(boolean value) {
-
 
8576
      if (!value) {
-
 
8577
        this.success = null;
-
 
8578
      }
-
 
8579
    }
-
 
8580
 
-
 
8581
    public PaymentException getPe() {
-
 
8582
      return this.pe;
-
 
8583
    }
-
 
8584
 
-
 
8585
    public updateAndCaptureEbsPayment_result setPe(PaymentException pe) {
-
 
8586
      this.pe = pe;
-
 
8587
      return this;
-
 
8588
    }
-
 
8589
 
-
 
8590
    public void unsetPe() {
-
 
8591
      this.pe = null;
-
 
8592
    }
-
 
8593
 
-
 
8594
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
-
 
8595
    public boolean isSetPe() {
-
 
8596
      return this.pe != null;
-
 
8597
    }
-
 
8598
 
-
 
8599
    public void setPeIsSet(boolean value) {
-
 
8600
      if (!value) {
-
 
8601
        this.pe = null;
-
 
8602
      }
-
 
8603
    }
-
 
8604
 
-
 
8605
    public void setFieldValue(_Fields field, Object value) {
-
 
8606
      switch (field) {
-
 
8607
      case SUCCESS:
-
 
8608
        if (value == null) {
-
 
8609
          unsetSuccess();
-
 
8610
        } else {
-
 
8611
          setSuccess((Payment)value);
-
 
8612
        }
-
 
8613
        break;
-
 
8614
 
-
 
8615
      case PE:
-
 
8616
        if (value == null) {
-
 
8617
          unsetPe();
-
 
8618
        } else {
-
 
8619
          setPe((PaymentException)value);
-
 
8620
        }
-
 
8621
        break;
-
 
8622
 
-
 
8623
      }
-
 
8624
    }
-
 
8625
 
-
 
8626
    public void setFieldValue(int fieldID, Object value) {
-
 
8627
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
8628
    }
-
 
8629
 
-
 
8630
    public Object getFieldValue(_Fields field) {
-
 
8631
      switch (field) {
-
 
8632
      case SUCCESS:
-
 
8633
        return getSuccess();
-
 
8634
 
-
 
8635
      case PE:
-
 
8636
        return getPe();
-
 
8637
 
-
 
8638
      }
-
 
8639
      throw new IllegalStateException();
-
 
8640
    }
-
 
8641
 
-
 
8642
    public Object getFieldValue(int fieldId) {
-
 
8643
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
8644
    }
-
 
8645
 
-
 
8646
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
8647
    public boolean isSet(_Fields field) {
-
 
8648
      switch (field) {
-
 
8649
      case SUCCESS:
-
 
8650
        return isSetSuccess();
-
 
8651
      case PE:
-
 
8652
        return isSetPe();
-
 
8653
      }
-
 
8654
      throw new IllegalStateException();
-
 
8655
    }
-
 
8656
 
-
 
8657
    public boolean isSet(int fieldID) {
-
 
8658
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
8659
    }
-
 
8660
 
-
 
8661
    @Override
-
 
8662
    public boolean equals(Object that) {
-
 
8663
      if (that == null)
-
 
8664
        return false;
-
 
8665
      if (that instanceof updateAndCaptureEbsPayment_result)
-
 
8666
        return this.equals((updateAndCaptureEbsPayment_result)that);
-
 
8667
      return false;
-
 
8668
    }
-
 
8669
 
-
 
8670
    public boolean equals(updateAndCaptureEbsPayment_result that) {
-
 
8671
      if (that == null)
-
 
8672
        return false;
-
 
8673
 
-
 
8674
      boolean this_present_success = true && this.isSetSuccess();
-
 
8675
      boolean that_present_success = true && that.isSetSuccess();
-
 
8676
      if (this_present_success || that_present_success) {
-
 
8677
        if (!(this_present_success && that_present_success))
-
 
8678
          return false;
-
 
8679
        if (!this.success.equals(that.success))
-
 
8680
          return false;
-
 
8681
      }
-
 
8682
 
-
 
8683
      boolean this_present_pe = true && this.isSetPe();
-
 
8684
      boolean that_present_pe = true && that.isSetPe();
-
 
8685
      if (this_present_pe || that_present_pe) {
-
 
8686
        if (!(this_present_pe && that_present_pe))
-
 
8687
          return false;
-
 
8688
        if (!this.pe.equals(that.pe))
-
 
8689
          return false;
-
 
8690
      }
-
 
8691
 
-
 
8692
      return true;
-
 
8693
    }
-
 
8694
 
-
 
8695
    @Override
-
 
8696
    public int hashCode() {
-
 
8697
      return 0;
-
 
8698
    }
-
 
8699
 
-
 
8700
    public int compareTo(updateAndCaptureEbsPayment_result other) {
-
 
8701
      if (!getClass().equals(other.getClass())) {
-
 
8702
        return getClass().getName().compareTo(other.getClass().getName());
-
 
8703
      }
-
 
8704
 
-
 
8705
      int lastComparison = 0;
-
 
8706
      updateAndCaptureEbsPayment_result typedOther = (updateAndCaptureEbsPayment_result)other;
-
 
8707
 
-
 
8708
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
8709
      if (lastComparison != 0) {
-
 
8710
        return lastComparison;
-
 
8711
      }
-
 
8712
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
8713
      if (lastComparison != 0) {
-
 
8714
        return lastComparison;
-
 
8715
      }
-
 
8716
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
-
 
8717
      if (lastComparison != 0) {
-
 
8718
        return lastComparison;
-
 
8719
      }
-
 
8720
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
-
 
8721
      if (lastComparison != 0) {
-
 
8722
        return lastComparison;
-
 
8723
      }
-
 
8724
      return 0;
-
 
8725
    }
-
 
8726
 
-
 
8727
    public void read(TProtocol iprot) throws TException {
-
 
8728
      TField field;
-
 
8729
      iprot.readStructBegin();
-
 
8730
      while (true)
-
 
8731
      {
-
 
8732
        field = iprot.readFieldBegin();
-
 
8733
        if (field.type == TType.STOP) { 
-
 
8734
          break;
-
 
8735
        }
-
 
8736
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
8737
        if (fieldId == null) {
-
 
8738
          TProtocolUtil.skip(iprot, field.type);
-
 
8739
        } else {
-
 
8740
          switch (fieldId) {
-
 
8741
            case SUCCESS:
-
 
8742
              if (field.type == TType.STRUCT) {
-
 
8743
                this.success = new Payment();
-
 
8744
                this.success.read(iprot);
-
 
8745
              } else { 
-
 
8746
                TProtocolUtil.skip(iprot, field.type);
-
 
8747
              }
-
 
8748
              break;
-
 
8749
            case PE:
-
 
8750
              if (field.type == TType.STRUCT) {
-
 
8751
                this.pe = new PaymentException();
-
 
8752
                this.pe.read(iprot);
-
 
8753
              } else { 
-
 
8754
                TProtocolUtil.skip(iprot, field.type);
-
 
8755
              }
-
 
8756
              break;
-
 
8757
          }
-
 
8758
          iprot.readFieldEnd();
-
 
8759
        }
-
 
8760
      }
-
 
8761
      iprot.readStructEnd();
-
 
8762
      validate();
-
 
8763
    }
-
 
8764
 
-
 
8765
    public void write(TProtocol oprot) throws TException {
-
 
8766
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8767
 
-
 
8768
      if (this.isSetSuccess()) {
-
 
8769
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
8770
        this.success.write(oprot);
-
 
8771
        oprot.writeFieldEnd();
-
 
8772
      } else if (this.isSetPe()) {
-
 
8773
        oprot.writeFieldBegin(PE_FIELD_DESC);
-
 
8774
        this.pe.write(oprot);
-
 
8775
        oprot.writeFieldEnd();
-
 
8776
      }
-
 
8777
      oprot.writeFieldStop();
-
 
8778
      oprot.writeStructEnd();
-
 
8779
    }
-
 
8780
 
-
 
8781
    @Override
-
 
8782
    public String toString() {
-
 
8783
      StringBuilder sb = new StringBuilder("updateAndCaptureEbsPayment_result(");
-
 
8784
      boolean first = true;
-
 
8785
 
-
 
8786
      sb.append("success:");
-
 
8787
      if (this.success == null) {
-
 
8788
        sb.append("null");
-
 
8789
      } else {
-
 
8790
        sb.append(this.success);
-
 
8791
      }
-
 
8792
      first = false;
-
 
8793
      if (!first) sb.append(", ");
-
 
8794
      sb.append("pe:");
-
 
8795
      if (this.pe == null) {
-
 
8796
        sb.append("null");
-
 
8797
      } else {
-
 
8798
        sb.append(this.pe);
-
 
8799
      }
-
 
8800
      first = false;
-
 
8801
      sb.append(")");
-
 
8802
      return sb.toString();
-
 
8803
    }
-
 
8804
 
8059
 
8805
    public void validate() throws TException {
8060
    public void validate() throws TException {
8806
      // check for required fields
8061
      // check for required fields
8807
    }
8062
    }
8808
 
8063