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