String json = "";
if (is(commandParam, COMMAND_WAIVE_CHARGE)) {
final CommandWrapper commandRequest = new CommandWrapperBuilder()
.waiveSavingsAccountCharge(savingsAccountId, savingsAccountChargeId).withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
json = this.toApiJsonSerializer.serialize(result);
} else if (is(commandParam, COMMAND_PAY_CHARGE)) {
final CommandWrapper commandRequest = new CommandWrapperBuilder()
.paySavingsAccountCharge(savingsAccountId, savingsAccountChargeId).withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
json = this.toApiJsonSerializer.serialize(result);
} else if (is(commandParam, COMMAND_INACTIVATE_CHARGE)) {
final CommandWrapper commandRequest = new CommandWrapperBuilder()
.inactivateSavingsAccountCharge(savingsAccountId, savingsAccountChargeId).withJson(apiRequestBodyAsJson).build();
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
json = this.toApiJsonSerializer.serialize(result);
} else {
throw new UnrecognizedQueryParamException("command", commandParam, COMMAND_PAY_CHARGE, COMMAND_WAIVE_CHARGE,
COMMAND_INACTIVATE_CHARGE);