Google Checkout API - Connect order with notification?
Using the Google Checkout XML API, is it possible to connect an order you send to Google Checkout to an order Google Checkout notifies you about?
Right now, I can send an order to Google Checkout, and I can get notifications from Google that an order went through. But I don't see how to connect the two. 开发者_运维问答I need this to connect orders to user accounts.
Send over an explicit order number with your data to Google. This is some test code I wrote that does just this
CheckoutShoppingCartRequest Req = checkoutButton.CreateRequest();
Req.AddItem(product.Name, product.ShortDescription, OrderID, product.Price, 1);
GCheckoutResponse Resp = Req.Send();
if (Resp.IsGood)
{
}
else
{
}
Generally, you can use the merchant-private-data field to pass any custom data about your order.
When you get back the notification, read the custom info from the merchant-private-data field.
See this answer for a solution to a similar issue.
精彩评论