question

sing-harv avatar image
0 Likes"
sing-harv asked

MARKETPLACE_ACCOUNT_DELETION Notifications

Hello


I received notification from eBay to enrol on MARKETPLACE_ACCOUNT_DELETION notifications. I have enrolled and started getting notifications from eBay however none of the notifications contains the JSON message that the documentation mentions I am simply getting pinged by eBay Notification service on the address without the JSON payload.


Since this is a simple JSON POST data payload, I am simply listening and extracting the all data to a file and so far there is no POST data I am receiving. Can someone please help me with this?

marketplace_account_deletionmarketplace notificationsaccount_deletion
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.

sing-harv avatar image
0 Likes"
sing-harv answered

I think it was that time of the day, I was not reading the JSON message from the payload :(


All sorted now:


$inputJSON = file_get_contents('php://input');

$input = json_decode($inputJSON, true);


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.

nishohi avatar image
0 Likes"
nishohi answered

Hello,

what code should be on this URL page? Does it need to be a blank html page or do I need some code? I've read the ebay page but couldn't find/understand what the page should be.

Thank you

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.

helios825 avatar image
0 Likes"
helios825 answered

what code should be on this URL page?

You don't need to return an HTML body or HTML code. eBay wants to see a legitimate HTTP status code returned, and that will suffice, alongside a blank page.

from the docs:

"The callback URL should immediately acknowledge each eBay marketplace account deletion/closure notification with an HTTP status code indicating a successful response. 200 OK, 201 Created, 202 Accepted, and 204 No Content are all acceptable."

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.

swappart avatar image
1 Like"
swappart answered

This is how I'm doing it. Just insert your Client ID and Client Secret. The app will check to see if a valid OAuth token exists in an ini file (they expire after 2 hours). As needed, it will retrieve a new OAuth token from eBay and update the file. Save it as notify. php, or whatever you want it named. Put it on a web server and point eBay to it. Requirements: PHP with cURL support, SSL certificate installed. I have mine on a GoDaddy shared server and other than enabling SSL, I didn't have to make any changes to the server for it to work.


Edit: I've deleted the original code because eBay changed things and it no longer worked. See link below for updated code.

https://forums.developer.ebay.com/questions/43122/working-code-marketplace-account-deletion-notifica.html

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

Thanks so much for this code snippet. For me, however, I keep failing at the first sanity check:

if (!$message) {

throw new Exception('Invalid message');

}

This occurs whether I invoke the url through a browser or through the eBay interface.

Also, what are you supposed to put in the Verification token field on the eBay interface? Any random text string? Your Client Secret? The eBay docs are not very helpful.

0 Likes 0 ·

Sorry, I never saw your comment. When I had originally put the script together, there was no verification token. All we originally needed was the endpoint url. As usual, eBay changed things and didn't bother to tell us. I've revised the script and created a new post which I've linked above.

0 Likes 0 ·
enveloppebulle avatar image
0 Likes"
enveloppebulle answered

Hello @ Swappart
I tried your code (several times) but I don't manage to make it work :(
In the Key Set config page on ebay, in "alerts & notifications" after the endpoint url, what is the token we must insert ?

With your script, I already checked that ebay was well sending any challenge code (example : ["challenge_code"]=>
string(64) "2e675095809b5be10e5b659c651067b3bf78c78328d9af561b114aad20f3aa9d") So that's ok.
Then I checked with https://reqbin.com/ if I've a good response (Status: 200 (OK) Time: 478 ms) So it's ok too.
I just copy/pasted your script (modified IDs..) in a php file and... not working :(

I checked and I don't receive any $_SERVER['HTTP_X_EBAY_SIGNATURE'] (I checked every $_SERVER passed)

Any idea ?

Thank you so much

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

Sorry, I never saw your comment. When I had originally put the script together, there was no verification token. All we originally needed was the endpoint url. As usual, eBay changed things and didn't bother to tell us. I've revised the script and created a new post which I've linked above.
0 Likes 0 ·
Just wondering if you ever got this working. I tried swappart's updated code and still have the same problem. It appears that I'm not getting the http_X_ebay signature. I just get a status 400 error.
0 Likes 0 ·
toekneetv avatar image
0 Likes"
toekneetv answered

@swappart I tried this also, I get this error:

Parse error: syntax error, unexpected 'b3c40ed0d040b898105733f3442313' (T_STRING) in /home/content/29/8978929/html/lebron/post.php on line 7

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.