Subversion Repositories SmartDukaan

Rev

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

Rev 2462 Rev 2690
Line 136... Line 136...
136
     * 
136
     * 
137
     * @param merchantPaymentId
137
     * @param merchantPaymentId
138
     */
138
     */
139
    public String initializeHdfcPayment(long merchantPaymentId) throws PaymentException, TException;
139
    public String initializeHdfcPayment(long merchantPaymentId) throws PaymentException, TException;
140
 
140
 
-
 
141
    /**
-
 
142
     * Create a refund of the given amount corresponding to the given order to be processed through the same
-
 
143
     * payment gateway which processed the payment for the corresponding transaction.
-
 
144
     * Returns the id of the newly created Refund.
-
 
145
     * 
-
 
146
     * @param orderId
-
 
147
     * @param merchantTxnId
-
 
148
     * @param amount
-
 
149
     */
-
 
150
    public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, TException;
-
 
151
 
141
  }
152
  }
142
 
153
 
143
  public static class Client implements Iface {
154
  public static class Client implements Iface {
144
    public Client(TProtocol prot)
155
    public Client(TProtocol prot)
145
    {
156
    {
Line 607... Line 618...
607
        throw result.pe;
618
        throw result.pe;
608
      }
619
      }
609
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "initializeHdfcPayment failed: unknown result");
620
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "initializeHdfcPayment failed: unknown result");
610
    }
621
    }
611
 
622
 
-
 
623
    public long createRefund(long orderId, long merchantTxnId, double amount) throws PaymentException, TException
-
 
624
    {
-
 
625
      send_createRefund(orderId, merchantTxnId, amount);
-
 
626
      return recv_createRefund();
-
 
627
    }
-
 
628
 
-
 
629
    public void send_createRefund(long orderId, long merchantTxnId, double amount) throws TException
-
 
630
    {
-
 
631
      oprot_.writeMessageBegin(new TMessage("createRefund", TMessageType.CALL, seqid_));
-
 
632
      createRefund_args args = new createRefund_args();
-
 
633
      args.orderId = orderId;
-
 
634
      args.merchantTxnId = merchantTxnId;
-
 
635
      args.amount = amount;
-
 
636
      args.write(oprot_);
-
 
637
      oprot_.writeMessageEnd();
-
 
638
      oprot_.getTransport().flush();
-
 
639
    }
-
 
640
 
-
 
641
    public long recv_createRefund() throws PaymentException, TException
-
 
642
    {
-
 
643
      TMessage msg = iprot_.readMessageBegin();
-
 
644
      if (msg.type == TMessageType.EXCEPTION) {
-
 
645
        TApplicationException x = TApplicationException.read(iprot_);
-
 
646
        iprot_.readMessageEnd();
-
 
647
        throw x;
-
 
648
      }
-
 
649
      createRefund_result result = new createRefund_result();
-
 
650
      result.read(iprot_);
-
 
651
      iprot_.readMessageEnd();
-
 
652
      if (result.isSetSuccess()) {
-
 
653
        return result.success;
-
 
654
      }
-
 
655
      if (result.pe != null) {
-
 
656
        throw result.pe;
-
 
657
      }
-
 
658
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "createRefund failed: unknown result");
-
 
659
    }
-
 
660
 
612
  }
661
  }
613
  public static class Processor implements TProcessor {
662
  public static class Processor implements TProcessor {
614
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
663
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
615
    public Processor(Iface iface)
664
    public Processor(Iface iface)
616
    {
665
    {
Line 625... Line 674...
625
      processMap_.put("updatePaymentDetails", new updatePaymentDetails());
674
      processMap_.put("updatePaymentDetails", new updatePaymentDetails());
626
      processMap_.put("getSuccessfulPaymentsAmountRange", new getSuccessfulPaymentsAmountRange());
675
      processMap_.put("getSuccessfulPaymentsAmountRange", new getSuccessfulPaymentsAmountRange());
627
      processMap_.put("updateAndCaptureEbsPayment", new updateAndCaptureEbsPayment());
676
      processMap_.put("updateAndCaptureEbsPayment", new updateAndCaptureEbsPayment());
628
      processMap_.put("captureHdfcPayment", new captureHdfcPayment());
677
      processMap_.put("captureHdfcPayment", new captureHdfcPayment());
629
      processMap_.put("initializeHdfcPayment", new initializeHdfcPayment());
678
      processMap_.put("initializeHdfcPayment", new initializeHdfcPayment());
-
 
679
      processMap_.put("createRefund", new createRefund());
630
    }
680
    }
631
 
681
 
632
    protected static interface ProcessFunction {
682
    protected static interface ProcessFunction {
633
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
683
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
634
    }
684
    }
Line 966... Line 1016...
966
        oprot.getTransport().flush();
1016
        oprot.getTransport().flush();
967
      }
1017
      }
968
 
1018
 
969
    }
1019
    }
970
 
1020
 
-
 
