Order empty when GetCurrentFinalizedOrder called after transaction completes
Hi,
I have a new Tea Commerce 3.0.4 site running on Umbraco 7.2.8. I'm using the SagePay payment gateway. Everything is great, the cart directs to SagePay's test system and the transaction completes - I receive an email confirmation and the order is visible in the Tea Commerce orders dashboard.
The only problem is on the completion page (cart step 6) I'm getting the following error:
Server Error in '/' Application.
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:
Line 19: </thead>
Line 20: <tbody>
Line 21: @foreach (OrderLine orderLine in order.OrderLines)
Line 22: {
Line 23: IPublishedContent productContent = Umbraco.TypedContent(orderLine.ProductIdentifier);
The code which gets the finalised order in the cart step 6 template is pretty standard:
@using TeaCommerce.Api.Models
@using TeaCommerce.Umbraco.Web
@inherits UmbracoTemplatePage
@{
Layout = "CartStepMaster.cshtml";
IPublishedContent currentPage = Model.Content;
IPublishedContent prevStep = currentPage.PrecedingSibling();
//store id
long storeId = long.Parse(currentPage.GetPropertyValue<string>("store", true));
Order order = TC.GetCurrentFinalizedOrder( storeId );
}
But it would appear that the order is empty (or null) at this point.
Can anyone spot why this is happening? Could it be something to do with the mini-cart at the top of the page creating a new order when the page is loaded?
Order empty when GetCurrentFinalizedOrder called after transaction completes
Hi,
I have a new Tea Commerce 3.0.4 site running on Umbraco 7.2.8. I'm using the SagePay payment gateway. Everything is great, the cart directs to SagePay's test system and the transaction completes - I receive an email confirmation and the order is visible in the Tea Commerce orders dashboard.
The only problem is on the completion page (cart step 6) I'm getting the following error:
The code which gets the finalised order in the cart step 6 template is pretty standard:
But it would appear that the order is empty (or null) at this point.
Can anyone spot why this is happening? Could it be something to do with the mini-cart at the top of the page creating a new order when the page is loaded?
Many thanks.
What if you use the invoicing payment provider - does that make GetCurrentFinalizedOrder anything else than null?
Kind regards
Anders
is working on a reply...