0

我正在尝试将 Google Checkout 集成到我的 asp.net MVC(C#) 应用程序中。我正在尝试实现类似于 PayPal Express Checkout 的 Google Checkout。IE

  1. 选购产品
  2. 获取授权令牌(通过登录 Google Checkout)并重定向到我的网站
  3. 使用从上一步获得的令牌从我的站点处理(收费)客户的帐户。

这将避免使用通知过程。是否可以使用 Google Checkout 实现相同的功能?请建议

4

2 回答 2

0

就像任何 API 一样,您必须相应地实现。

  • Google Checkout/钱包中没有(自动)重定向会以某种方式为您提供订单数据
  • 与 Google Checkout API 的数据交换实际上是通过通知,它不是(浏览器/客户端)结帐流程的一部分(单独的过程 - 在 Paypal 中,这类似于IPN

从技术上讲,您可以使用Notification History APIcharge那些Chargeable.

于 2013-02-20T14:26:50.443 回答
0

我终于通过使用 Google CheckOut 的 ParameterizedUrl 解决了这个问题。我这样做如下:

GCheckout.Checkout.ShoppingCartItem shoppingCartItem = new GCheckout.Checkout.ShoppingCartItem();
    shoppingCartItem.Description = "Google Checkout Item";
    shoppingCartItem.Name = "Google Checkout Item";
    decimal _price = 0M;
    decimal.TryParse(amt, out _price);
    shoppingCartItem.Price = _price;
    shoppingCartItem.Quantity = 1;
    shoppingCartItem.MerchantItemID = "1";

    string returnURL = "http://localhost:50241/GCheckout/Success";
    string trackURL = "http://localhost:50241/GCheckout/Track";

    GCheckout.Checkout.CheckoutShoppingCartRequest checkoutShoppingCartRequest = new GCheckout.Checkout.CheckoutShoppingCartRequest(ConfigurationManager.AppSettings["GoogleMerchantID"], ConfigurationManager.AppSettings["GoogleMerchantKey"], EnvironmentType.Sandbox, "USD", 30, false);
    checkoutShoppingCartRequest.ContinueShoppingUrl = returnURL;
    ParameterizedUrl trackingUrl = new ParameterizedUrl(trackURL + "?mid=123");
    trackingUrl.AddParameter("oid", UrlParameterType.OrderID);
    trackingUrl.AddParameter("ot", UrlParameterType.OrderTotal);
    trackingUrl.AddParameter("zp", UrlParameterType.ShippingPostalCode);
    checkoutShoppingCartRequest.ParameterizedUrls.AddUrl(trackingUrl);

    checkoutShoppingCartRequest.AddItem(shoppingCartItem);

    GCheckout.Checkout.MerchantCode merchantCode = new GCheckout.Checkout.MerchantCode();

    GCheckoutResponse response = checkoutShoppingCartRequest.Send();
    if (response != null)
    {
          Response.Redirect(response.RedirectUrl, true);
    }
于 2013-04-04T12:24:12.563 回答