【发布时间】:2012-03-23 18:20:58
【问题描述】:
我正在尝试(使用沙盒帐户)使用 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>
在谷歌卖家账户上,我也在设置要回调的 url。在这种情况下,我使用的是 google docs 示例中的 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);
问题是,一旦我购买了一件商品,我就没有任何回电。没有错误消息,没有什么,所以我怎么能看到发生了什么?希望有人可以帮助我
谢谢
【问题讨论】:
标签: php html e-commerce google-checkout