// 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));