Heaven Return Checkout Asp.Net

0

Good afternoon,

I'm doing the Cielo Checkout integration .. I can do the redirect to pay, just have a problem and I did not find on the internet about status change through HTTP Post and I already configured it in panel I created a method for it to send. But the Request

[HttpPost]publicvoidAlteraStatus(){try{stringurl_=Request["URL"].ToString();


            var request_ = (HttpWebRequest)WebRequest.Create(new Uri(url_));

            WebResponse response_ = request_.GetResponse();


            Stream dataStream_ = response_.GetResponseStream();

            StreamReader reader_ = new StreamReader(dataStream_);
            string responseFromServer_ = reader_.ReadToEnd();



            RetornoCieloViewModel model = new RetornoCieloViewModel
            {
                checkout_cielo_order_number = JObject.Parse(responseFromServer_).SelectToken("checkout_cielo_order_number").ToString(),
                order_number = JObject.Parse(responseFromServer_).SelectToken("order_number").ToString(),
                amount = int.Parse(JObject.Parse(responseFromServer_).SelectToken("amount").ToString()),
                created_date = JObject.Parse(responseFromServer_).SelectToken("created_date").ToString(),
                customer_name = JObject.Parse(responseFromServer_).SelectToken("customer_name").ToString(),
                customer_email = JObject.Parse(responseFromServer_).SelectToken("customer_email").ToString(),
                customer_phone = JObject.Parse(responseFromServer_).SelectToken("customer_phone").ToString(),
                customer_identity = JObject.Parse(responseFromServer_).SelectToken("customer_identity").ToString(),
                payment_method_type = int.Parse(JObject.Parse(responseFromServer_).SelectToken("payment_method_type").ToString()),
                payment_method_brand = int.Parse(JObject.Parse(responseFromServer_).SelectToken("payment_method_brand").ToString()),
                payment_method_bank = int.Parse(JObject.Parse(responseFromServer_).SelectToken("payment_method_bank").ToString()),
                payment_maskedcreditcard = JObject.Parse(responseFromServer_).SelectToken("payment_maskedcreditcard").ToString(),
                payment_installments = int.Parse(JObject.Parse(responseFromServer_).SelectToken("payment_installments").ToString()), //numero de parcelas
                payment_status = int.Parse(JObject.Parse(responseFromServer_).SelectToken("payment_status").ToString()),
                tid = JObject.Parse(responseFromServer_).SelectToken("tid").ToString()

            };

            _pagamentoCieloServiceApp.AtualizaStatus(model);

        }
        catch (Exception e)
        {
            string testes = e.Message;
        }
    
asked by anonymous 28.08.2018 / 19:08

0 answers