nodejs-ebay-api
nodejs-ebay-api copied to clipboard
GetNotificationPreferences doesn't properly convert xml to json
I put a breakpoint on xml-converter.js, and the xmlBody is passed in correctly, but somewhere it will drop all the notificationEnable entries
raw xml received from ebay
<?xml version="1.0" encoding="UTF-8"?>
<GetNotificationPreferencesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2016-10-03T03:22:21.880Z</Timestamp>
<Ack>Success</Ack>
<Version>967</Version>
<Build>E967_CORE_APINOTIFY_18003059_R1</Build>
<UserDeliveryPreferenceArray>
<NotificationEnable>
<EventType>EndOfAuction</EventType>
<EventEnable>Disable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>AuctionCheckoutComplete</EventType>
<EventEnable>Enable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>Feedback</EventType>
<EventEnable>Disable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>FixedPriceTransaction</EventType>
<EventEnable>Enable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>ItemListed</EventType>
<EventEnable>Disable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>MyMessagesM2MMessage</EventType>
<EventEnable>Disable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>BidReceived</EventType>
<EventEnable>Disable</EventEnable>
</NotificationEnable>
<NotificationEnable>
<EventType>FeedbackReceived</EventType>
<EventEnable>Enable</EventEnable>
</NotificationEnable>
</UserDeliveryPreferenceArray>
</GetNotificationPreferencesResponse>
after conversion
{
"$": {
"xmlns": "urn:ebay:apis:eBLBaseComponents"
},
"Timestamp": "2016-10-03T03:22:21.880Z",
"Ack": "Success",
"Version": "967",
"Build": "E967_CORE_APINOTIFY_18003059_R1",
"UserDeliveryPreferences": []
}
so looks like the culprit is inside the default json parser in json-parser.js. There's a flattening function that destroys the data inside the UserDeliveryPreferences array.
made a fix that now FINALLY gets this api call working. https://github.com/benbuckman/nodejs-ebay-api/pull/38 . hopefully the maintainer can get this in there
Also PS , if this call also doesn't work if you're in sandbox mode, go figure...... #justebaythings
{
"$": {
"xmlns": "urn:ebay:apis:eBLBaseComponents"
},
"Timestamp": "2016-10-03T03:58:53.722Z",
"Ack": "Success",
"Version": "967",
"Build": "E967_CORE_APINOTIFY_18003059_R1",
"UserDeliveryPreferences": [
{
"EventType": "EndOfAuction",
"EventEnable": "Disable"
},
{
"EventType": "AuctionCheckoutComplete",
"EventEnable": "Enable"
},
{
"EventType": "Feedback",
"EventEnable": "Disable"
},
{
"EventType": "FixedPriceTransaction",
"EventEnable": "Enable"
},
{
"EventType": "ItemListed",
"EventEnable": "Disable"
},
{
"EventType": "MyMessagesM2MMessage",
"EventEnable": "Disable"
},
{
"EventType": "BidReceived",
"EventEnable": "Disable"
},
{
"EventType": "FeedbackReceived",
"EventEnable": "Enable"
}
]
}
Thank you @1mike12 , I left some comments on the PR.
https://github.com/benbuckman/nodejs-ebay-api/pull/38