X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fcommands%2Fweb%2Fclass_WebShipsimuRefillCommand.php;h=fa7aff5322642ec7f0e8db382426c9709d896b04;hp=fb7bd40c8e71a3d88bf94ad467573bbdf7b64fa5;hb=7a44bb20ca579fb79bba71d65f5f7a834665f80f;hpb=543d29dea85a50e2d21b0d56cdb028a94795702c diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php index fb7bd40..fa7aff5 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php @@ -91,8 +91,14 @@ class WebShipsimuRefillCommand extends BaseCommand implements Commandable { // Verify refill request $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter')); + // Construct config entry for wether automatic payment from API or waiting for approval + $paymentTypeConfig = sprintf("refill_request_%s_payment_type", $requestInstance->getRequestElement('type')); + // Prepare a filter based on the requested type we shall refill - $filterName = sprintf("refill_request_%s_book_filter", $requestInstance->getRequestElement('type')); + $filterName = sprintf("refill_request_%s_%s_book_filter", + $requestInstance->getRequestElement('type'), + $this->getConfigInstance()->readConfig($paymentTypeConfig) + ); // Now, try to load that filter $controllerInstance->addPostFilter(ObjectFactory::createObjectByConfiguredName($filterName));