Exemplo n.º 1
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);
                return(handler.GetResponse(request));
            }
            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();
                HttpWebRequest request = RequestCancelar(xmlCancelation);

                return(handler.GetResponse(request));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Exemplo n.º 3
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.º 4
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.º 5
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));
            }
        }
Exemplo n.º 6
0
 /// <summary>
 /// This Service is Not Implemented
 /// </summary>
 /// <param name="url"></param>
 /// <param name="token"></param>
 public Cancelation(string url, string token, int proxyPort = 0, string proxy = null) : base(url, token, proxy, proxyPort)
 {
     _handler = new CanelationResponseHandler();
 }
Exemplo n.º 7
0
 /// <summary>
 /// This Service is Not Implemented
 /// </summary>
 /// <param name="url"></param>
 /// <param name="user"></param>
 /// <param name="password"></param>
 public Cancelation(string url, string user, string password, int proxyPort = 0, string proxy = null) : base(url, user, password, proxy, proxyPort)
 {
     _handler = new CanelationResponseHandler();
 }