protected function PaymentForm::actions in Payment 8.2
Returns an array of supported actions for the current entity form.
Overrides EntityForm::actions
File
- modules/
payment_form/ src/ Entity/ Payment/ PaymentForm.php, line 139
Class
- PaymentForm
- Provides the payment form.
Namespace
Drupal\payment_form\Entity\PaymentCode
protected function actions(array $form, FormStateInterface $form_state) {
// Only use the existing submit action.
$actions = parent::actions($form, $form_state);
$actions = [
'submit' => $actions['submit'],
];
$actions['submit']['#value'] = $this
->t('Pay');
$actions['submit']['#disabled'] = count($this
->getPaymentMethodManager()
->getDefinitions()) == 0;
return $actions;
}