Are there any tutorials out there on how to get the responses back from a Google Checkout transaction when using C# and the GCheckout API. All of the examples I could find w
Without a HTTPS connection you'll only get a serial number POSTed to you. For safety, you should ensure that the authorisation is correct (there should be an Authorization
header containing
encoded using base64 encoding)
You then need to make a call via the Notification-History-API to request details of the update, loosely:
IList ordersToGetUpdate = new List { serialNumber };
NotificationHistoryRequest request = new NotificationHistoryRequest(ordersToGetUpdate);
NotificationHistoryResponse resp = (NotificationHistoryResponse)request.Send();
foreach (object notification in resp.NotificationResponses)
{
// You'd now need to handle the response, which could be one of NewOrderNotification, OrderStateChangeNotification, RiskInformationNotification, AuthorizationAmountNotification or a ChargeAmountNotification
NewOrderNotification newOrder = notification as NewOrderNotification;
if( newOrder != null )
{
// Yay! New order, so do "something" with it
}
OrderStateChangeNotification orderUpdate = notification as OrderStateChangeNotification;
if (orderUpdate != null)
{
// Order updated (paid, shipped, etc), so do "something" with it
}
// you probably get the idea as to how to handle the other response types
}