use of com.salesmanager.shop.model.system.IntegrationModuleSummaryEntity in project shopizer by shopizer-ecommerce.
the class ShippingConfigurationApi method integrationModule.
private IntegrationModuleSummaryEntity integrationModule(IntegrationModule module, Map<String, IntegrationConfiguration> configuredModules) {
IntegrationModuleSummaryEntity readable = null;
readable = new IntegrationModuleSummaryEntity();
readable.setCode(module.getCode());
readable.setImage(module.getImage());
if (configuredModules.containsKey(module.getCode())) {
IntegrationConfiguration conf = configuredModules.get(module.getCode());
readable.setConfigured(true);
if (conf.isActive()) {
readable.setActive(true);
}
}
return readable;
}
use of com.salesmanager.shop.model.system.IntegrationModuleSummaryEntity in project shopizer by shopizer-ecommerce.
the class ShippingConfigurationApi method shippingModules.
/**
* Get available shipping modules
*
* @param merchantStore
* @param language
* @return
*/
@GetMapping("/private/modules/shipping")
@ApiOperation(httpMethod = "GET", value = "List list of shipping modules", notes = "Requires administration access", produces = "application/json", response = List.class)
@ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = "string", defaultValue = "DEFAULT") })
public List<IntegrationModuleSummaryEntity> shippingModules(@ApiIgnore MerchantStore merchantStore, @ApiIgnore Language language) {
try {
List<IntegrationModule> modules = shippingService.getShippingMethods(merchantStore);
// configured modules
Map<String, IntegrationConfiguration> configuredModules = shippingService.getShippingModulesConfigured(merchantStore);
return modules.stream().map(m -> integrationModule(m, configuredModules)).collect(Collectors.toList());
} catch (ServiceException e) {
LOGGER.error("Error getting shipping modules", e);
throw new ServiceRuntimeException("Error getting shipping modules", e);
}
}
use of com.salesmanager.shop.model.system.IntegrationModuleSummaryEntity in project shopizer by shopizer-ecommerce.
the class PaymentApi method integrationModule.
private IntegrationModuleSummaryEntity integrationModule(IntegrationModule module, Map<String, IntegrationConfiguration> configuredModules) {
IntegrationModuleSummaryEntity readable = null;
readable = new IntegrationModuleSummaryEntity();
readable.setCode(module.getCode());
readable.setImage(module.getImage());
readable.setBinaryImage(module.getBinaryImage());
// readable.setRequiredKeys(module.getConfigurables());
readable.setConfigurable(module.getConfigurable());
if (configuredModules.containsKey(module.getCode())) {
readable.setConfigured(true);
if (configuredModules.get(module.getCode()).isActive()) {
readable.setActive(true);
}
}
return readable;
}
use of com.salesmanager.shop.model.system.IntegrationModuleSummaryEntity in project shopizer by shopizer-ecommerce.
the class PaymentApi method paymentModules.
/**
* Get available payment modules
*
* @param merchantStore
* @param language
* @return
*/
@GetMapping("/private/modules/payment")
@ApiOperation(httpMethod = "GET", value = "List list of payment modules", notes = "Requires administration access", produces = "application/json", response = List.class)
@ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = "string", defaultValue = "DEFAULT") })
public List<IntegrationModuleSummaryEntity> paymentModules(@ApiIgnore MerchantStore merchantStore, @ApiIgnore Language language) {
try {
List<IntegrationModule> modules = paymentService.getPaymentMethods(merchantStore);
// configured modules
Map<String, IntegrationConfiguration> configuredModules = paymentService.getPaymentModulesConfigured(merchantStore);
return modules.stream().map(m -> integrationModule(m, configuredModules)).collect(Collectors.toList());
} catch (ServiceException e) {
LOGGER.error("Error getting payment modules", e);
throw new ServiceRuntimeException("Error getting payment modules", e);
}
}
Aggregations