You are here

protected function MolliePayment::getPaymentStatusSelector in Mollie Payment 8.2

Gets the payment status selector.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state:

string $type:

string $default_plugin_id:

Return value

\Drupal\plugin\Plugin\Plugin\PluginSelector\PluginSelectorInterface

3 calls to MolliePayment::getPaymentStatusSelector()
MolliePayment::getCapturePaymentStatusSelector in src/Plugin/Payment/MethodConfiguration/MolliePayment.php
Gets the payment status selector for the capture phase.
MolliePayment::getExecutePaymentStatusSelector in src/Plugin/Payment/MethodConfiguration/MolliePayment.php
Gets the payment status selector for the execute phase.
MolliePayment::getRefundPaymentStatusSelector in src/Plugin/Payment/MethodConfiguration/MolliePayment.php
Gets the payment status selector for the refund phase.

File

src/Plugin/Payment/MethodConfiguration/MolliePayment.php, line 446

Class

MolliePayment
Provides the configuration for the mollie_payment payment method plugin.

Namespace

Drupal\mollie_payment\Plugin\Payment\MethodConfiguration

Code

protected function getPaymentStatusSelector(FormStateInterface $form_state, $type, $default_plugin_id) {
  $key = 'payment_status_selector_' . $type;
  if ($form_state
    ->has($key)) {
    $plugin_selector = $form_state
      ->get($key);
  }
  else {
    $plugin_selector = $this->pluginSelectorManager
      ->createInstance('payment_select_list');
    $plugin_selector
      ->setSelectablePluginType($this->paymentStatusType);
    $plugin_selector
      ->setRequired(TRUE);
    $plugin_selector
      ->setCollectPluginConfiguration(FALSE);
    $plugin_selector
      ->setSelectedPlugin($this->paymentStatusType
      ->getPluginManager()
      ->createInstance($default_plugin_id));
    $form_state
      ->set($key, $plugin_selector);
  }
  return $plugin_selector;
}