2

eBay API を使用しており、次の通知を受信しようとしています:

  • アイテム販売
  • 定額取引
  • オークション終了

ただし、受け取る通知は「FixedPriceTransaction」だけです。

受信する通知を「設定」するために使用しているコードは、次のようになります。

    $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'
            )      
        )
    );

私が間違っていることは何か分かりますか?

4

2 に答える 2

2

私のアカウントの男子生徒のエラー.

「UserDeliveryPreferanceArray」配列には複数の配列が含まれています。

それらはすべて同じキー タイトル「NotificationEnable」を持っています。

これは、最後の 1 つ (「FixedPriceNotification」イベントを含むもの) のみが使用されることを意味します。

これを解決するには、各「通知イベント」をインデックス付き配列の一部にします。

'NotificationEnable' => array(

                1   =>  array(
                    'EventType'   => 'ItemSold',
                    'EventEnable' => 'Enable' 
                ),

                2   =>  array(
                    'EventType'   => 'EndOfAuction',
                    'EventEnable' => 'Enable' 
                ),

                3   =>  array(
                    'EventType'   => 'FixedPriceTransaction',
                    'EventEnable' => 'Enable' 
                )
            )

幸せな日々。

于 2013-09-30T11:13:59.247 に答える
1

わかりました、多分私は間違っているかもしれませんが、作業コードは次のようになります:

$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' 
            )
            
    )
);

そして、私が思ったようではありません:

$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' 
            )
        )
);

最初のものは今のところうまくいっているようです。最後の 1 つは 37 個のエラーを生成します。とにかく、あなたの大きな提案をありがとう。

于 2016-04-05T20:31:31.973 に答える