I am having a problem consuming Cielo’s webservice. Cielo’s server https://ecommerce.cielo.com.br/servicos/ecommwsec.do

Asked

Viewed 147 times

1

until two weeks ago the application was working normally and then stopped working by presenting the following error: "The request was cancelled: Could not create a secure channel for SSL/TLS". I also inform that in this period there was no update in the application and that I checked the digital certificate and is also ok. I know that this particular mistake is generic and can mean a lot of things. Does anyone have any idea what it could be? follows below the part of the code where the error appears:

    try
    {
        StringBuilder xmlCielo = new StringBuilder();
        xmlCielo.Append("<?xml version='1.0' encoding='iso-8859-1' ?>");
        xmlCielo.Append("<requisicao-transacao id='" + ConfiguraceosCielo.Id_trasacao + "' versao='1.3.0'>");
        xmlCielo.Append("<dados-ec>");
        xmlCielo.Append("<numero>" + ConfiguraceosCielo.CodigoHoodid + "</numero>");
        xmlCielo.Append("<chave>" + ConfiguraceosCielo.ChaveHoodid + "</chave>");
        xmlCielo.Append("</dados-ec>");
        xmlCielo.Append("<dados-pedido>");
        xmlCielo.Append("<numero>1</numero>");
        xmlCielo.Append("<valor>" + ConfiguraceosCielo.PrecoPrdudo1 + "</valor>");
        xmlCielo.Append("<moeda>986</moeda>");
        xmlCielo.Append("<data-hora>" + ConfiguraceosCielo.Data_hora_transacao + "</data-hora>");
        xmlCielo.Append("<descricao>[origem: número_do_ip]</descricao>");
        xmlCielo.Append("<idioma>PT</idioma>");
        xmlCielo.Append("<soft-descriptor>" + "HoodID" + "</soft-descriptor>");
        xmlCielo.Append("</dados-pedido>");
        xmlCielo.Append("<forma-pagamento>");
        xmlCielo.Append("<bandeira>" + Cartao + "</bandeira>");
        xmlCielo.Append("<produto>" + ConfiguraceosCielo.Tipo_pg + "</produto>");
        xmlCielo.Append("<parcelas>1</parcelas>");
        xmlCielo.Append("</forma-pagamento>");
        xmlCielo.Append("<url-retorno>endereco_de_retorno</url-retorno>");
        xmlCielo.Append("<autorizar>" + ConfiguraceosCielo.Flagcreddeb + "</autorizar>");
        xmlCielo.Append("<capturar>true</capturar>"); // transação capturada 
        xmlCielo.Append("</requisicao-transacao>");

        var result = new WebServiceCieloRequest().Message(xmlCielo.ToString()).Response(); =>(O ERRO ACONTECE APÓS PASSAR POR ESSA LINHA)
        string rt = result.ToString();
        string RetornoXmlCodigo = rt;
        int posicao_codigo = RetornoXmlCodigo.IndexOf("<tid>");
        string Codigo = RetornoXmlCodigo.Substring(posicao_codigo + 5, 20);

        Session["CodRetornoCielo"] = Codigo;

        int posicao = rt.IndexOf("https");
        string url = rt.Substring(posicao, rt.Length - posicao);
        string novaurl = url.Replace("</url-autenticacao>", "").Trim();
        novaurl = novaurl.Replace("</transacao>", "").Trim();

        StringBuilder sbURL = new StringBuilder();

        sbURL.Append("var janela;");
        sbURL.Append("janela = window.open('" + novaurl + "','_blank'); ");
        sbURL.Append("if(janela == null){ ");
        sbURL.Append(" furl_cartao(); } ");
        sbURL.Append(" else { ");
        sbURL.Append(" furl_cartaoHb(); }");

    }
    catch (Exception Es)
    {
        msg = Es.Message.ToString();
        Session["urlcielo"] = "N";
    }

Thanks for your help.

  • If you are running on localhost with me happened the same thing !

  • About a month ago I received an email saying that support for a certain version of the API was going to end as well, from one linked in their technical support.

  • you need to contact their support

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.