Php Google签出,数据库更新失败

Php Google签出,数据库更新失败,php,google-checkout,Php,Google Checkout,我是从google帮助下载并编辑google checkout的代码的。这里我在我的站点中指定了murchent计算url。但是该功能在我的站点中不起作用。这是我的代码 函数用例3{ //创建一个新的购物车对象 $merchant_id=xxxxxxxxxxxx;//您的商户id $merchant_key=xxxxxxxxxxxx; $server\u type=沙箱; 美元货币=美元; $cart=新谷歌购物车$merchant\u id、$merchant\u key、$server\u

我是从google帮助下载并编辑google checkout的代码的。这里我在我的站点中指定了murchent计算url。但是该功能在我的站点中不起作用。这是我的代码 函数用例3{ //创建一个新的购物车对象 $merchant_id=xxxxxxxxxxxx;//您的商户id $merchant_key=xxxxxxxxxxxx; $server\u type=沙箱; 美元货币=美元; $cart=新谷歌购物车$merchant\u id、$merchant\u key、$server\u type、$currency

// Add items to the cart
$item = new GoogleItem("MegaSound 2GB MP3 Player", 
    "Portable MP3 player - stores 500 songs", 1, 175.49);
$item->SetMerchantPrivateItemData("<color>blue</color><weight>3.2</weight>");
$cart->AddItem($item);

// Add merchant calculations options
$cart->SetMerchantCalculations(
    "https://mysite.com/google2/demo/responsehandlerdemo.php",
    "false", // merchant-calculated tax
    "true", // accept-merchant-coupons
    "true"); // accept-merchant-gift-certificates

// Add merchant-calculated-shipping option
$ship = new GoogleMerchantCalculatedShipping("2nd Day Air", // Shippping method
                                             10.00); // Default, fallback price
$restriction = new GoogleShippingFilters();
$restriction->AddAllowedPostalArea("GB");
$restriction->AddAllowedPostalArea("US");
$restriction->SetAllowUsPoBox(false);
$ship->AddShippingRestrictions($restriction);

$address_filter = new GoogleShippingFilters();
$address_filter->AddAllowedPostalArea("GB");
$address_filter->AddAllowedPostalArea("US");
$address_filter->SetAllowUsPoBox(false);
$ship->AddAddressFilters($address_filter);

$cart->AddShipping($ship);

// Set default tax options
$tax_rule = new GoogleDefaultTaxRule(0.15);
$tax_rule->SetWorldArea(true);
$cart->AddDefaultTaxRules($tax_rule);

$cart->AddRoundingPolicy("UP", "TOTAL");
  // Specify <edit-cart-url>
$cart->SetEditCartUrl("https://mysite.com/google/demo/cartdemo.php");

// Specify "Return to xyz" link
$cart->SetContinueShoppingUrl("https://mysite.com");
// Display XML data
// echo "<pre>";
// echo htmlentities($cart->GetXML());
// echo "</pre>";

// Display a disabled, small button
echo $cart->CheckoutButtonCode("SMALL");
}澄清:

商户计算URL-顾名思义,是谷歌将用于发送航运和税务、促销计算回调请求的URL。如中所述,这就是其目的。这是结账阶段的一部分,将信息发送到谷歌进行结账。 API回调URL-该URL在您的帐户集成设置中设置,与商户计算URL不同,不会在任何请求中发送,是Google将发送通知的URL,如中所述。这是您需要实现的API,以便从Google获取数据从Google获取信息-例如,在签出后 因此,这些URL/API有不同的用途

根据您的评论:

我需要执行一个php文件后,用户通过谷歌支付结帐


您需要实现通知API。商户计算url/API不是您需要的。

有错误消息吗?你说它不工作,但如何工作?没有错误消息。我调用文件中的邮件函数,我使用沙盒检查付款,付款成功完成。但我无法获得邮件。因此我假设merchent计算不工作。这个问题是由于我的SSL证书造成的吗???@Shin你设置错误模式了吗?我的实际问题不是错误报告。我需要在用户通过谷歌结账付款后执行一个php文件