From 5a6f0581b879c538c0909d7d4e3261ade7e91469 Mon Sep 17 00:00:00 2001 From: nickevansuk <2616208+nickevansuk@users.noreply.github.com> Date: Fri, 25 Jun 2021 09:51:16 +0100 Subject: [PATCH] Add InvalidAuthorizationDetailsError --- .../CustomBookingEngine/CustomBookingEngine.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)) {