Jump to content

ximnes

Members
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

0 Comum

About ximnes

  1. ximnes

    Problemas no recebimento POST Checkout Cielo.

    A Cielo me mandou um E-mail avisando que se estiver no modo de teste, as urls de notificação e status não vão funcionar, Então eu desativei o modo teste, porém o problema continua. Nenhum dado muda no banco de dados. Fiz uma página notify.php e botei na pasta public: $order_number = $_POST['order_number']; if(isset($order_number)){$host = "host";$dbname = "bd";$userdb = "user";$user_pass = "pass";$pdo = new PDO("mysql:host=$host; dbname=$dbname", $userdb, $userpass);$pdo->exec("SET CHARACTER SET utf8"); // Sets encoding UTF-8$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);$sql = 'UPDATE `tb_store_orders` SET `details_ship` = :details_ship, `order_shipping` = :price_ship, `order_status` = :order_status, `order_tid` = :order_tid WHERE `order_number` = :order_number'; $mod_ship = $_POST['shipping_type']; $name_ship = $_POST['shipping_name']; $price_ship = $_POST['shipping_price']; $cep_ship = $_POST['shipping_adress_zipcode']; $dist_ship = $_POST['shipping_adress_district']; $city_ship = $_POST['shipping_adress_city']; $state_ship = $_POST['shipping_state']; $adre_ship1 = $_POST['shipping_adress_line1']; $adre_ship2 = $_POST['shipping_adress_line2']; $number_ship = $_POST['shipping_adress_number']; $details_ship = $mod_ship.'<br>'. $name_ship.'<br>'. $price_ship.'<br>'. $cep_ship.'<br>'. $state_ship.'<br>'. $city_ship.'<br>'. $adre_ship1.', '.$number_ship.', '.$adre_ship2.', '.$dist_ship; $order_status = $_POST['payment_status']; $order_tid = $_POST['tid']; $statement = $pdo->prepare($sql); $statement->bindValue(":details_ship", $details_ship); $statement->bindValue(":price_ship", $price_ship); $statement->bindValue(":order_status", $order_status); $statement->bindValue(":order_tid", $order_tid); $statement->bindValue(":order_number", $order_number); $count = $statement->execute(); $pdo = null; echo '<status>OK</status>'; } echo 'Nenhum'; botei a url no backoffice para apontar pra lá, porém continua sem mudar o BD Lembrando que não tenho como ver essa página por que não estarei enviando post nenhum para ela, recebo os $_POST da API da Cielo desde já agradeço
  2. Boa noite a todos. Resolvendo problemas, e vindo com mais problemas rs. Fiz a integração com a Cielo, porém agora estou com problemas no recebimento dos dados do pedido via POST que eles mandam na página de Notificação e Mudança de Status. Estou usando o framework CodeIgniter. Recebo E-mail deles com os seguintes dados. Assunto: Checkout Cielo - Falha na tentativa de envio do POST de mudança de status Falha na tentativa de envio do POST de mudança de status [https://cieloecommerce.cielo.com.br] Dados do pedido Número do pedido 15b29d12c3a24f9a9008c5ce2ad6edd6 URL de mudança de status http://tests.mubrecords.com/store/status/ Código de status HTTP 404 Conteúdo do Post checkout_cielo_order_number 15b29d12c3a24f9a9008c5ce2ad6edd6 amount 8480 order_number 2c25c2b684564bc2c3253cb68f862362 payment_status 3 Meu Route.php $route['store/notify'] = 'cart/notify/'; $route['store/status'] = 'cart/status/'; E no controller Cart.php public function notify(){ $order_number = $this->input->post('order_number'); if(isset($order_number)){ $mod_ship = $this->input->post('shipping_type'); $name_ship = $this->input->post('shipping_name'); $price_ship = $this->input->post('shipping_price'); $cep_ship = $this->input->post('shipping_adress_zipcode'); $dist_ship = $this->input->post('shipping_adress_district'); $city_ship = $this->input->post('shipping_adress_city'); $state_ship = $this->input->post('shipping_state'); $adre_ship1 = $this->input->post('shipping_adress_line1'); $adre_ship2 = $this->input->post('shipping_adress_line2'); $number_ship = $this->input->post('shipping_adress_number'); $details_ship = $mod_ship.'<br>'. $name_ship.'<br>'. $price_ship.'<br>'. $cep_ship.'<br>'. $state_ship.'<br>'. $city_ship.'<br>'. $adre_ship1.', '.$number_ship.', '.$adre_ship2.', '.$dist_ship; $valor_total_cf = $valor_total + $price_ship; $data = array( 'details_ship' => $details_ship, 'order_price' => $valor_total_cf, 'order_shipping' => $price_ship, 'order_status' => $this->input->post('payment_status'), 'order_tid' => $this->input->post('tid') ); $myOrder = $this->store_model->upMyOrders($order_number, $data); echo '<status>OK</status>'; $this->load->view('store/notify'); } else { redirect(base_url()); } } public function status(){ $order_number = $this->input->post('order_number'); $data = array( 'order_status' => $this->input->post('payment_status'), ); $myOrder = $this->store_model->upMyOrders($order_number, $data); echo '<status>OK</status>'; $this->load->view('store/status'); } E o Store_model.php public function upMyOrders($order_number, $data){ $query = $this->db->where(array('order_number' => $order_number)) ->update('tb_store_orders', $data); return true; } Tem algo de errado? Alguém pra dar uma luz?
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.