September 13, 2010

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

When I was clicking to "Add To cart " in DashCommerce in Production on godaddy I was getting the following error
System.NullReferenceException: Object reference not set to an instance of an object.



[NullReferenceException: Object reference not set to an instance of an object.]
   MettleSystems.dashCommerce.Web.cart.Page_Load(Object sender, EventArgs e) in cart.aspx.cs:93
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627



What I figured out that The setting of Payment Provider was not correct first I tried with NullPaypamentProvider which is the paymentprovider for testing in DashCommerce .
but Still I was not able to get the Cart.aspx page without error .
so I changed my payment Provider settings

I selected the PayPalStandardPaymentProvider from GeneralPayment settings
and in ConfigurePaymentProvider
I set my Information in the PayPal Express Checkout Accelerated Boarding Setup
I first Checked the Production Mode
and I filled PayPal API Credentials

API Username
API Password
Signature


Save the Payment Configuration and Now  'add to cart ' works after these settings
If you don't know how to get API Credentials for PAYPAl can refer the below link.

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_NVPAPIBasics


No comments:

Post a Comment