1021
    private class createRefund implements ProcessFunction {
-
 
1022
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
1023
      {
-
 
1024
        createRefund_args args = new createRefund_args();
-
 
1025
        args.read(iprot);
-
 
1026
        iprot.readMessageEnd();
-
 
1027
        createRefund_result result = new createRefund_result();
-
 
1028
        try {
-
 
1029
          result.success = iface_.createRefund(args.orderId, args.merchantTxnId, args.amount);
-
 
1030
          result.setSuccessIsSet(true);
-
 
1031
        } catch (PaymentException pe) {
-
 
1032
          result.pe = pe;
-
 
1033
        } catch (Throwable th) {
-
 
1034
          LOGGER.error("Internal error processing createRefund", th);
-
 
1035
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing createRefund");
-
 
1036
          oprot.writeMessageBegin(new TMessage("createRefund", TMessageType.EXCEPTION, seqid));
-
 
1037
          x.write(oprot);
-
 
1038
          oprot.writeMessageEnd();
-
 
1039
          oprot.getTransport().flush();
-
 
1040
          return;
-
 
1041
        }
-
 
1042
        oprot.writeMessageBegin(new TMessage("createRefund", TMessageType.REPLY, seqid));
-
 
1043
        result.write(oprot);
-
 
1044
        oprot.writeMessageEnd();
-
 
1045
        oprot.getTransport().flush();
-
 
1046
      }
-
 
1047
 
-
 
1048
    }
-
 
1049
 
971
  }
1050
  }
972
 
1051
 
973
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
1052
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
974
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
1053
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
975
 
1054
 
Line 10239... Line 10318...
10239
      first = false;
10318
      first = false;
10240
      if (!first) sb.append(", ");
10319
      if (!first) sb.append(", ");
10241
      sb.append("pe:");
10320
      sb.append("pe:");
10242
      if (this.pe == null) {
10321
      if (this.pe == null) {
10243
        sb.append("null");
10322
        sb.append("null");
-
 
10323
      } else {
-
 
10324
        sb.append(this.pe);
-
 
10325
      }
-
 
10326
      first = false;
-
 
10327
      sb.append(")");
-
 
10328
      return sb.toString();
-
 
10329
    }
-
 
10330
 
-
 
10331
    public void validate() throws TException {
-
 
10332
      // check for required fields
-
 
10333
    }
-
 
10334
 
-
 
10335
  }
-
 
10336
 
-
 
10337
  public static class createRefund_args implements TBase<createRefund_args._Fields>, java.io.Serializable, Cloneable, Comparable<createRefund_args>   {
-
 
10338
    private static final TStruct STRUCT_DESC = new TStruct("createRefund_args");
-
 
10339
 
-
 
10340
    private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
-
 
10341
    private static final TField MERCHANT_TXN_ID_FIELD_DESC = new TField("merchantTxnId", TType.I64, (short)2);
-
 
10342
    private static final TField AMOUNT_FIELD_DESC = new TField("amount", TType.DOUBLE, (short)3);
-
 
10343
 
-
 
10344
    private long orderId;
-
 
10345
    private long merchantTxnId;
-
 
10346
    private double amount;
-
 
10347
 
-
 
10348
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
10349
    public enum _Fields implements TFieldIdEnum {
-
 
10350
      ORDER_ID((short)1, "orderId"),
-
 
10351
      MERCHANT_TXN_ID((short)2, "merchantTxnId"),
-
 
10352
      AMOUNT((short)3, "amount");
-
 
10353
 
-
 
10354
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
10355
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
10356
 
-
 
10357
      static {
-
 
10358
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
10359
          byId.put((int)field._thriftId, field);
-
 
10360
          byName.put(field.getFieldName(), field);
-
 
10361
        }
-
 
10362
      }
-
 
10363
 
-
 
10364
      /**
-
 
10365
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
10366
       */
-
 
10367
      public static _Fields findByThriftId(int fieldId) {
-
 
10368
        return byId.get(fieldId);
-
 
10369
      }
-
 
10370
 
-
 
10371
      /**
-
 
10372
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
10373
       * if it is not found.
-
 
10374
       */
-
 
10375
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
10376
        _Fields fields = findByThriftId(fieldId);
-
 
10377
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
10378
        return fields;
-
 
10379
      }
-
 
10380
 
-
 
10381
      /**
-
 
10382
       * Find the _Fields constant that matches name, or null if its not found.
-
 
10383
       */
-
 
10384
      public static _Fields findByName(String name) {
-
 
10385
        return byName.get(name);
-
 
10386
      }
-
 
10387
 
-
 
10388
      private final short _thriftId;
-
 
10389
      private final String _fieldName;
-
 
10390
 
-
 
10391
      _Fields(short thriftId, String fieldName) {
-
 
10392
        _thriftId = thriftId;
-
 
10393
        _fieldName = fieldName;
-
 
10394
      }
-
 
10395
 
-
 
10396
      public short getThriftFieldId() {
-
 
10397
        return _thriftId;
-
 
10398
      }
-
 
10399
 
