2013-10-21 29 views
0

在demo.php如何獲取在php中使用bigcommrece webhook更新的bigcommerce訂單?

 $url='https://hooks-beta.bigcommerce.com'; 
     $fields = array(
    "producer"=>"store/bgf5e", 
    "scope"=>"store/order/*", 
    "deliverymethod"=>"HTTP_POST", 
    "destination"=>array(
    "url"=>"http://shopifywebhook.faculty.com/demo.php" 
    ), 
); 

我得到的迴應 當我更新的大商貿的順序手動把它給下面的結果

串(160) 「{」 STORE_ID 「:481868,」 製片人「:」store/bgf5e「,」scope「:」store/product/updated「,」data「:{」type「:」product「,」id「:85},」hash「:」2ca388118ff19587b5b1ed55fd58cdb74c3186aef4「}」

這與「範圍」=>「商店/訂單/ *」 這個範圍無關,即訂單 什麼是做錯或webh ook不適用於bigcommerce? 我想響應是訂單ID和類型「訂單」,但上面可以 看到產品和Id = 85

感謝 蘭吉特Gholave

+0

任何人都可以幫助我嗎? –

回答

0

你的範圍表明您訂閱了錯誤事件:store/product/updated

使用下面的CURL調用檢查您的活動webhook並確認您具有/order/updated作用域的正確目標 - 我發現最好從具體的作用域而不是通配符開始。

curl -XGET -H 
    'X-Auth-Client: [BigCommerceAppClientId]' -H 
    'X-Auth-Token: [BigCommerceAppSecret]' 
https://hooks-beta.bigcommerce.com/producer/store/[myStoreKey] 
相關問題