I've got a webhook which sends a XML and mail after a order is paid succesfully. The payment provider (Mollie) needs to get a 200 OK response otherwise it keeps calling my webhook, which sends the XML and mail continuesly. Anyone knows what I'm doing wrong here..?
if($payment->status == 'paid') {
// Create XML file
include_once("create-xml.php");
file_put_contents("order-" . $orders[0]['id'] . ".xml",$xml);
// Send XML file
include_once("send-xml.php");
// Delete XML file
unlink("order-" . $orders[0]['id'] . ".xml");
// Send e-mail to customer
include_once("send-mail.php");
header(':', true, 200);
header('X-PHP-Response-Code: 200', true, 200);
return;
}