【问题标题】:Google Checkout callback issueGoogle Checkout 回调问题
【发布时间】: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


    【解决方案1】:

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

    在谷歌卖家帐户上,我正在设置要回调的 url too

    “太” - 只是确保。只有 一个 位置可以设置 API 回调 URL - 即在您的 Account Integration Settings 中(因此没有“太”)。

    &lt;input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.continue-shopping-url" value="redirect to this url"/&gt;

    再次声明,您并不是将上述内容称为回调 api url。以上是购买后提供给买家的链接(它只是返回您网站的链接)。它不是回调 api url。

    【讨论】:

    • 不确定你是否会看到这个,但在听取了你的建议后,我发现了错误;是We encountered an error trying to access your server at .......php -- the error we got is java.io.IOException: Error 'CLOSED' connecting to url '......php 不知道为什么会这样,但会看看。谢谢
    猜你喜欢
    • 1970-01-01
    • 2023-03-24
    • 2010-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多