public void ResolveGatewayTests(Gateway identifier, bool success)
 {
     if (!success)
     {
         Assert.Throws <NotImplementedException>(() => GatewayFactory.ResolveGateway(identifier));
     }
     else
     {
         var gateway = GatewayFactory.ResolveGateway(identifier);
         Assert.NotNull(gateway);
     }
 }
        public async Task <ServiceResult <OrderDto> > ProcessInternalAsync(OrderDto order)
        {
            var gateway = GatewayFactory.ResolveGateway(order.PaymentGateway);

            if (gateway == null)
            {
                return(new ServiceResult <OrderDto>(
                           new ApiError($"{nameof(order.PaymentGateway)} is not yet implemented"),
                           HttpStatusCode.BadGateway));
            }

            var result = await gateway.ProcessAsync(order);

            return(Map(result, order));
        }