diff --git a/catalog/controller/module/wuunder.php b/catalog/controller/module/wuunder.php index 219a6d0..0faeffb 100644 --- a/catalog/controller/module/wuunder.php +++ b/catalog/controller/module/wuunder.php @@ -14,9 +14,11 @@ public function webhook() $order_id = $_REQUEST['order']; $booking_token = $_REQUEST['token']; $data = json_decode(file_get_contents('php://input'), true); + if ($data['action'] === "shipment_booked") { $this->db->query("UPDATE `wuunder_shipment` SET label_id = '" . $this->db->escape($data['shipment']['id']) . "', label_url = '" . $this->db->escape($data['shipment']['label_url']) . "', label_tt_url = '" . $this->db->escape($data['shipment']['track_and_trace_url']) . "' WHERE order_id = " . $order_id . " AND booking_token = '" . $booking_token . "'"); $this->load->model("checkout/order"); $this->model_checkout_order->addOrderHistory($order_id, 3); + } } } -} \ No newline at end of file +}