diff --git a/OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs b/OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs index a5902b84..a8818233 100644 --- a/OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs +++ b/OpenActive.Server.NET/CustomBookingEngine/CustomBookingEngine.cs @@ -756,11 +756,16 @@ async Task IBookingEngine.TriggerTestAction(string actionJson) //TODO: Should we move Seller into the Abstract level? Perhaps too much complexity protected BookingFlowContext ValidateFlowRequest(OrderIdComponents orderId, SellerIdComponents sellerIdComponents, ILegalEntity seller, FlowStage stage, TOrder order) where TOrder : Order, new() { - if (order?.Seller.IdReference != null && seller?.Id != order?.Seller.IdReference) + if (order?.Seller.IdReference == null) { throw new OpenBookingException(new SellerMismatchError()); } + if (seller?.Id != order?.Seller.IdReference) + { + throw new OpenBookingException(new InvalidAuthorizationDetailsError()); + } + // Check that taxMode is set in Seller if (!(seller?.TaxMode == TaxMode.TaxGross || seller?.TaxMode == TaxMode.TaxNet)) {