-
 
10400
      public String getFieldName() {
-
 
10401
        return _fieldName;
-
 
10402
      }
-
 
10403
    }
-
 
10404
 
-
 
10405
    // isset id assignments
-
 
10406
    private static final int __ORDERID_ISSET_ID = 0;
-
 
10407
    private static final int __MERCHANTTXNID_ISSET_ID = 1;
-
 
10408
    private static final int __AMOUNT_ISSET_ID = 2;
-
 
10409
    private BitSet __isset_bit_vector = new BitSet(3);
-
 
10410
 
-
 
10411
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
10412
      put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
-
 
10413
          new FieldValueMetaData(TType.I64)));
-
 
10414
      put(_Fields.MERCHANT_TXN_ID, new FieldMetaData("merchantTxnId", TFieldRequirementType.DEFAULT, 
-
 
10415
          new FieldValueMetaData(TType.I64)));
-
 
10416
      put(_Fields.AMOUNT, new FieldMetaData("amount", TFieldRequirementType.DEFAULT, 
-
 
10417
          new FieldValueMetaData(TType.DOUBLE)));
-
 
10418
    }});
-
 
10419
 
-
 
10420
    static {
-
 
10421
      FieldMetaData.addStructMetaDataMap(createRefund_args.class, metaDataMap);
-
 
10422
    }
-
 
10423
 
-
 
10424
    public createRefund_args() {
-
 
10425
    }
-
 
10426
 
-
 
10427
    public createRefund_args(
-
 
10428
      long orderId,
-
 
10429
      long merchantTxnId,
-
 
10430
      double amount)
-
 
10431
    {
-
 
10432
      this();
-
 
10433
      this.orderId = orderId;
-
 
10434
      setOrderIdIsSet(true);
-
 
10435
      this.merchantTxnId = merchantTxnId;
-
 
10436
      setMerchantTxnIdIsSet(true);
-
 
10437
      this.amount = amount;
-
 
10438
      setAmountIsSet(true);
-
 
10439
    }
-
 
10440
 
-
 
10441
    /**
-
 
10442
     * Performs a deep copy on <i>other</i>.
-
 
10443
     */
-
 
10444
    public createRefund_args(createRefund_args other) {
-
 
10445
      __isset_bit_vector.clear();
-
 
10446
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
10447
      this.orderId = other.orderId;
-
 
10448
      this.merchantTxnId = other.merchantTxnId;
-
 
10449
      this.amount = other.amount;
-
 
10450
    }
-
 
10451
 
-
 
10452
    public createRefund_args deepCopy() {
-
 
10453
      return new createRefund_args(this);
-
 
10454
    }
-
 
10455
 
-
 
10456
    @Deprecated
-
 
10457
    public createRefund_args clone() {
-
 
10458
      return new createRefund_args(this);
-
 
10459
    }
-
 
10460
 
-
 
10461
    public long getOrderId() {
-
 
10462
      return this.orderId;
-
 
10463
    }
-
 
10464
 
-
 
10465
    public createRefund_args setOrderId(long orderId) {
-
 
10466
      this.orderId = orderId;
-
 
10467
      setOrderIdIsSet(true);
-
 
10468
      return this;
-
 
10469
    }
-
 
10470
 
-
 
10471
    public void unsetOrderId() {
-
 
10472
      __isset_bit_vector.clear(__ORDERID_ISSET_ID);
-
 
10473
    }
-
 
10474
 
-
 
10475
    /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
-
 
10476
    public boolean isSetOrderId() {
-
 
10477
      return __isset_bit_vector.get(__ORDERID_ISSET_ID);
-
 
10478
    }
-
 
10479
 
-
 
10480
    public void setOrderIdIsSet(boolean value) {
-
 
10481
      __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
-
 
10482
    }
-
 
10483
 
-
 
10484
    public long getMerchantTxnId() {
-
 
10485
      return this.merchantTxnId;
-
 
10486
    }
-
 
10487
 
-
 
10488
    public createRefund_args setMerchantTxnId(long merchantTxnId) {
-
 
10489
      this.merchantTxnId = merchantTxnId;
-
 
10490
      setMerchantTxnIdIsSet(true);
-
 
10491
      return this;
-
 
10492
    }
-
 
10493
 
-
 
10494
    public void unsetMerchantTxnId() {
-
 
10495
      __isset_bit_vector.clear(__MERCHANTTXNID_ISSET_ID);
-
 
10496
    }
-
 
10497
 
-
 
10498
    /** Returns true if field merchantTxnId is set (has been asigned a value) and false otherwise */
-
 
10499
    public boolean isSetMerchantTxnId() {
-
 
10500
      return __isset_bit_vector.get(__MERCHANTTXNID_ISSET_ID);
-
 
10501
    }
-
 
10502
 
-
 
10503
    public void setMerchantTxnIdIsSet(boolean value) {
-
 
10504
      __isset_bit_vector.set(__MERCHANTTXNID_ISSET_ID, value);
-
 
10505
    }
