I’m using the eBay API and am trying to receive the following notifications:
- ItemSold
- FixedPriceTransaction
- EndOfAuction
However, the only notification I receive is ‘FixedPriceTransaction’.
The code I’m using to ‘set’ what notifications I receive, looks like this:
$opts = array(
'ApplicationDeliveryPreferences' => array(
'ApplicationEnable' => 'Enable',
'ApplicationURL' => 'http://my.domain/ebay_notifications.php',
),
'UserDeliveryPreferenceArray' => array(
'NotificationEnable' => array(
'EventType' => 'ItemSold',
'EventEnable' => 'Enable'
),
'NotificationEnable' => array(
'EventType' => 'EndOfAuction',
'EventEnable' => 'Enable'
),
'NotificationEnable' => array(
'EventType' => 'FixedPriceTransaction',
'EventEnable' => 'Enable'
)
)
);
Any idea what I’m doing wrong?
2
Answers
Schoolboy error on my account.
The 'UserDeliveryPreferanceArray' array contains multiple arrays.
All of them have the same key title: 'NotificationEnable'
This means only the last one is used - the one containing the 'FixedPriceNotification' event.
To remedy this, make each 'notification event' part of an indexed array:
Happy days.
Ok, maybe i am wrong but the working code should be:
And not as I thought:
The first one seems to work well so far. The last one generates 37 errors.
Thank you anyways for your huge suggestion.