예제 #1
0
        public virtual Result <DisputeEvidence> AddTextEvidence(string disputeId, TextEvidenceRequest textEvidenceRequest)
        {
            NotFoundException notFoundException = new NotFoundException(String.Format("Dispute with ID '{0}' not found", disputeId));

            if (disputeId == null || disputeId.Trim().Equals(""))
            {
                throw notFoundException;
            }
            if (textEvidenceRequest.Content == null || textEvidenceRequest.Content.Trim().Equals(""))
            {
                throw new ArgumentException("Content cannot be empty");
            }

            int temp;

            if (textEvidenceRequest.SequenceNumber != null && !int.TryParse(textEvidenceRequest.SequenceNumber, out temp))
            {
                throw new ArgumentException("SequenceNumber must be an integer");
            }

            try {
                XmlNode disputeEvidenceXML = Service.Post(Service.MerchantPath() + "/disputes/" + disputeId + "/evidence", textEvidenceRequest);

                return(new ResultImpl <DisputeEvidence>(new NodeWrapper(disputeEvidenceXML), Gateway));
            } catch (NotFoundException) {
                throw notFoundException;
            }
        }
예제 #2
0
        public virtual async Task <Result <DisputeEvidence> > AddTextEvidenceAsync(string disputeId, string content)
        {
            TextEvidenceRequest textEvidenceRequest = new TextEvidenceRequest
            {
                Content = content
            };

            return(await AddTextEvidenceAsync(disputeId, textEvidenceRequest));
        }
예제 #3
0
        public virtual Result <DisputeEvidence> AddTextEvidence(string disputeId, string content)
        {
            TextEvidenceRequest textEvidenceRequest = new TextEvidenceRequest
            {
                Content = content
            };

            return(AddTextEvidence(disputeId, textEvidenceRequest));
        }