x252618759 / google-checkout-dotnet-sample-code

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

Notification History Request Date Search Error: Object reference not set to an instance of an object. #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Create a new NotificationHistoryRequest:

GCheckout.OrderProcessing.NotificationHistoryRequest req = new
GCheckout.OrderProcessing.NotificationHistoryRequest(
    GCheckoutConfigurationHelper.MerchantID.ToString(),
    GCheckoutConfigurationHelper.MerchantKey,
    GCheckoutConfigurationHelper.Environment.ToString(),                   
    DateTime.Now.Subtract(new TimeSpan(30, 0,0,0)), 
    DateTime.Now
);

2. Send the NotificationHistoryRequest request:
GCheckout.OrderProcessing.NotificationHistoryResponse resp =
(GCheckout.OrderProcessing.NotificationHistoryResponse)req.Send();

What is the expected output? What do you see instead?

I am expecting a successful response and not an error. The 
NotificationHistoryResponse should contain a list of NotificationResponses
filtered by a start time and end time. The error I receive is as follows:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error: GCheckout.OrderProcessing.NotificationHistoryResponse resp =
(GCheckout.OrderProcessing.NotificationHistoryResponse)req.Send();

Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
GCheckout.OrderProcessing.NotificationHistoryResponse.get_NextPageToken() +43
GCheckout.OrderProcessing.NotificationHistoryRequest.ParseResponse(String
response) +124
GCheckout.GCheckoutRequest.Send() +56

What version of the product are you using? On what operating system?
Version 1.3.4.0
Windows XP, ASP.NET Version:2.0.50727.3082 

Please provide any additional information below.

Original issue reported on code.google.com by coffeefi...@googlemail.com on 11 Feb 2010 at 2:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Try changing your endtime to at least 5 minutes in the past. You can check your
sandbox's Integration Console to get more detailed errors to your request.

Original comment by seanlinmt on 31 Mar 2010 at 6:48

GoogleCodeExporter commented 9 years ago
Thanks, that is brilliant. Changing the endtime to 5 minutes in the past works. 
I can
now list the notification history.

I had checked the Integration Console before but I did not see any errors. Today
though the errors are showing with the message 'The times you specify must be at
least 5 minutes in the past'. 

Thanks for your help!

Original comment by coffeefi...@googlemail.com on 31 Mar 2010 at 1:59

GoogleCodeExporter commented 9 years ago
I added a fix in the latest version that should account for this condition.
It will be in v2.5.0.1

Original comment by joseph.f...@gmail.com on 22 May 2010 at 5:05

GoogleCodeExporter commented 9 years ago

Original comment by joseph.f...@gmail.com on 22 May 2010 at 5:08

GoogleCodeExporter commented 9 years ago

Original comment by joseph.f...@gmail.com on 16 Oct 2010 at 4:08