提问者:小点点

ShopifAPI使用PHP通过交易部分退款


(我是第一次海报,所以请原谅我没有正确的格式,如果这个问题已经以某种形式或方式得到了回答)

问题:ShopifAPI-通过创建新交易对订单进行部分退款(而不是简单地取消订单)

原因:在不取消订单的情况下给客户部分退款

问题:查询在将“创建事务”发送到ShopifAPI时崩溃,没有错误,try-and-catch没有启动,并且对shopify的查询后的代码也被忽略。

用于事务的Shopify开发者API XML/JSON:http://api.shopify.com/transactions.html

目前正在使用Sandepsheety的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
?>

共1个答案

匿名用户

事务API只支持'捕获'类。服务器正在返回403禁止,文本为“当前仅支持捕获”。

shopify.php一定没有正确处理这个错误,但这是你遇到的问题。