Reputation: 428
I'm using the eBay API and am trying to receive the following notifications:
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?
Upvotes: 2
Views: 1159
Reputation: 21
Ok, maybe i am wrong but the working code should be:
$opts = array(
'ApplicationDeliveryPreferences' => array(
'ApplicationEnable' => 'Enable',
'ApplicationURL' => 'http://my.domain/ebay_notifications.php',
),
'NotificationEnable' => array(
1 => array(
'EventType' => 'ItemSold',
'EventEnable' => 'Enable'
),
2 => array(
'EventType' => 'AskSellerQuestion',
'EventEnable' => 'Enable'
),
3 => array(
'EventType' => 'FixedPriceTransaction',
'EventEnable' => 'Enable'
)
)
);
And not as I thought:
$opts = array(
'ApplicationDeliveryPreferences' => array(
'ApplicationEnable' => 'Enable',
'ApplicationURL' => 'http://my.domain/ebay_notifications.php',
),
'UserDeliveryPreferenceArray' => array(
'NotificationEnable' => array(
1 => array(
'EventType' => 'ItemSold',
'EventEnable' => 'Enable'
),
2 => array(
'EventType' => 'EndOfAuction',
'EventEnable' => 'Enable'
),
3 => array(
'EventType' => 'FixedPriceTransaction',
'EventEnable' => 'Enable'
)
)
);
The first one seems to work well so far. The last one generates 37 errors. Thank you anyways for your huge suggestion.
Upvotes: 1
Reputation: 428
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:
'NotificationEnable' => array(
1 => array(
'EventType' => 'ItemSold',
'EventEnable' => 'Enable'
),
2 => array(
'EventType' => 'EndOfAuction',
'EventEnable' => 'Enable'
),
3 => array(
'EventType' => 'FixedPriceTransaction',
'EventEnable' => 'Enable'
)
)
Happy days.
Upvotes: 2