Hi,
First sorry for my English skill. I'm new member, I tried search my issue but not found anything.
I have some problems with Webhook feature. I registered an sandbox account. I tried adding a webhook (Account => Setting => Bussinue Setting => Webhook), but it didn't work as I thought.
As document: (https://developer.authorize.net/api/reference/features/webhooks.html#Verifying_the_Notification section "Payment Profile Event Payload Example"), it will return to me a payload. But look like it didn't send anything to my hook although it called my hook after I cancel a subscription payment (ARB subscription) .
On my hook, I just log $_REQUEST, $_POST (PHP language) to log file, but it's empty.
So please let me know what I'm missing in here?
Thanks & Regards.
Solved! Go to Solution.
03-31-2021 09:40 PM
Hello @trungnguyen90,
Capturing the Authorize.net webhook payload is very simple. One way, with PHP is to save the webhook event to a file:
<?php $filename = "webhook_data.txt"; $fh = fopen($filename, 'a') or die("can't open file"); $xSig =""; if (isset($_SERVER['X-ANET-Signature'])){ $xSig = $_SERVER['X-ANET-Signature']; } $input = json_decode(file_get_contents('php://input'), true); //echo json_encode($input); // Write payload contents into a text file for reference $payload = json_encode($input); //$file = fopen("webhook_data.txt","a") or die("Unable to open file!!!"); fwrite($fh, "Xsig: ".$xSig. " payload: ".$payload."\n"); fclose($fh);
04-01-2021 10:45 AM - edited 04-01-2021 10:45 AM
Hello @trungnguyen90,
Capturing the Authorize.net webhook payload is very simple. One way, with PHP is to save the webhook event to a file:
<?php $filename = "webhook_data.txt"; $fh = fopen($filename, 'a') or die("can't open file"); $xSig =""; if (isset($_SERVER['X-ANET-Signature'])){ $xSig = $_SERVER['X-ANET-Signature']; } $input = json_decode(file_get_contents('php://input'), true); //echo json_encode($input); // Write payload contents into a text file for reference $payload = json_encode($input); //$file = fopen("webhook_data.txt","a") or die("Unable to open file!!!"); fwrite($fh, "Xsig: ".$xSig. " payload: ".$payload."\n"); fclose($fh);
04-01-2021 10:45 AM - edited 04-01-2021 10:45 AM
Thank you very much. It saved my time.
I usualy use $_POST and $_REQUEST, but forget php:input, the payload is JSON format, not normal form-data render format, so that can't use $_POST in here.
Thanks for your support.
04-01-2021 08:18 PM
For High Availability and High Throughput reasons - we always return a success message with a payload of debugging information when collecting a webhook - regardless of whether there is a Zap behind the webhook or if it is paused or not. The only way to know if a URL is live is to visit the editor and look at the URL (which never changes for a Zap). There is no way to customize the response to the request you send to the Catch Hook URL, as the response is sent before the Zap triggers and runs on the webhook request.
04-06-2021 01:23 AM - edited 04-06-2021 01:24 AM