OrderPaid Event

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 yıl önce
I've created a plugin that I need to run only once when an order is complete.  It currently fires on the OrderPaid event, but apparently executes twice (I increment a value based on Quantity).  I tried to set if(e.Order.OrderStatusId==30) but still twice...

Any ideas?
11 yıl önce
I also tried: if (e.Order.PaymentStatus == Core.Domain.Payments.PaymentStatus.Paid) - same result
11 yıl önce
Looking at the code of OrderProcessingService, the OrderPaid event is raised in method PlaceOrder and method MarkOrderAsPaid the last method is protected by a call to method CanMarkOrderAsPaid which returns false if the status is paid. Maybe you introduced a new order status which causes CanMarkOrderAsPaid to return true and fire the paid event a second time?
11 yıl önce
Interesting idea, thanks!  But, the only other thing I've touched is in another plugin using IConsumer<EntityUpdated<GenericAttribute>>
11 yıl önce
Set a breakpoint on Eventpublisher.PublishOrderPaid to see if it fires twice
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.