I am trying to be compliant with the new Marketplace Account Deletion/Closure Notification, but the documentation page does not have an example in PHP for computing the challengeResponse. So I have tried a couple things, but I always get the same useless error: "Marketplace account deletion endpoint validation failed. Click here to learn more about setting up an endpoint."
This is what I have tried:
$hash = hash_init('sha256'); hash_update($hash, $_GET['challenge_code']); hash_update($hash, 'alphaNumericToken50CharactersInLength'); // Verification Token hash_update($hash, 'https://www.domain.com/account-closure-listener-endpoint-h4j8y946445544fgrt46g11'); // Notification Endpoint header('Content-Type: application/json'); echo json_encode(['challengeResponse' => hash_final($hash)]);
$hash = hash_hmac('sha256', $_GET['challenge_code'] . 'alphaNumericToken50CharactersInLength' . 'https://www.domain.com/account-closure-listener-endpoint-h4j8y946445544fgrt46g11', ''); header('Content-Type: application/json'); echo json_encode(['challengeResponse' => $hash]);
I would greatly appreciate it if someone could tell me what I am doing wrong.
The error is not code related. eBay updated the documentation and my code seems to be right. The error occurs at the moment of saving the URL and Verification Token in the eBay Alerts & Notifications control panel. It is the same error @ma-856313 is having. I thought a request was being made at the time of saving, but I started logging the requests on my endpoint and it never receives a call. There is something eBay does not like about my URL or my Verification Token, but it does not say what.