Data request, Cielo checkout

Asked

Viewed 299 times

0

I am having trouble receiving the data in the notification and status URL of Checkout Cielo. I am using the Codeigniter framework, and the data does not update the table.

Follow the code of my Controller Cart:

public function notify() {

    $order_number = $this->input->post('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');

    $data = array(
        '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);

    $this->load->view('store/notify');
}

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);
    $this->load->view('store/status');
}

The Notify and Status page contains the code

<status>OK</status>

Store Model

public function upMyOrders($order_number, $data) {
  $query = $this->db->where(array('order_number' => $order_number))
  ->update('tb_store_orders', $data);
  return true;
}

I tried to put the $data inside the model and also did not work.

There is no change in the database and I don’t get error message from Cielo in the email..

  • Esta linha: $myOrder = $this->store_model->upMyOrders($order_number, $data);, eu particularmente usaria: $this->store_model->upMyOrders($order_number, $data);, caso não dê certo, dê um print_r($myOrder); e veja o que retorna.

  • The problem is that these two pages, notify and status, the data comes from the Cielo API, so I don’t have access to them on the page.

No answers

Browser other questions tagged

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