You are here

public function SetStatus::execute in Payment 8.2

Executes the plugin.

Overrides ExecutableInterface::execute

File

src/Plugin/Action/SetStatus.php, line 77

Class

SetStatus
Sets a status on a payment.

Namespace

Drupal\payment\Plugin\Action

Code

public function execute(PaymentInterface $payment = NULL) {
  if ($payment) {
    $status = $this->paymentStatusType
      ->getPluginManager()
      ->createInstance($this->configuration['payment_status_plugin_id']);
    $payment
      ->setPaymentStatus($status);
  }
}