Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using InitializeTransaction() and Finalize() results in OrderStatus set to Error #504

Open
MichaelNielsenDK opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MichaelNielsenDK
Copy link

When doing something like this

var order = _umbracoCommerceApi.GetCurrentOrder(storeId)
						.AsWritable(uow);

//Finalize order
order.InitializeTransaction();
order.Finalize(order.TotalPrice, Guid.NewGuid().ToString("N"), PaymentStatus.Authorized);

_umbracoCommerceApi.SaveOrder(order);

The order will recieve a status of 'Error' instead of 'New'.

We have to fetch the 'New' orderstatus set it and save the order again

var orderStatus = _umbracoCommerceApi.GetOrderStatus(storeId, "new");
order.SetOrderStatus(orderStatus, OrderStatusCode.Ok);

_umbracoCommerceApi.SaveOrder(order); 

It just feels wrong that you have to save the order twice.

Umbraco 13.1.1
Umbraco Commerce 13.1.3

@MichaelNielsenDK MichaelNielsenDK added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant