x252618759 / google-checkout-dotnet-sample-code

Automatically exported from code.google.com/p/google-checkout-dotnet-sample-code
0 stars 0 forks source link

NotificationHistoryResponse.NotificationResponses Contains No Objects #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the NotificationHistoryRequest to request a NotificationHistoryResponse 
2.
3.

What is the expected output? What do you see instead?
I expect the NotificationHistoryResponse.NotificationResponses to be filled 
with a list of objects, but it always contains none. The 
NotificationHistoryResponse.ResponseXml seems to be perfectly formatted, and 
everything else seems to be working flawlessly but for some reason that 
collection never contains any objects. 

What version of the product are you using? On what operating system?
GCheckoutV2.5.0.7. Dev OS is Windows Vista, production OS id Windows Server 
2008 64bit.

Please provide any additional information below.
Here is the code I am using.

    private void ProcessNotification(string serialNumber)
    {
      var merchantId = AppHelper.GetGoogleCheckoutMerchantId();
      var merchantKey = AppHelper.GetGoogleCheckoutMerchantKey();
      var environmentType = AppHelper.GetGoogleCheckoutEnvironmentTypeString();

      NotificationHistoryRequest nhRequest = new NotificationHistoryRequest(merchantId, merchantKey, environmentType, new NotificationHistorySerialNumber(serialNumber));
      NotificationHistoryResponse nhResponse = (NotificationHistoryResponse)nhRequest.Send();

      // This will never loop because the collection is always epmty
      foreach (object notificationResponse in nhResponse.NotificationResponses)
      {
        if (notificationResponse.GetType().Equals(typeof(GCheckout.AutoGen.NewOrderNotification)))
        {
          var newOrderNotification = (GCheckout.AutoGen.NewOrderNotification)notificationResponse;

          if (newOrderNotification.serialnumber.Equals(serialNumber))
          {
            HandleNewOrderNotification(newOrderNotification);
          }
        }
      }
    }

Original issue reported on code.google.com by nbir...@gmail.com on 13 Sep 2011 at 9:22

GoogleCodeExporter commented 9 years ago
Fixed in v2.5.0.8

Original comment by joseph.f...@gmail.com on 3 Aug 2012 at 2:52