示例#1
0
        public chargebackDocumentUploadResponse ReplaceDocument(long caseId, string documentId, string filePath)
        {
            var fileBytes = File.ReadAllBytes(filePath).ToList();

            try
            {
                ConfigureCommunicationForUpload(filePath);

                var responseTuple = _communication.Put(
                    ServiceRoute + "/replace/" + caseId + "/" + documentId, fileBytes);
                return(HandleResponse(responseTuple));
            }
            catch (WebException we)
            {
                throw ChargebackDocumentWebException(we, "Replace");
            }
        }
        private chargebackUpdateResponse SendUpdateRequest(long caseId, string xmlBody)
        {
            string xmlRequest = Serialize(xmlBody);

            ChargebackUtils.PrintXml(xmlRequest, Config.Get("printXml"), Config.Get("neuterXml"));
            try
            {
                ConfigureCommunication();
                var responseContent = communication.Put(ServiceRoute + "/" + caseId, ChargebackUtils.StringToBytes(xmlRequest));
                var receivedBytes   = responseContent.GetByteData();
                var xmlResponse     = ChargebackUtils.BytesToString(receivedBytes);
                ChargebackUtils.PrintXml(xmlResponse, Config.Get("printXml"), Config.Get("neuterXml"));
                return(ChargebackUtils.DeserializeResponse <chargebackUpdateResponse>(xmlResponse));
            }
            catch (WebException we)
            {
                throw ChargebackUpdateWebException(we);
            }
        }