(我是第一次海報,所以請原諒我缺乏適當的格式,如果這個問題已經以某種形式或方式回答)Shopify API部分退款在以通過交易使用PHP
問題: Shopify API - 部分退款在訂貨物通過新交易的創建(而不是簡單地取消訂單)
原因:給客戶退還部分不取消訂單
問題:查詢在將'創建事務'發送到shopify API時發生崩潰,沒有錯誤,嘗試和捕獲不會啓動,並且查詢購物後的代碼也被忽略。
Shopify開發者API XML/JSON的交易: http://api.shopify.com/transactions.html
目前使用Sandeepsheety的PHP API代碼: https://github.com/sandeepshetty/shopify.php/blob/master/README.md
<?php
//-------------------------------------------------------------------------------
//PHP Code Begins
//NOTE: [Does return correct values for the Order through GET through id=135264996 and,
// transaction GET data is verified as well - Test Order Total = $94.50 and,
// tested a few other orders ids with the same result.]
//-------------------------------------------------------------------------------
//Does connect and I have verified with a few GETS and even a couple cancellations
$shopify = shopify_api_client($SHOPIFY_STORE_URL, NULL, $SHOPIFY_API_KEY, $SHOPIFY_TOKEN, true);
//Based on Create Transactions: (POST /admin/orders/#{id}/transactions.json)
$jsonURL= "/admin/orders/135264996/transactions.json";
$query = $shopify('POST', $jsonURL, array('kind'='refund', 'amount'=10));
//NOTHING HAPPENS and Code Stops HERE
echo "Passed"; //IGNORED
?>
你能澄清一下你的意思嗎?「嘗試和捕捉沒有啓動」?如果響應代碼> = 400,shopify.php會引發異常。您需要一個圍繞POST請求的try/catch塊,它似乎在上面的代碼片段中缺失。 – 2012-07-25 23:55:23