Exemple #1
0
        public BatchSummary ResubmitTransactions(List <String> transactionTokens, String configName)
        {
            if (!ResponseCode.Equals("580"))
            {
                throw new BuilderException("Batch recovery has not been requested for this batch.");
            }

            // resubmit the tokens
            LinkedList <Transaction> responses = new LinkedList <Transaction>();

            foreach (string token in transactionTokens)
            {
                Transaction response = new ResubmitBuilder(TransactionType.DataCollect)
                                       .WithTransactionToken(token)
                                       .Execute(configName);
                responses.AddLast(response);
            }
            ResentTransactions = responses;

            // resubmit the batch summary
            Transaction batchResponse = new ResubmitBuilder(TransactionType.BatchClose)
                                        .WithTransactionToken(TransactionToken)
                                        .Execute(configName);

            ResentBatchClose = batchResponse;
            ResponseCode     = batchResponse.ResponseCode;
            return(this);
        }
        internal BaseTableServiceResponse(string json)
        {
            if (string.IsNullOrEmpty(json))
            {
                return;
            }

            var response = JsonDoc.Parse(json);

            ResponseCode = NormalizeResponse(response.GetValue <string>("code"));
            ResponseText = response.GetValue <string>("codeMsg");
            Class        = response.GetValue <string>("class");
            Action       = response.GetValue <string>("action");

            if (!ResponseCode.Equals("00"))
            {
                throw new MessageException(ResponseText);
            }

            // map response from the data rows
            if (response.Has("data"))
            {
                var data = response.Get("data");
                if (data.Has("row"))
                {
                    var row = data.Get("row");
                    MapResponse(row ?? data);
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// True iff the two objects are equal Layers.
 /// </summary>
 public bool Equals(DnsLayer other)
 {
     return(other != null &&
            Id.Equals(other.Id) &&
            IsQuery.Equals(other.IsQuery) &&
            OpCode.Equals(other.OpCode) &&
            IsAuthoritativeAnswer.Equals(other.IsAuthoritativeAnswer) &&
            IsTruncated.Equals(other.IsTruncated) &&
            IsRecursionDesired.Equals(other.IsRecursionDesired) &&
            IsRecursionAvailable.Equals(other.IsRecursionAvailable) &&
            FutureUse.Equals(other.FutureUse) &&
            IsAuthenticData.Equals(other.IsAuthenticData) &&
            IsCheckingDisabled.Equals(other.IsCheckingDisabled) &&
            ResponseCode.Equals(other.ResponseCode) &&
            (Queries.IsNullOrEmpty() && other.Queries.IsNullOrEmpty() || Queries.SequenceEqual(other.Queries)) &&
            (Answers.IsNullOrEmpty() && other.Answers.IsNullOrEmpty() || Answers.SequenceEqual(other.Answers)) &&
            (Authorities.IsNullOrEmpty() && other.Authorities.IsNullOrEmpty() || Authorities.SequenceEqual(other.Authorities)) &&
            (Additionals.IsNullOrEmpty() && other.Additionals.IsNullOrEmpty() || Additionals.SequenceEqual(other.Additionals)));
 }
        /// <summary>
        /// Returns true if PaymentResponse instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentResponse other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     ActionId == other.ActionId ||
                     ActionId != null &&
                     ActionId.Equals(other.ActionId)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     Currency == other.Currency ||
                     Currency != null &&
                     Currency.Equals(other.Currency)
                 ) &&
                 (
                     Approved == other.Approved ||
                     Approved != null &&
                     Approved.Equals(other.Approved)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     AuthCode == other.AuthCode ||
                     AuthCode != null &&
                     AuthCode.Equals(other.AuthCode)
                 ) &&
                 (
                     ResponseCode == other.ResponseCode ||
                     ResponseCode != null &&
                     ResponseCode.Equals(other.ResponseCode)
                 ) &&
                 (
                     ResponseSummary == other.ResponseSummary ||
                     ResponseSummary != null &&
                     ResponseSummary.Equals(other.ResponseSummary)
                 ) &&
                 (
                     ThreeDS == other.ThreeDS ||
                     ThreeDS != null &&
                     ThreeDS.Equals(other.ThreeDS)
                 ) &&
                 (
                     Risk == other.Risk ||
                     Risk != null &&
                     Risk.Equals(other.Risk)
                 ) &&
                 (
                     Source == other.Source ||
                     Source != null &&
                     Source.Equals(other.Source)
                 ) &&
                 (
                     Customer == other.Customer ||
                     Customer != null &&
                     Customer.Equals(other.Customer)
                 ) &&
                 (
                     ProcessedOn == other.ProcessedOn ||
                     ProcessedOn != null &&
                     ProcessedOn.Equals(other.ProcessedOn)
                 ) &&
                 (
                     Reference == other.Reference ||
                     Reference != null &&
                     Reference.Equals(other.Reference)
                 ) &&
                 (
                     Eci == other.Eci ||
                     Eci != null &&
                     Eci.Equals(other.Eci)
                 ) &&
                 (
                     SchemeId == other.SchemeId ||
                     SchemeId != null &&
                     SchemeId.Equals(other.SchemeId)
                 ) &&
                 (
                     Links == other.Links ||
                     Links != null &&
                     Links.Equals(other.Links)
                 ));
        }