Ejemplo n.º 1
0
        public Dispute(NodeWrapper node)
        {
            Amount          = node.GetDecimal("amount");
            AmountDisputed  = node.GetDecimal("amount-disputed");
            AmountWon       = node.GetDecimal("amount-won");
            CreatedAt       = node.GetDateTime("created-at");
            DateOpened      = node.GetDateTime("date-opened");
            DateWon         = node.GetDateTime("date-won");
            ReceivedDate    = node.GetDateTime("received-date");
            ReplyByDate     = node.GetDateTime("reply-by-date");
            UpdatedAt       = node.GetDateTime("updated-at");
            Reason          = node.GetEnum("reason", DisputeReason.GENERAL);
            Status          = node.GetEnum("status", DisputeStatus.UNRECOGNIZED);
            Kind            = node.GetEnum("kind", DisputeKind.UNRECOGNIZED);
            CaseNumber      = node.GetString("case-number");
            CurrencyIsoCode = node.GetString("currency-iso-code");
            GraphQLId       = node.GetString("global-id");
            Id = node.GetString("id");
            ProcessorComments = node.GetString("processor-comments");
            MerchantAccountId = node.GetString("merchant-account-id");
            OriginalDisputeId = node.GetString("original-dispute-id");
            ReasonCode        = node.GetString("reason-code");
            ReasonDescription = node.GetString("reason-description");
            ReferenceNumber   = node.GetString("reference-number");

            if (node.GetNode("transaction") != null)
            {
                TransactionDetails = new TransactionDetails(node.GetNode("transaction"));
                Transaction        = new DisputeTransaction(node.GetNode("transaction"));
            }

            Evidence = new List <DisputeEvidence>();
            foreach (var evidenceResponse in node.GetList("evidence/evidence"))
            {
                Evidence.Add(new DisputeEvidence(evidenceResponse));
            }

            PayPalMessages = new List <DisputePayPalMessage>();
            foreach (var paypalMessageResponse in node.GetList("paypal-messages/paypal-messages"))
            {
                PayPalMessages.Add(new DisputePayPalMessage(paypalMessageResponse));
            }

            StatusHistory = new List <DisputeStatusHistory>();
            foreach (var historyStatusResponse in node.GetList("status-history/status-history"))
            {
                StatusHistory.Add(new DisputeStatusHistory(historyStatusResponse));
            }
        }
Ejemplo n.º 2
0
        public Dispute(NodeWrapper node)
        {
            Amount          = node.GetDecimal("amount");
            AmountDisputed  = node.GetDecimal("amount-disputed");
            AmountWon       = node.GetDecimal("amount-won");
            CreatedAt       = node.GetDateTime("created-at");
            DateOpened      = node.GetDateTime("date-opened");
            DateWon         = node.GetDateTime("date-won");
            ReceivedDate    = node.GetDateTime("received-date");
            ReplyByDate     = node.GetDateTime("reply-by-date");
            UpdatedAt       = node.GetDateTime("updated-at");
            Reason          = (DisputeReason)CollectionUtil.Find(DisputeReason.ALL, node.GetString("reason"), DisputeReason.GENERAL);
            Status          = (DisputeStatus)CollectionUtil.Find(DisputeStatus.ALL, node.GetString("status"), DisputeStatus.UNRECOGNIZED);
            Kind            = (DisputeKind)CollectionUtil.Find(DisputeKind.ALL, node.GetString("kind"), DisputeKind.UNRECOGNIZED);
            CaseNumber      = node.GetString("case-number");
            CurrencyIsoCode = node.GetString("currency-iso-code");
            Id = node.GetString("id");
            ForwardedComments = node.GetString("forwarded-comments");
            MerchantAccountId = node.GetString("merchant-account-id");
            OriginalDisputeId = node.GetString("original-dispute-id");
            ReasonCode        = node.GetString("reason-code");
            ReasonDescription = node.GetString("reason-description");
            ReferenceNumber   = node.GetString("reference-number");

            if (node.GetNode("transaction") != null)
            {
                TransactionDetails = new TransactionDetails(node.GetNode("transaction"));
                Transaction        = new DisputeTransaction(node.GetNode("transaction"));
            }

            Evidence = new List <DisputeEvidence>();
            foreach (var evidenceResponse in node.GetList("evidence/evidence"))
            {
                Evidence.Add(new DisputeEvidence(evidenceResponse));
            }

            StatusHistory = new List <DisputeStatusHistory>();
            foreach (var historyStatusResponse in node.GetList("status-history/status-history"))
            {
                StatusHistory.Add(new DisputeStatusHistory(historyStatusResponse));
            }
        }