The order finalized event occurs only once when the order has some form of transaction recorded against it for the first time and it moves from being a cart to being an order.
public class CustomerOrderFinalizedHandler : NotificationEventHandlerBase<OrderFinalizedNotification>
{
public override void Handle(OrderFinalizedNotification evt)
{
OrderReadOnly order = evt.Order;
HandleFinalizedProductPurchase _handleFinalizedProductPurchase = new HandleFinalizedProductPurchase();
_handleFinalizedProductPurchase.Execute(order);
}
}
The class to register my event:
public static class UmbracoBuilderExtensions
{
public static IUmbracoBuilder AddMyEventHandlers(this IUmbracoBuilder builder)
{
builder.WithNotificationEvent<OrderFinalizedNotification>()
.RegisterHandler<CustomerOrderFinalizedHandler>();
return builder;
}
}
Vendr - OrderFinalizedNotification
NotificationEventHandlerBase<OrderFinalizedNotification>
The Vendr stopped emit event after finishing the order. Is there a reason that makes it happen?
I'm trying to understand why the notification stopped working.
Thanks, NPina.
The order finalized event occurs only once when the order has some form of transaction recorded against it for the first time and it moves from being a cart to being an order.
What are you trying to do with the event?
I'm trying to catch the finished order with it's order lines to store on my own database table.
Hmm, that should work. Have you registered your event? If so what code are you using to register it?
Yes. That's what I have done. My class:
The class to register my event:
add my event to service:
services.AddUmbraco(_env, _config) .AddBackOffice() .AddWebsite() .AddComposers() .AddMyEventHandlers() .Build();
And what version of Vendr are you using?
Hi Matt,
I am using
Vendr 2.3.2
.Hmm, this looks like it should all be ok then 🤔
If you add a breakpoint into your event handler, does it never get hit?
Yes, I had breakpoint inside my event handler, but it does not get in there.
I have done that implementation month ago, and it was working fine. It just stopped working yesterday.
And what changed yesterday? Did you upgrade or something? Are there any errors in your trace log?
No changes, no upgrade and without any errors.
I wondering if it was because I'm in development mode? Does Vendr have limit of event in development?
No, it shouldn't do.
Are your orders actually finalizing (becoming orders / emails sending etc)? What payment method are you using?
Yes, the orders are being finalized, the emails are being sent.
I'm using stripe payment.
Hmmm, I mean it's very weird your handler wouldn't run as the order emails are triggered via the same event, so Vendr must be firing it 🤔
I'm not currently sure what else to suggest as everything you've shared looks fine to me.
is working on a reply...