Commerce Connect 9: CustomerServiceProvider.CreateUser not working?

Hi,

I am trying to create a Commerce user (customer) using the Commerce Connect 9 CustomerServiceProvider.CreateUser method.

The Sitecore.Commerce.Engine.Connect.Pipelines.Customers.CreateUser processor gives me a NullReferenceException. In Commerce Server logging I see the following:

49 10:32:30 WARN CtxMsg.Warning.EntityNotFound: Text=Views.block.DoAction-Entity '' was not found.
49 10:32:30 WARN Entity was not found.
50 10:32:30 WARN CtxMsg.ValidationError.Customer_EmailValidationError: Text=RegexValidator error for property ' Email'.|Shopper=e0d18e30-158a-4fe6-8fab-a06edf533bff|Shop=MercuryFood|Correlation=5dc611570ea748938190d219218ba16a
50 10:32:30 ERROR PipelineAbort:Entity '' is not valid.
50 10:32:30 ERROR Validation failed for Entity-Customer-e860f5fe569c430f9fddd9ab8050c5f2.

When I debug the CreateUser processor the email address, password, and account status are set as argument.

Furthermore I could not find any example of where the CreateUser method is used, e.g. in the Habitat / CXA examples.

Anyone having the same problem? 

Any clues on what I am missing here?

 

Thanks,

Joost

  • Solved: the default regex (^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$) doesn't allow for + characters in email addresses.

    Furthermore the Sitecore.Commerce.Engine.Connect.Pipelines.Customers.CreateUser processor doesn't check the commerceCommand result, and thus a NullReferenceException can occur.