private static void HandleNewOrderNotification(GCheckout.AutoGen.NewOrderNotification inputNewOrderNotification) { // Retrieve data from MerchantPrivateData GCheckout.AutoGen.anyMultiple oneAnyMultiple = inputNewOrderNotification.shoppingcart.merchantprivatedata; System.Xml.XmlNode[] oneXmlNodeArray = oneAnyMultiple.Any; string hiddenMerchantPrivateData = oneXmlNodeArray[0].InnerText; // TODO: Process the MerchantPrivateData if provided foreach (GCheckout.AutoGen.Item oneItem in inputNewOrderNotification.shoppingcart.items) { // TODO: Get MerchantItemId from shopping cart item (oneItem.merchantitemid) and process it } // TODO: Add custom processing for this notification type }
private static void HandleNewOrderNotification(GCheckout.AutoGen.NewOrderNotification inputNewOrderNotification) { try { if (inputNewOrderNotification.shoppingcart.merchantprivatedata != null && inputNewOrderNotification.shoppingcart.merchantprivatedata.Any != null && inputNewOrderNotification.shoppingcart.merchantprivatedata.Any.Length > 0) { //Retrieve data from MerchantPrivateData GCheckout.AutoGen.anyMultiple oneAnyMultiple = inputNewOrderNotification.shoppingcart.merchantprivatedata; System.Xml.XmlNode[] oneXmlNodeArray = oneAnyMultiple.Any; foreach (XmlNode xn in oneXmlNodeArray) { if (xn.Name == "OrderID") { orderID = Int32.Parse(xn.InnerText.ToString()); } if (xn.Name == "userName") { userName = xn.InnerText.ToString(); } if (xn.Name == "amount") { totalAmount = decimal.Parse(xn.InnerText.ToString()); } if (xn.Name == "selectedCurrency") { selectedCurrency = xn.InnerText.ToString(); } if (xn.Name == "portalID") { portalID = int.Parse(xn.InnerText.ToString()); } if (xn.Name == "customerID") { customerID = int.Parse(xn.InnerText.ToString()); } if (xn.Name == "itemIds") { itemIds = xn.InnerText.ToString(); } if (xn.Name == "storeID") { storeID = int.Parse(xn.InnerText.ToString()); } if (xn.Name == "couponCode") { couponCode = xn.InnerText.ToString(); } if (xn.Name == "sessionCode") { sessionCode = xn.InnerText.ToString(); } if (xn.Name == "pgID") { pgID = int.Parse(xn.InnerText.ToString()); } if (xn.Name == "MerchantID") { MerchantID = xn.InnerText.ToString(); } if (xn.Name == "MerchantKey") { MerchantID = xn.InnerText.ToString(); } } paymentStatus = GCNotificationStatus.Succeeded.ToString(); transID = inputNewOrderNotification.googleordernumber; if (paymentStatus == "Succeeded") { TransactionLogInfo tinfo = new TransactionLogInfo(); TransactionLog Tlog = new TransactionLog(); OrderDetailsCollection odc = new OrderDetailsCollection(); tinfo.ResponseReasonText = "Succeeded"; tinfo.OrderID = orderID; tinfo.StoreID = storeID; tinfo.PortalID = portalID; tinfo.AddedBy = userName; tinfo.CustomerID = customerID; tinfo.SessionCode = sessionCode; tinfo.PaymentGatewayID = pgID; tinfo.PaymentStatus = paymentStatus; tinfo.PayerEmail = ""; tinfo.CreditCard = ""; tinfo.TotalAmount = totalAmount; tinfo.TransactionID = transID; tinfo.RecieverEmail = ""; tinfo.CurrencyCode = selectedCurrency; Tlog.SaveTransactionLog(tinfo); GoogleCheckOutHandler.ParseIPN(orderID, transID, paymentStatus, storeID, portalID, userName, customerID, sessionCode); GoogleCheckOutHandler.UpdateItemQuantity(itemIds, couponCode, storeID, portalID, userName); CartManageSQLProvider cms = new CartManageSQLProvider(); AspxCommonInfo aspxCommonObj = new AspxCommonInfo(); aspxCommonObj.CustomerID = customerID; aspxCommonObj.SessionCode = sessionCode; aspxCommonObj.StoreID = storeID; aspxCommonObj.PortalID = portalID; aspxCommonObj.CultureName = null; aspxCommonObj.UserName = null; cms.ClearCartAfterPayment(aspxCommonObj); } } } catch (Exception ex) { throw ex; } // TODO: Process the MerchantPrivateData if provided foreach (GCheckout.AutoGen.Item oneItem in inputNewOrderNotification.shoppingcart.items) { // TODO: Get MerchantItemId from shopping cart item (oneItem.merchantitemid) and process it } // TODO: Add custom processing for this notification type }