public void Can_get_payment_gatways()
        {
            // Act
            var result = _queries.GetPaymentGateways();

            //Assert
            result.Should().NotBeNull();
        }
Exemplo n.º 2
0
        public GetPaymentGatewaysResponse GetPaymentGateways(GetPaymentGatewaysRequest request)
        {
            if (request.BrandId.HasValue)
            {
                CheckBrand(request.BrandId.Value);
            }

            var paymentGateways = _paymentGatewaySettingsQueries
                                  .GetPaymentGateways(request.BrandId);

            var requestResultMapped = Mapper.Map <IEnumerable <PaymentGateway> >(paymentGateways);

            return(new GetPaymentGatewaysResponse {
                PaymentGateways = requestResultMapped
            });
        }
        public IEnumerable <PaymentMethodDto> GetPaymentMethods(Guid?brandId = null)
        {
            var paymentMethods = new List <PaymentMethodDto>();

            paymentMethods.Add(new PaymentMethodDto
            {
                Id   = PaymentMethodDto.OfflinePayMethod,
                Name = PaymentMethodDto.OfflinePayMethod,
                PaymentGatewayMethod = PaymentMethod.OfflineBank
            });

            var onlinePaymentGateway = _paymentGatewaySettingsQueries.GetPaymentGateways()
                                       .Select(
                x => new PaymentMethodDto
            {
                Id   = x.Id,
                Name = x.Name,
                PaymentGatewayMethod = PaymentMethod.Online
            });

            paymentMethods.AddRange(onlinePaymentGateway);

            return(paymentMethods);
        }