Как получить Shopify Webhook? - PullRequest
0 голосов
/ 23 января 2019

Ниже мой код.

define('SHOPIFY_APP_SECRET', 'xxxxxxxxxx');

function verify_webhook($data, $hmac_header)
{
  $calculated_hmac = base64_encode(hash_hmac('sha256', $data, SHOPIFY_APP_SECRET, true));
  return hash_equals($hmac_header, $calculated_hmac);
}


$hmac_header = $_SERVER['HTTP_X_SHOPIFY_HMAC_SHA256'];
$data = file_get_contents('php://input');
$verified = verify_webhook($data, $hmac_header);

echo "<pre>";
print_r($data);
exit;   

?>

Я зарегистрировал приложение / удаленный webhook. Так что это мой код, но я не получаю никакого ответа

...