I'm not too familiar with PHP but can you print directly onto the server console? My webhook logic simply looks like this: console.log(request.body);
Hi Sam,
Thanks for the reply! I don't think it's possible to instantly see a request or post that a person or program makes to a server. var_dump() is kind of like the PHP equivalent of JS's console.log(). PHP does not have the same console that JS has, but either way, I don't think it'd be possible to instantly see the post from the person or program.
header(trim("HTTP/1.1 200 SUCCESS"));
$content = json_decode(file_get_contents('php://input'),true);
Yes! That worked! Thanks, Bryanne! I haven't been using PHP for too long (about 2 years), but I've never seen that method used before. I wonder if I would've been able to figure it out, eventually.
Are you changing the quantity in the Inventory App? It should return an inventory update:
2017-06-08T22:41:41.714199+00:00 app[web.1]: {"appId":"4W4XWSS3FSVP2","merchants":{"EJE2ZH35JJAG2":[{"objectId":"I:2YJSH2SQ96G02","type":"UPDATE","ts":1496961700859}]}}
2017-06-08T22:41:41.714475+00:00 app[web.1]: I, [2017-06-08T22:41:41.714414 #4] INFO -- : [00ee00ee-00ee-00ee-00ee-df047d7b20fe] Completed 200 OK in 0ms (Views: 0.1ms)
Hi Sam,
Thanks for the reply. Yeah. That's how I'm updating the quantity (/www.clover.com/inventory/). After updating the quantity, I assumed it would send some data to my PHP file (westcoastboatzincs.com/test.php), and I also assumed I would be able to grab that data through the $_GET or $_REQUEST param, but it seems like it never contacts the PHP file.
Have you possibly set up a webhook before? Could I take a look at your code? I might just need to see an example of how to get the data. Thanks for the help!
1 Person is following this question.