1

(私は初めてのポスターですので、適切なフォーマットが不足していることをご容赦ください。この質問が何らかの形または方法ですでに回答されている場合)

問題: Shopify API-新しいトランザクションの作成による注文の一部払い戻し(単に注文をキャンセルするのではなく)

理由:注文をキャンセルせずに顧客に部分的な払い戻しを行う

問題:「CreateTransaction」をshopify apiに送信する時点でクエリがクラッシュし、エラーが発生せず、tryとcatchが開始されず、shopifyへのクエリの後のコードも無視されます。

Shopify Developer API XML / JSON for Transactions: http ://api.shopify.com/transactions.html

現在SandeepsheetyのPHPAPIコードを使用しています: 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
?>
4

1 に答える 1

4

Transaction APIは、種類として「キャプチャ」のみをサポートします。サーバーは、「現在キャプチャのみがサポートされています」というテキストを含む403Forbiddenを返します。

shopify.phpはそのエラーを適切に処理してはいけませんが、それはあなたが直面している問題です。

于 2012-07-18T18:16:41.290 に答える