You are here

public function DuplicatePaymentMethodConfiguration::execute in Payment 8.2

Displays a payment method duplication form.

Parameters

\Drupal\payment\Entity\PaymentMethodConfigurationInterface $payment_method_configuration:

Return value

array A render array.

1 string reference to 'DuplicatePaymentMethodConfiguration::execute'
payment.routing.yml in ./payment.routing.yml
payment.routing.yml

File

src/Controller/DuplicatePaymentMethodConfiguration.php, line 43

Class

DuplicatePaymentMethodConfiguration
Handles the "duplicate payment method configuration" route.

Namespace

Drupal\payment\Controller

Code

public function execute(PaymentMethodConfigurationInterface $payment_method_configuration) {
  $clone = $payment_method_configuration
    ->createDuplicate();
  $clone
    ->setLabel($this
    ->t('@label (duplicate)', [
    '@label' => $payment_method_configuration
      ->label(),
  ]));
  return $this->entityFormBuilder
    ->getForm($clone, 'default');
}