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.


UPDATE:

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.

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.

enveloppebulle avatar image
0 Likes"
enveloppebulle answered

Hello

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

· 1
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.

Hi,

Unfortunately, I haven't found a solution yet. The problem does not seem to be the code. Check the updated question.

0 Likes 0 ·
japanautoparts_de avatar image
2 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));

}

· 2
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.

Hi,

Thank you for your answer. I believe both, your code and mine are correct. The error seems to be at the time of saving the URL and Verification Token. Look at @ma-856313 comment and picture.


0 Likes 0 ·

SOLVED THE ISSUE!

My code was according to ebay documentation, icluding JSON header and endocing. But this one is NOT WORKING! Yours is!

0 Likes 0 ·
ma-856313 avatar image
0 Likes"
ma-856313 answered

The address and token have been filled in as required, but the error is still prompted all the time:

Marketplace account deletion endpoint validation failed. Click here to learn more about setting up an endpoint.

2021-07-01_092236.png

,

The address and token have been filled in as required, but the error is still prompted all the time:

Marketplace account deletion endpoint validation failed. Click here to learn more about setting up an endpoint.

2021-07-01_092236.png


· 1
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.

This is the same problem I am having. I thought it was code related, but it isn't. It happens at the time of saving the URL and Verification Token.
0 Likes 0 ·
geonik-89 avatar image
0 Likes"
geonik-89 answered

Hi I have a problem with the validation too. It is not clear when hashing what to put in the string to be hashed. I use Delphi and till now I haven't had any problems with eBay and Delphi for more than 7 years.

For example I use https://www.dancecheerskate.com:4444 as the endpoint - so is this a problem or not? Then to generate the hash should I put https://www.dancecheerskate.com:4444 or only www.dancecheerskate.com:4444? Anyway I tried also not using 4444, but just the https:// listening to port 443 and again nothing happens. Besides it seems I don't receive any GET request from eBay. So what is wrong here? If my hash is incorrect, I have to receive a GET request anyway, right?

Meanwhile I used Postman and pure Firefox browser to test the communication and all worked fine, so what I am missing here? The verification token I use is just one guid nothing more.

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.

buchhaltung_0 avatar image
0 Likes"
buchhaltung_0 answered

I have the same problem: https://forums.developer.ebay.com/questions/43107/marketplace-account-deletion-endpoint-validation-f-1.html
I think it's not the script - I can't see any request for the URL in my logs...

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.

po906188 avatar image
0 Likes"
po906188 answered

Any chance you found a solution for it?

did you contact ebay or something about this?

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.