cancel
Showing results for 
Search instead for 
Did you mean: 

sandbox webhook issues

I have several custom wordpress endpoints https://devjesse.gettveverywhere.com/wp-json/authorizenet/

However, if i setup an inactive webhook on authorizenet and use the online test webhook button i receive the following error: 

 

Error: The ping operation failed. This could be due to connectivity issues, invalid url or server downtime. Check the url details for the webhook and try again.

 

Using a php curl script i can get the current webhooks:

 

[
  {
    "_links": {
      "self": {
        "href": "/rest/v1/webhooks/b8f7a92b-3d14-45d0-897f-95271faaf44b"
      }
    },
    "webhookId": "b8f7a92b-3d14-45d0-897f-95271faaf44b",
    "name": "dev_sub",
    "status": "inactive",
    "url": "https://devjesse.gettveverywhere.com/wp-json/authorizenet/subscription",
    "eventTypes": [
      "net.authorize.customer.subscription.updated",
      "net.authorize.customer.subscription.created",
      "net.authorize.customer.subscription.expiring",
      "net.authorize.customer.subscription.suspended",
      "net.authorize.customer.subscription.cancelled",
      "net.authorize.customer.subscription.terminated"
    ]
  }
]

and when calling the ping with my php curl script:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://apitest.authorize.net/rest/v1/webhooks/b8f7a92b-3d14-45d0-897f-95271faaf44b/pings');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Authorization: Basic ' . base64_encode(API_LOGIN_ID . ':' . TRANSACTION_KEY),
    'Content-Type: application/json'
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

curl_close($ch);

echo $response;

i receive the following error:

{
  "status": 500,
  "reason": "PING_FAILED",
  "message": "The ping operation failed. This could be due to connectivity issues, invalid url or server downtime. Check the url details for the webhook and try again.",
  "correlationId": "5003a88f-4a1f-4c77-b374-84bdc1256082"
}

I am unsure why authorizenet webhook is failing here. The endpoint works if i use my own php curl script with a copy of the notification info:

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://devjesse.gettveverywhere.com/wp-json/authorizenet/customer');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: 410',
    'X-Opnet-Transaction-Trace: 676a6e12-d5d2-4f72-b14f-fac44a714d87-15432-570877 Expect 100-continue',
    'X-Anet-Signature: sha512=5860384727AC755D0AAFB387EB775F1436C409E2F2BF38C6ED08717399A23FB1275A2363DC16A35A89E5541DBB3CED599A515A2165AA02EFB54596BD920ECA93'
));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"notificationId":"365a8c21-088e-4303-a11a-6d3d827cc9a4","eventType":"net.authorize.customer.created","eventDate":"2019-07-02T16:27:41.5972635Z","webhookId":"5be521cb-5805-4b25-9952-1fb661c70e71","payload":{"paymentProfiles":[{"customerType":"individual","id":"1507794447"}],"merchantCustomerId":"2200","description":"Profile created by Subscription: 5869582","entityName":"customerProfile","id":"1508341513"}}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

curl_close($ch);

echo $response;

 

10 REPLIES 10

@jessequinn2019

You set up your web app and run transactions using your sandbox credentials. You run transactions just as a customer would. Your transactions will trigger webhook events and a webhook will be sent for each. So set up your sandbox interface fraud settings how you want, and then deliberately run transactions that get flagged.