public function DisablePaymentMethodConfiguration::execute in Payment 8.2
Disables a payment method configuration.
Parameters
\Drupal\payment\Entity\PaymentMethodConfigurationInterface $payment_method_configuration:
Return value
\Symfony\Component\HttpFoundation\RedirectResponse
1 string reference to 'DisablePaymentMethodConfiguration::execute'
File
- src/
Controller/ DisablePaymentMethodConfiguration.php, line 21
Class
- DisablePaymentMethodConfiguration
- Handles the "disable payment method configuration" route.
Namespace
Drupal\payment\ControllerCode
public function execute(PaymentMethodConfigurationInterface $payment_method_configuration) {
$payment_method_configuration
->disable();
$payment_method_configuration
->save();
return new RedirectResponse($payment_method_configuration
->toUrl('collection')
->setAbsolute()
->toString());
}