Php coinbase Webhook api中的X-Cc-Webhook-Signature是什么?
我想接受使用的比特币支付。 我有。现在我想创建一个webhook来验证付款状态 我将网钩装入板条箱,如下所示()Php coinbase Webhook api中的X-Cc-Webhook-Signature是什么?,php,laravel,coinbase-api,coinbase-php,Php,Laravel,Coinbase Api,Coinbase Php,我想接受使用的比特币支付。 我有。现在我想创建一个webhook来验证付款状态 我将网钩装入板条箱,如下所示() 我尝试使用GET和POST方法调用。获取$payload和$signraturHeaderblank。它们可能是用于向您发送哈希/证书的头,这样您就可以确保在我测试表单“Webhook subscriptions()时,您收到的请求实际上来自它们,而不是其他人。”发送测试显示错误->无法在www.xxx.com@berto99上建立到远程服务器的连接您安装了吗?检查了错误日志,“未能
我尝试使用GET和POST方法调用。获取
$payload
和$signraturHeader
blank。它们可能是用于向您发送哈希/证书的头,这样您就可以确保在我测试表单“Webhook subscriptions()时,您收到的请求实际上来自它们,而不是其他人。”发送测试显示错误->无法在www.xxx.com@berto99上建立到远程服务器的连接您安装了吗?检查了错误日志,“未能在www.xxx.com上建立到远程服务器的连接”听起来好像根本无法到达您的服务器。你确定你把它上传到了某个公开的地方,没有任何访问限制吗?是@KIKOSoftware
require_once __DIR__ . "/vendor/autoload.php";
use CoinbaseCommerce\Webhook;
$secret = 'SECRET_KEY';
$headerName = 'X-Cc-Webhook-Signature';
$headers = getallheaders();
$signraturHeader = isset($headers[$headerName]) ? $headers[$headerName] : null;
$payload = trim(file_get_contents('php://input'));
try {
$event = Webhook::buildEvent($payload, $signraturHeader, $secret);
http_response_code(200);
echo sprintf('Successully verified event with id %s and type %s.', $event->id, $event->type);
} catch (\Exception $exception) {
http_response_code(400);
echo 'Error occured. ' . $exception->getMessage();
}