Browse Source

Record the transaction only if the order is completed.

pull/96/head
gdlcf88 6 years ago
parent
commit
8bfad549f4
  1. 6
      modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs

6
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs

@ -29,6 +29,12 @@ namespace EasyAbp.EShop.Stores.Transactions
{
var order = eventData.Order;
var refund = eventData.Refund;
// Record the transaction only if the order is completed.
if (!order.CompletionTime.HasValue)
{
return;
}
using var changeTenant = _currentTenant.Change(order.TenantId);

Loading…
Cancel
Save