-
 
10506
 
-
 
10507
    public double getAmount() {
-
 
10508
      return this.amount;
-
 
10509
    }
-
 
10510
 
-
 
10511
    public createRefund_args setAmount(double amount) {
-
 
10512
      this.amount = amount;
-
 
10513
      setAmountIsSet(true);
-
 
10514
      return this;
-
 
10515
    }
-
 
10516
 
-
 
10517
    public void unsetAmount() {
-
 
10518
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
-
 
10519
    }
-
 
10520
 
-
 
10521
    /** Returns true if field amount is set (has been asigned a value) and false otherwise */
-
 
10522
    public boolean isSetAmount() {
-
 
10523
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
-
 
10524
    }
-
 
10525
 
-
 
10526
    public void setAmountIsSet(boolean value) {
-
 
10527
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
-
 
10528
    }
-
 
10529
 
-
 
10530
    public void setFieldValue(_Fields field, Object value) {
-
 
10531
      switch (field) {
-
 
10532
      case ORDER_ID:
-
 
10533
        if (value == null) {
-
 
10534
          unsetOrderId();
-
 
10535
        } else {
-
 
10536
          setOrderId((Long)value);
-
 
10537
        }
-
 
10538
        break;
-
 
10539
 
-
 
10540
      case MERCHANT_TXN_ID:
-
 
10541
        if (value == null) {
-
 
10542
          unsetMerchantTxnId();
-
 
10543
        } else {
-
 
10544
          setMerchantTxnId((Long)value);
-
 
10545
        }
-
 
10546
        break;
-
 
10547
 
-
 
10548
      case AMOUNT:
-
 
10549
        if (value == null) {
-
 
10550
          unsetAmount();
-
 
10551
        } else {
-
 
10552
          setAmount((Double)value);
-
 
10553
        }
-
 
10554
        break;
-
 
10555
 
-
 
10556
      }
-
 
10557
    }
-
 
10558
 
-
 
10559
    public void setFieldValue(int fieldID, Object value) {
-
 
10560
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
10561
    }
-
 
10562
 
-
 
10563
    public Object getFieldValue(_Fields field) {
-
 
10564
      switch (field) {
-
 
10565
      case ORDER_ID:
-
 
10566
        return new Long(getOrderId());
-
 
10567
 
-
 
10568
      case MERCHANT_TXN_ID:
-
 
10569
        return new Long(getMerchantTxnId());
-
 
10570
 
-
 
10571
      case AMOUNT:
-
 
10572
        return new Double(getAmount());
-
 
10573
 
-
 
10574
      }
-
 
10575
      throw new IllegalStateException();
-
 
10576
    }
-
 
10577
 
-
 
10578
    public Object getFieldValue(int fieldId) {
-
 
10579
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
10580
    }
-
 
10581
 
-
 
10582
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
10583
    public boolean isSet(_Fields field) {
-
 
10584
      switch (field) {
-
 
10585
      case ORDER_ID:
-
 
10586
        return isSetOrderId();
-
 
10587
      case MERCHANT_TXN_ID:
-
 
10588
        return isSetMerchantTxnId();
-
 
10589
      case AMOUNT:
-
 
10590
        return isSetAmount();
-
 
10591
      }
-
 
10592
      throw new IllegalStateException();
-
 
10593
    }
-
 
10594
 
-
 
10595
    public boolean isSet(int fieldID) {
-
 
10596
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
10597
    }
-
 
10598
 
-
 
10599
    @Override
-
 
10600
    public boolean equals(Object that) {
-
 
10601
      if (that == null)
-
 
10602
        return false;
-
 
10603
      if (that instanceof createRefund_args)
-
 
10604
        return this.equals((createRefund_args)that);
-
 
10605
      return false;
-
 
10606
    }
-
 
10607
 
-
 
10608
    public boolean equals(createRefund_args that) {
-
 
10609
      if (that == null)
-
 
10610
        return false;
-
 
10611
 
-
 
10612
      boolean this_present_orderId = true;
-
 
10613
      boolean that_present_orderId = true;
-
 
10614
      if (this_present_orderId || that_present_orderId) {
-
 
10615
        if (!(this_present_orderId && that_present_orderId))
-
 
10616
          return false;
-
 
10617
        if (this.orderId != that.orderId)
-
 
10618
          return false;
-
 
10619
      }
-
 
10620
 
-
 
10621
      boolean this_present_merchantTxnId = true;
-
 
10622
      boolean that_present_merchantTxnId = true;
-
 
10623
      if (this_present_merchantTxnId || that_present_merchantTxnId) {
-
 
10624
        if (!(this_present_merchantTxnId && that_present_merchantTxnId))
-
 
10625
          return false;
-
 
10626
        if (this.merchantTxnId != that.merchantTxnId)
-
 
10627
          return false;
-
 
10628
      }
-
 
10629
 
-
 
10630
      boolean this_present_amount = true;
-
 
10631
      boolean that_present_amount = true;
-
 
10632
      if (this_present_amount || that_present_amount) {
-
 
10633
        if (!(this_present_amount && that_present_amount))
-
 
10634
          return false;
-
 
10635
        if (this.amount != that.amount)
-
 
10636
          return false;
-
 
10637
      }
-
 
10638
 
-
 
10639
      return true;
-
 
10640
    }
