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.