Skip to content

Commit

Permalink
Fixed error in data being overwritten by 2nd webhook.
Browse files Browse the repository at this point in the history
  • Loading branch information
kFrolichs committed Feb 23, 2018
1 parent bfa3408 commit f33512e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion catalog/controller/module/wuunder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
}

0 comments on commit f33512e

Please sign in to comment.