-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebhook.php
27 lines (22 loc) · 985 Bytes
/
webhook.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* setting webhook url https://my.trackingmore.com/webhook_setting.php
* Documentation url https://www.trackingmore.com/webhook.html
*/
# Introduce file class auto loading
if (!defined("TRACKING_AUTOLOADER_PATH"))
{
define("TRACKING_AUTOLOADER_PATH", __DIR__);
}
require_once(__DIR__ ."/Autoloader.php");
use Tracking\Webhook;
# If you need a data signature to verify whether the source of the data comes from an account of trackingmore, please fill in your account login mailbox. If the verification fails, it will intercept the data
$verifyEmail = "";
$webhook = new Webhook();
# Get webhook content
$response = $webhook->get($verifyEmail);
# Write the push content to the log file, note: read and write permissions are required
file_put_contents(__DIR__."/webhook.txt",$response."\r\n",FILE_APPEND);
# If you pass the data review logic and return a 200 status code, here is just a simple example
if(!empty($response)) echo "200";
exit;