Example #1
0
        public virtual IInvoiceBuilder SetGatewayType(Type gatewayType)
        {
            GatewayHelper.IsGateway(gatewayType, throwException: true);

            _gatewayType = gatewayType;

            return(this);
        }
Example #2
0
        /// <inheritdoc />
        public virtual IGateway Provide(Type gatewayType)
        {
            GatewayHelper.IsGateway(gatewayType, throwException: true);

            var gateway = _services.GetService(gatewayType);

            if (gateway == null)
            {
                throw new GatewayNotFoundException(GatewayHelper.GetNameByType(gatewayType));
            }

            return((IGateway)gateway);
        }