2012-03-23 54 views
0

我想(使用沙箱帳戶)使用谷歌結賬出售物品。我顯示形式現在導致了購買按鈕谷歌結帳回調問題

<form method="POST" action="https://sandbox.google.com/checkout/api/checkout/v2/checkoutForm/Merchant/..." accept-charset="utf-8"> 
    <input type="hidden" name="item_name_1" value="Test"/> 
    <input type="hidden" name="item_description_1" value="An item "/> 
    <input type="hidden" name="item_quantity_1" value="1"/> 
    <input type="hidden" name="item_price_1" value="1.50"/> 
    <input type="hidden" name="item_currency_1" value="GBP"/>  
    <input type="hidden" name="_charset_"/> 
    <input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.continue-shopping-url" value="redirect to this url"/> 
    <input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=....&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/> 
</form> 

在谷歌賣家賬戶我設置的URL被稱爲背過的用戶。在這種情況下,我使用來自谷歌文檔例子

// Include Google Checkout PHP Client Library 
include ("GlobalAPIFunctions.php"); 

// Include Response Message Processor 
include ("ResponseHandlerAPIFunctions.php"); 

// Retrieve the XML sent in the HTTP POST request to the ResponseHandler 
$xml_response = $HTTP_RAW_POST_DATA; 

// Get rid of PHP's magical escaping of quotes 
if (get_magic_quotes_gpc()) { 
    $xml_response = stripslashes($xml_response); 
} 

// Log the XML received in the HTTP POST request 
LogMessage($GLOBALS["logfile"], $xml_response); 

/* 
* Call the ProcessXmlData function, which is defined in 
* ResponseHandlerAPIFunctions.php. The ProcessXmlData will route 
* the XML data to the function that handles the particular type 
* of XML message contained in the POST request. 
*/ 
ProcessXmlData($xml_response); 

的問題是,只要我買一個項目我沒有得到任何回撥任何PHP文件。沒有錯誤信息,沒有什麼,所以我怎麼看到發生了什麼?希望有人可以幫助我

感謝

回答

0

檢查沙盒Integration Console錯誤(如果有的話) - 只要確保你是指你的沙盒帳戶(沙箱及賬戶是不同的)

在谷歌賣家賬戶我設置的URL被稱爲回

「too」 - 只要確保。只有一個您可以在其中設置API回調URL - 這是在您的Account Integration Settings(因此沒有「太」)。

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.continue-shopping-url" value="redirect to this url"/>

再次,只是澄清,你是不是指上述爲回調API網址。以上是購買後向買家提供的鏈接(它只是一個鏈接回到您的網站)。它是而不是的回調API網址。

+0

不知道如果你最終會看到這個,但在採取你的建議後,我發現錯誤;它是'我們遇到了一個錯誤試圖訪問您的服務器....... php - 我們得到的錯誤是java.io.IOException:錯誤'CLOSED'連接到URL'...... php'不確定這是爲什麼,但會看看。謝謝 – Biscuit128 2012-03-24 08:39:58