Developer forum

Forum » Integration » Live integration: GetCurrentUser on BuildOrderRequest

Live integration: GetCurrentUser on BuildOrderRequest

Keld Gøtterup
Reply

i have a problem in a specific scenario while trying to get the current user when sending an order through the live integration framework.

in most case it gets the user information as it should and sends it in the request to Navision but....
When i use a quickpay payment provider and get sent back to the shop the currentuser doesn't seem to be initialized in the BuildOrderRequest.( not logged out on the website)

User user = User.GetCurrentUser();
Helpers.AddChildXmlNodeToCart(xDoc, orderNode, "OrderCustomerAccessUserExternalId", (user != null && !string.IsNullOrEmpty(user.UserName)) ? user.UserName : Constants.ANONYMOUS_USER_NAME);

can somebody help in figuring this out?

 


Replies

 
Anders Ebdrup
Reply
This post has been marked as an answer

Hi Keld,

 

I suppose the problem is in the callback from Quickpay, and as it is a callback the users context is not available. Instead you can load the user by the userId/username on the order.

 

Hope it can help you?

 

Best regards, Anders

Votes for this answer: 1

 

You must be logged in to post in the forum