question

interwatches avatar image
0 Likes"
interwatches asked ·

Computing the challengeResponse for the Marketplace Account Deletion/Closure Notification in PHP

Hello,


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)]);

and

$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.

PHPmarketplace account deletion notification endpoint
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

japanautoparts_de avatar image
0 Likes"
japanautoparts_de answered ·

It works

if(isset($_GET['challenge_code']))

{

header('Content-Type: application/json'); $d=$_GET['challenge_code'].$verificationToken.$endpointURL; $hd=array("challengeResponse"=>hash("sha256", $d));

echo(json_encode($hd));

}

·
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

enveloppebulle avatar image
0 Likes"
enveloppebulle answered ·

Hello

did you manage to find any way to make it work ?

·
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.