I'm having trouble receiving data via POST from Cielo API. I've already talked to King Host and everything is okay with certificates and so on.
I've been browsing GitHub and found a similar topic: link
I followed the recommendations but without success, the Database does not do the Update.
I'm using the CodeIgniter 3 framework, and put the notification and status pages in the Public folder
Follow the page code
$order_number = $_POST['order_number'];
if(isset($order_number)){
//as variaveis de conexão eu escondi
$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';
?>
Does anyone have any suggestions?