-
 
10641
 
-
 
10642
    @Override
-
 
10643
    public int hashCode() {
-
 
10644
      return 0;
-
 
10645
    }
-
 
10646
 
-
 
10647
    public int compareTo(createRefund_args other) {
-
 
10648
      if (!getClass().equals(other.getClass())) {
-
 
10649
        return getClass().getName().compareTo(other.getClass().getName());
-
 
10650
      }
-
 
10651
 
-
 
10652
      int lastComparison = 0;
-
 
10653
      createRefund_args typedOther = (createRefund_args)other;
-
 
10654
 
-
 
10655
      lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
-
 
10656
      if (lastComparison != 0) {
-
 
10657
        return lastComparison;
-
 
10658
      }
-
 
10659
      lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
-
 
10660
      if (lastComparison != 0) {
-
 
10661
        return lastComparison;
-
 
10662
      }
-
 
10663
      lastComparison = Boolean.valueOf(isSetMerchantTxnId()).compareTo(isSetMerchantTxnId());
-
 
10664
      if (lastComparison != 0) {
-
 
10665
        return lastComparison;
-
 
10666
      }
-
 
10667
      lastComparison = TBaseHelper.compareTo(merchantTxnId, typedOther.merchantTxnId);
-
 
10668
      if (lastComparison != 0) {
-
 
10669
        return lastComparison;
-
 
10670
      }
-
 
10671
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(isSetAmount());
-
 
10672
      if (lastComparison != 0) {
-
 
10673
        return lastComparison;
-
 
10674
      }
-
 
10675
      lastComparison = TBaseHelper.compareTo(amount, typedOther.amount);
-
 
10676
      if (lastComparison != 0) {
-
 
10677
        return lastComparison;
-
 
10678
      }
-
 
10679
      return 0;
-
 
10680
    }
-
 
10681
 
-
 
10682
    public void read(TProtocol iprot) throws TException {
-
 
10683
      TField field;
-
 
10684
      iprot.readStructBegin();
-
 
10685
      while (true)
-
 
10686
      {
-
 
10687
        field = iprot.readFieldBegin();
-
 
10688
        if (field.type == TType.STOP) { 
-
 
10689
          break;
-
 
10690
        }
-
 
10691
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
10692
        if (fieldId == null) {
-
 
10693
          TProtocolUtil.skip(iprot, field.type);
-
 
10694
        } else {
-
 
10695
          switch (fieldId) {
-
 
10696
            case ORDER_ID:
-
 
10697
              if (field.type == TType.I64) {
-
 
10698
                this.orderId = iprot.readI64();
-
 
10699
                setOrderIdIsSet(true);
-
 
10700
              } else { 
-
 
10701
                TProtocolUtil.skip(iprot, field.type);
-
 
10702
              }
-
 
10703
              break;
-
 
10704
            case MERCHANT_TXN_ID:
-
 
10705
              if (field.type == TType.I64) {
-
 
10706
                this.merchantTxnId = iprot.readI64();
-
 
10707
                setMerchantTxnIdIsSet(true);
-
 
10708
              } else { 
-
 
10709
                TProtocolUtil.skip(iprot, field.type);
-
 
10710
              }
-
 
10711
              break;
-
 
10712
            case AMOUNT:
-
 
10713
              if (field.type == TType.DOUBLE) {
-
 
10714
                this.amount = iprot.readDouble();
-
 
10715
                setAmountIsSet(true);
-
 
10716
              } else { 
-
 
10717
                TProtocolUtil.skip(iprot, field.type);
-
 
10718
              }
-
 
10719
              break;
-
 
10720
          }
-
 
10721
          iprot.readFieldEnd();
-
 
10722
        }
-
 
10723
      }
-
 
10724
      iprot.readStructEnd();
-
 
10725
      validate();
-
 
10726
    }
-
 
10727
 
-
 
10728
    public void write(TProtocol oprot) throws TException {
-
 
10729
      validate();
-
 
10730
 
-
 
10731
      oprot.writeStructBegin(STRUCT_DESC);
-
 
10732
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
-
 
10733
      oprot.writeI64(this.orderId);
-
 
10734
      oprot.writeFieldEnd();
-
 
10735
      oprot.writeFieldBegin(MERCHANT_TXN_ID_FIELD_DESC);
-
 
10736
      oprot.writeI64(this.merchantTxnId);
-
 
10737
      oprot.writeFieldEnd();
-
 
10738
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
-
 
10739
      oprot.writeDouble(this.amount);
-
 
10740
      oprot.writeFieldEnd();
-
 
10741
      oprot.writeFieldStop();
-
 
10742
      oprot.writeStructEnd();
-
 
10743
    }
