(我是第一次海报,所以请原谅我缺乏适当的格式,如果这个问题已经以某种形式或方式回答)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