Try our conversational search powered by Generative AI!

PayPal - Null Reference

Vote:
 

Hi,

Today I installed PayPal Provider for an EPiServer Commerce 7.5 application.

I have done this using the following instructions:

http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Commerce/Installation-instructions-EPiServer-75-Commerce/PayPal-payment-provider---installation-and-user-guide/

Now I am receiving "Object reference not set to an instance of an object." when I'm trying to place an order.

I was wondering if anyone could help me out or give me a direction of the problem area.

Thanks in advance.

#112486
Oct 29, 2014 9:12
Vote:
 

Hi,

What's your stacktrace? And are you running plain 7.5 or updated version via nuget?

/Q

#112492
Oct 29, 2014 9:47
Vote:
 

Hi Quan,

Now I look at it closely it did output an error.

Error occurred while restoring NuGet packages: System.ArgumentException: The path is not of a legal form.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at NuGet.VisualStudio.VsUtility.GetNuGetSolutionFolder(Solution solution)
at NuGet.VsEvents.PackageRestorer.UsingOldPackageRestore(Solution solution)
at NuGet.VsEvents.PackageRestorer.BuildEvents_OnBuildBegin(vsBuildScope Scope, vsBuildAction Action).
1>------ Build started: Project: EPiServer.Business.Commerce.Payment, Configuration: Debug Any CPU ------
1> EPiServer.Business.Commerce.Payment -> C:\Users\SujenK\Downloads\episervercommerce75paymentproviders\EPiServerCommerce75PaymentProviders\EPiServer.Commerce.Sample\bin\EPiServer.Business.Commerce.Payment.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I am working with the plain commerce 7.5 project. 

#112503
Oct 29, 2014 10:27
Vote:
 

Hi,

Isn't it clear it's a nuget (compiling) issue, other than PayPal gateway error itself?

/Q

#112506
Oct 29, 2014 10:37
Vote:
 

Hi Quan,

Yea, the NuGet issue is clear, I didn't notice it before though since it was building succesfully.

I fixed that issue now, and it is building sucessfully without any errors.

I am still receiving the same error, but I think it's unrelated to this.

So I'll mark it as solved for now.

#112510
Oct 29, 2014 11:12
Vote:
 

Hi,

The last time debugged only the paypal project. This time I debugged my own project and I got this.

Stack Trace:

at Mediachase.MetaDataPlus.MetaObject.CreateFieldStorage(MetaClass metaClass, Func`2 getValue)
at Mediachase.MetaDataPlus.MetaObject.CreateEmptyFieldStorage(MetaClass metaClass)
at Mediachase.MetaDataPlus.MetaObject..ctor(MetaClass metaClass, Int32 objectId)
at Mediachase.MetaDataPlus.MetaObject..ctor(MetaClass metaClass)
at Mediachase.Commerce.Storage.MetaStorageBase..ctor(MetaClass metaClass)
at Mediachase.Commerce.Orders.OrderStorageBase..ctor(MetaClass metaClass)
at Mediachase.Commerce.Orders.Payment..ctor(MetaClass metaClass)
at EPiServer.Business.Commerce.Payment.PayPal.Orders.PayPalPayment..ctor()
at EPiServer.Business.Commerce.Payment.PayPal.PaymentMethod.PreProcess(OrderForm form)
at Indivirtual.Commerce.Web.Views.Units.CartCheckout.SharedModules.PaymentOptions.FullfilPayment() in c:\Projects\EPiServer\Commerce\Commerce.Web\Views\Units\CartCheckout\SharedModules\PaymentOptions.ascx.cs:line 97

Exception Detail:

System.NullReferenceException was caught  _HResult=-2147467261  _message=Object reference not set to an instance of an object.  HResult=-2147467261  IsTransient=false  Message=Object reference not set to an instance of an object.  Source=Mediachase.MetaDataPlus  StackTrace:       at Mediachase.MetaDataPlus.MetaObject.CreateFieldStorage(MetaClass metaClass, Func`2 getValue)       at Mediachase.MetaDataPlus.MetaObject.CreateEmptyFieldStorage(MetaClass metaClass)       at Mediachase.MetaDataPlus.MetaObject..ctor(MetaClass metaClass, Int32 objectId)       at Mediachase.MetaDataPlus.MetaObject..ctor(MetaClass metaClass)       at Mediachase.Commerce.Storage.MetaStorageBase..ctor(MetaClass metaClass)       at Mediachase.Commerce.Orders.OrderStorageBase..ctor(MetaClass metaClass)       at Mediachase.Commerce.Orders.Payment..ctor(MetaClass metaClass)       at EPiServer.Business.Commerce.Payment.PayPal.Orders.PayPalPayment..ctor()       at EPiServer.Business.Commerce.Payment.PayPal.PaymentMethod.PreProcess(OrderForm form)       at Indivirtual.Commerce.Web.Views.Units.CartCheckout.SharedModules.PaymentOptions.FullfilPayment() in c:\Projects\EPiServer\Commerce\Commerce.Web\Views\Units\CartCheckout\SharedModules\PaymentOptions.ascx.cs:line 97  

Can anyone help me out?

#112520
Oct 29, 2014 13:22
Vote:
 

I guess you did not to import PayPalPaymentMetaClass.xml into your system. In recent change we extended PaypalPayment class, so importing that file is a requirement - as in document: http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Commerce/Installation-instructions-EPiServer-75-Commerce/PayPal-payment-provider---installation-and-user-guide/ 

  • In Commerce Manager, navigate to Administration > Order System > Meta Classes, and click Import MetaData to populate the MetaData import screen. Then select the PayPal\ PayPalPaymentMetaClass.xml file to import.

Regards.

/Q

#112551
Oct 30, 2014 3:50
Vote:
 

Hi,

Thanks for pointing out.

That was causing this issue.

#112562
Oct 30, 2014 9:08
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.