-
 
10744
 
-
 
10745
    @Override
-
 
10746
    public String toString() {
-
 
10747
      StringBuilder sb = new StringBuilder("createRefund_args(");
-
 
10748
      boolean first = true;
-
 
10749
 
-
 
10750
      sb.append("orderId:");
-
 
10751
      sb.append(this.orderId);
-
 
10752
      first = false;
-
 
10753
      if (!first) sb.append(", ");
-
 
10754
      sb.append("merchantTxnId:");
-
 
10755
      sb.append(this.merchantTxnId);
-
 
10756
      first = false;
-
 
10757
      if (!first) sb.append(", ");
-
 
10758
      sb.append("amount:");
-
 
10759
      sb.append(this.amount);
-
 
10760
      first = false;
-
 
10761
      sb.append(")");
-
 
10762
      return sb.toString();
-
 
10763
    }
-
 
10764
 
-
 
10765
    public void validate() throws TException {
-
 
10766
      // check for required fields
-
 
10767
    }
-
 
10768
 
-
 
10769
  }
-
 
10770
 
-
 
10771
  public static class createRefund_result implements TBase<createRefund_result._Fields>, java.io.Serializable, Cloneable, Comparable<createRefund_result>   {
-
 
10772
    private static final TStruct STRUCT_DESC = new TStruct("createRefund_result");
-
 
10773
 
-
 
10774
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
-
 
10775
    private static final TField PE_FIELD_DESC = new TField("pe", TType.STRUCT, (short)1);
-
 
10776
 
-
 
10777
    private long success;
-
 
10778
    private PaymentException pe;
-
 
10779
 
-
 
10780
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
10781
    public enum _Fields implements TFieldIdEnum {
-
 
10782
      SUCCESS((short)0, "success"),
-
 
10783
      PE((short)1, "pe");
-
 
10784
 
-
 
10785
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
10786
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
10787
 
-
 
10788
      static {
-
 
10789
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
10790
          byId.put((int)field._thriftId, field);
-
 
10791
          byName.put(field.getFieldName(), field);
-
 
10792
        }
-
 
10793
      }
-
 
10794
 
-
 
10795
      /**
-
 
10796
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
10797
       */
-
 
10798
      public static _Fields findByThriftId(int fieldId) {
-
 
10799
        return byId.get(fieldId);
-
 
10800
      }
-
 
10801
 
-
 
10802
      /**
-
 
10803
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
10804
       * if it is not found.
-
 
10805
       */
-
 
10806
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
10807
        _Fields fields = findByThriftId(fieldId);
-
 
10808
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
10809
        return fields;
-
 
10810
      }
-
 
10811
 
-
 
10812
      /**
-
 
10813
       * Find the _Fields constant that matches name, or null if its not found.
-
 
10814
       */
-
 
10815
      public static _Fields findByName(String name) {
-
 
10816
        return byName.get(name);
-
 
10817
      }
-
 
10818
 
-
 
10819
      private final short _thriftId;
-
 
10820
      private final String _fieldName;
-
 
10821
 
-
 
10822
      _Fields(short thriftId, String fieldName) {
-
 
10823
        _thriftId = thriftId;
-
 
10824
        _fieldName = fieldName;
-
 
10825
      }
-
 
10826
 
-
 
10827
      public short getThriftFieldId() {
-
 
10828
        return _thriftId;
-
 
10829
      }
-
 
10830
 
-
 
10831
      public String getFieldName() {
-
 
10832
        return _fieldName;
-
 
10833
      }
-
 
10834
    }
-
 
10835
 
-
 
10836
    // isset id assignments
-
 
10837
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
10838
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
10839
 
-
 
10840
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
10841
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
10842
          new FieldValueMetaData(TType.I64)));
-
 
10843
      put(_Fields.PE, new FieldMetaData("pe", TFieldRequirementType.DEFAULT, 
-
 
10844
          new FieldValueMetaData(TType.STRUCT)));
-
 
10845
    }});
-
 
10846
 
-
 
10847
    static {
-
 
10848
      FieldMetaData.addStructMetaDataMap(createRefund_result.class, metaDataMap);
-
 
10849
    }
-
 
10850
 
-
 
10851
    public createRefund_result() {
-
 
10852
    }
-
 
10853
 
-
 
10854
    public createRefund_result(
-
 
10855
      long success,
-
 
10856
      PaymentException pe)
-
 
10857
    {
-
 
10858
      this();
-
 
10859
      this.success = success;
-
 
10860
      setSuccessIsSet(true);
-
 
10861
      this.pe = pe;
-
 
10862
    }
-
 
10863
 
-
 
10864
    /**
-
 
10865
     * Performs a deep copy on <i>other</i>.
-
 
10866
     */
-
 
10867
    public createRefund_result(createRefund_result other) {
-
 
10868
      __isset_bit_vector.clear();
-
 
10869
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
10870
      this.success = other.success;
-
 
10871
      if (other.isSetPe()) {
-
 
10872
        this.pe = new PaymentException(other.pe);
-
 
10873
      }
-
 
10874
    }
