Shipment Callback Authentication Failing

0

I have a website where I've implemented the ShippingEasy PHP library to receive shipping notification via webhook. ShippingEasy is reaching the correct URL but authentication is failing. I can successfully grab the shipment JSON and parse but, of course, I want to make sure it's coming from SE. Here's my code...

<?php

require_once('/shipping-easy-php/lib/ShippingEasy.php');
ShippingEasy::setApiKey('XXXXXXXXXXXXXXXXXX');
ShippingEasy::setApiSecret('XXXXXXXXXXXXXXXX');

$theJSON = file_get_contents('php://input');
$theArray = json_decode($theJSON);
$theAuthenticator = new ShippingEasy_Authenticator('post', '/uri-of-this-page.php', $_REQUEST, $theJSON);
$isAuthenticated = $theAuthenticator->isAuthenticated();

if ($isAuthenticated) 
    {
     .... my code here...
    }

?>

I'm not understanding why the authentication is failing. The param for path, as I understand, is just the URI of the current page. Everything else seems straightforward. What am I missing?


Add a Comment

Please sign in to leave a comment.