use of com.salesmanager.shop.model.configuration.ReadableConfiguration in project shopizer by shopizer-ecommerce.
the class PaymentConfigurationFacadeImpl method configuration.
@Override
public ReadableConfiguration configuration(String module, MerchantStore store) {
try {
ReadableConfiguration config = null;
List<PaymentMethod> methods = paymentService.getAcceptedPaymentMethods(store);
Optional<ReadableConfiguration> configuration = methods.stream().filter(m -> module.equals(m.getModule().getCode())).map(m -> this.configuration(m.getInformations(), store)).findFirst();
if (configuration.isPresent()) {
config = configuration.get();
}
return config;
} catch (ServiceException e) {
throw new ServiceRuntimeException("Error while getting payment configuration [" + module + "]", e);
}
}
use of com.salesmanager.shop.model.configuration.ReadableConfiguration in project shopizer by shopizer-ecommerce.
the class PaymentConfigurationFacadeImpl method configurations.
@Override
public List<ReadableConfiguration> configurations(MerchantStore store) {
try {
List<PaymentMethod> methods = paymentService.getAcceptedPaymentMethods(store);
List<ReadableConfiguration> configurations = methods.stream().map(m -> configuration(m.getInformations(), store)).collect(Collectors.toList());
return configurations;
} catch (ServiceException e) {
throw new ServiceRuntimeException("Error while getting payment configurations", e);
}
}
use of com.salesmanager.shop.model.configuration.ReadableConfiguration in project shopizer by shopizer-ecommerce.
the class PaymentConfigurationFacadeImpl method configuration.
private ReadableConfiguration configuration(IntegrationConfiguration source, MerchantStore store) {
ReadableConfiguration config = new ReadableConfiguration();
config.setActive(source.isActive());
config.setCode(source.getModuleCode());
config.setKeys(source.getIntegrationKeys());
config.setIntegrationOptions(source.getIntegrationOptions());
return config;
}
Aggregations