-
 
10875
 
-
 
10876
    public createRefund_result deepCopy() {
-
 
10877
      return new createRefund_result(this);
-
 
10878
    }
-
 
10879
 
-
 
10880
    @Deprecated
-
 
10881
    public createRefund_result clone() {
-
 
10882
      return new createRefund_result(this);
-
 
10883
    }
-
 
10884
 
-
 
10885
    public long getSuccess() {
-
 
10886
      return this.success;
-
 
10887
    }
-
 
10888
 
-
 
10889
    public createRefund_result setSuccess(long success) {
-
 
10890
      this.success = success;
-
 
10891
      setSuccessIsSet(true);
-
 
10892
      return this;
-
 
10893
    }
-
 
10894
 
-
 
10895
    public void unsetSuccess() {
-
 
10896
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
-
 
10897
    }
-
 
10898
 
-
 
10899
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
10900
    public boolean isSetSuccess() {
-
 
10901
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
-
 
10902
    }
-
 
10903
 
-
 
10904
    public void setSuccessIsSet(boolean value) {
-
 
10905
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
-
 
10906
    }
-
 
10907
 
-
 
10908
    public PaymentException getPe() {
-
 
10909
      return this.pe;
-
 
10910
    }
-
 
10911
 
-
 
10912
    public createRefund_result setPe(PaymentException pe) {
-
 
10913
      this.pe = pe;
-
 
10914
      return this;
-
 
10915
    }
-
 
10916
 
-
 
10917
    public void unsetPe() {
-
 
10918
      this.pe = null;
-
 
10919
    }
-
 
10920
 
-
 
10921
    /** Returns true if field pe is set (has been asigned a value) and false otherwise */
-
 
10922
    public boolean isSetPe() {
-
 
10923
      return this.pe != null;
-
 
10924
    }
-
 
10925
 
-
 
10926
    public void setPeIsSet(boolean value) {
-
 
10927
      if (!value) {
-
 
10928
        this.pe = null;
-
 
10929
      }
-
 
10930
    }
-
 
10931
 
-
 
10932
    public void setFieldValue(_Fields field, Object value) {
-
 
10933
      switch (field) {
-
 
10934
      case SUCCESS:
-
 
10935
        if (value == null) {
-
 
10936
          unsetSuccess();
-
 
10937
        } else {
-
 
10938
          setSuccess((Long)value);
-
 
10939
        }
-
 
10940
        break;
-
 
10941
 
-
 
10942
      case PE:
-
 
10943
        if (value == null) {
-
 
10944
          unsetPe();
-
 
10945
        } else {
-
 
10946
          setPe((PaymentException)value);
-
 
10947
        }
-
 
10948
        break;
-
 
10949
 
-
 
10950
      }
-
 
10951
    }
-
 
10952
 
-
 
10953
    public void setFieldValue(int fieldID, Object value) {
-
 
10954
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
10955
    }
-
 
10956
 
-
 
10957
    public Object getFieldValue(_Fields field) {
-
 
10958
      switch (field) {
-
 
10959
      case SUCCESS:
-
 
10960
        return new Long(getSuccess());
-
 
10961
 
-
 
10962
      case PE:
-
 
10963
        return getPe();
-
 
10964
 
-
 
10965
      }
-
 
10966
      throw new IllegalStateException();
-
 
10967
    }
-
 
10968
 
-
 
10969
    public Object getFieldValue(int fieldId) {
-
 
10970
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
10971
    }
-
 
10972
 
-
 
10973
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
10974
    public boolean isSet(_Fields field) {
-
 
10975
      switch (field) {
-
 
10976
      case SUCCESS:
-
 
10977
        return isSetSuccess();
-
 
10978
      case PE:
-
 
10979
        return isSetPe();
-
 
10980
      }
-
 
10981
      throw new IllegalStateException();
-
 
10982
    }
-
 
10983
 
-
 
10984
    public boolean isSet(int fieldID) {
-
 
10985
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
10986
    }
-
 
10987
 
-
 
10988
    @Override
-
 
10989
    public boolean equals(Object that) {
-
 
10990
      if (that == null)
-
 
10991
        return false;
-
 
10992
      if (that instanceof createRefund_result)
-
 
10993
        return this.equals((createRefund_result)that);
-
 
10994
      return false;
-
 
10995
    }
-
 
10996
 
-
 
10997
    public boolean equals(createRefund_result that) {
-
 
10998
      if (that == null)
-
 
10999
        return false;
-
 
11000
 
-
 
11001
      boolean this_present_success = true;
-
 
11002
      boolean that_present_success = true;
-
 
11003
      if (this_present_success || that_present_success) {
-
 
11004
        if (!(this_present_success && that_present_success))
-
 
11005
          return false;
-
 
11006
        if (this.success != that.success)
-
 
11007
          return false;
-
 
11008
      }
-
 
11009
 
-
 
11010
      boolean this_present_pe = true && this.isSetPe();
-
 
11011
      boolean that_present_pe = true && that.isSetPe();
-
 
11012
      if (this_present_pe || that_present_pe) {
-
 
11013
        if (!(this_present_pe && that_present_pe))
-
 
11014
          return false;
-
 
11015
        if (!this.pe.equals(that.pe))
-
 
11016
          return false;
-
 
11017
      }
-
 
11018
 
-
 
11019
      return true;
-
 
11020
    }
