Exemplo n.º 1
0
        internal override CancelationResponse Cancelar(string pfx, string rfc, string password, string uuid)
        {
            CanelationResponseHandler handler = new CanelationResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                var headers = GetHeaders();
                var content = this.RequestCancelar(pfx, rfc, password, uuid);
                var proxy   = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
                return(handler.GetPostResponse(this.Url,
                                               "cfdi33/cancel/pfx", headers, content, proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Exemplo n.º 2
0
        internal override CancelationResponse Cancelar(byte[] xmlCancelation)
        {
            CanelationResponseHandler handler = new CanelationResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                var headers = GetHeaders();
                var content = RequestCancelarFile(xmlCancelation);
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                return(handler.GetPostResponse(Url,
                                               "cfdi33/cancel/xml", headers, content, proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Exemplo n.º 3
0
        internal override CancelationResponse Cancelar(string rfc, string uuid)
        {
            CanelationResponseHandler handler = new CanelationResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                HttpWebRequest request = this.RequestCancelar(rfc, uuid);
                request.ContentType   = "application/json";
                request.ContentLength = 0;
                request.Method        = WebRequestMethods.Http.Post;
                var proxy   = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort);
                var headers = GetHeaders();
                return(handler.GetPostResponse(this.Url, headers, $"cfdi33/cancel/{rfc}/{uuid}", proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }