Google Checkout回调问题

时间:2012-03-23 18:20:58

标签: php html e-commerce google-checkout

我正在尝试(使用沙盒帐户)使用Google Checkout销售商品。我正在向用户显示一个表单,导致立即购买按钮

<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>

在google卖家帐户中,我设置的网址也被回拨。在这个例子中,我使用谷歌文档示例中的php文件

// 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);

问题是,一旦我买了一件物品,我什么都得不回电话。没有错误信息,没有什么,所以我怎么能看到发生了什么?希望有人可以帮助我

由于

1 个答案:

答案 0 :(得分:0)

检查沙箱 Integration Console是否有错误(如果有) - 只需确保您指的是沙箱帐户(沙箱和生产帐户不同)

  

在google卖家帐户中,我设置了要回叫 的网址

“太” - 只是确定。只有一个位置,您可以在其中设置 API回调网址 - 这位于您的Account Integration Settings中(因此没有“太”)。

  

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

再次,只是澄清你没有将上述内容称为回调api url 。以上是购买后买家的链接(它只是一个链接回您的网站)。 回调api url。