-
 
11021
 
-
 
11022
    @Override
-
 
11023
    public int hashCode() {
-
 
11024
      return 0;
-
 
11025
    }
-
 
11026
 
-
 
11027
    public int compareTo(createRefund_result other) {
-
 
11028
      if (!getClass().equals(other.getClass())) {
-
 
11029
        return getClass().getName().compareTo(other.getClass().getName());
-
 
11030
      }
-
 
11031
 
-
 
11032
      int lastComparison = 0;
-
 
11033
      createRefund_result typedOther = (createRefund_result)other;
-
 
11034
 
-
 
11035
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
11036
      if (lastComparison != 0) {
-
 
11037
        return lastComparison;
-
 
11038
      }
-
 
11039
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
11040
      if (lastComparison != 0) {
-
 
11041
        return lastComparison;
-
 
11042
      }
-
 
11043
      lastComparison = Boolean.valueOf(isSetPe()).compareTo(isSetPe());
-
 
11044
      if (lastComparison != 0) {
-
 
11045
        return lastComparison;
-
 
11046
      }
-
 
11047
      lastComparison = TBaseHelper.compareTo(pe, typedOther.pe);
-
 
11048
      if (lastComparison != 0) {
-
 
11049
        return lastComparison;
-
 
11050
      }
-
 
11051
      return 0;
-
 
11052
    }
-
 
11053
 
-
 
11054
    public void read(TProtocol iprot) throws TException {
-
 
11055
      TField field;
-
 
11056
      iprot.readStructBegin();
-
 
11057
      while (true)
-
 
11058
      {
-
 
11059
        field = iprot.readFieldBegin();
-
 
11060
        if (field.type == TType.STOP) { 
-
 
11061
          break;
-
 
11062
        }
-
 
11063
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
11064
        if (fieldId == null) {
-
 
11065
          TProtocolUtil.skip(iprot, field.type);
-
 
11066
        } else {
-
 
11067
          switch (fieldId) {
-
 
11068
            case SUCCESS:
-
 
11069
              if (field.type == TType.I64) {
-
 
11070
                this.success = iprot.readI64();
-
 
11071
                setSuccessIsSet(true);
-
 
11072
              } else { 
-
 
11073
                TProtocolUtil.skip(iprot, field.type);
-
 
11074
              }
-
 
11075
              break;
-
 
11076
            case PE:
-
 
11077
              if (field.type == TType.STRUCT) {
-
 
11078
                this.pe = new PaymentException();
-
 
11079
                this.pe.read(iprot);
-
 
11080
              } else { 
-
 
11081
                TProtocolUtil.skip(iprot, field.type);
-
 
11082
              }
-
 
11083
              break;
-
 
11084
          }
-
 
11085
          iprot.readFieldEnd();
-
 
11086
        }
-
 
11087
      }
-
 
11088
      iprot.readStructEnd();
-
 
11089
      validate();
-
 
11090
    }
-
 
11091
 
-
 
11092
    public void write(TProtocol oprot) throws TException {
-
 
11093
      oprot.writeStructBegin(STRUCT_DESC);
-
 
11094
 
-
 
11095
      if (this.isSetSuccess()) {
-
 
11096
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
11097
        oprot.writeI64(this.success);
-
 
11098
        oprot.writeFieldEnd();
-
 
11099
      } else if (this.isSetPe()) {
-
 
11100
        oprot.writeFieldBegin(PE_FIELD_DESC);
-
 
11101
        this.pe.write(oprot);
-
 
11102
        oprot.writeFieldEnd();
-
 
11103
      }
-
 
11104
      oprot.writeFieldStop();
-
 
11105
      oprot.writeStructEnd();
-
 
11106
    }
-
 
11107
 
-
 
11108
    @Override
-
 
11109
    public String toString() {
-
 
11110
      StringBuilder sb = new StringBuilder("createRefund_result(");
-
 
11111
      boolean first = true;
-
 
11112
 
-
 
11113
      sb.append("success:");
-
 
11114
      sb.append(this.success);
-
 
11115
      first = false;
-
 
11116
      if (!first) sb.append(", ");
-
 
11117
      sb.append("pe:");
-
 
11118
      if (this.pe == null) {
-
 
11119
        sb.append("null");
10244
      } else {
11120
      } else {
10245
        sb.append(this.pe);
11121
        sb.append(this.pe);
10246
      }
11122
      }
10247
      first = false;
11123
      first = false;
10248
      sb.append(")");
11124
      sb.append(")");