You are here

public function PaymentDeleteForm::buildForm in Ubercart 8.4

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

payment/uc_payment/src/Form/PaymentDeleteForm.php, line 55

Class

PaymentDeleteForm
Confirmation form to delete a payment from an order.

Namespace

Drupal\uc_payment\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, OrderInterface $uc_order = NULL, PaymentReceiptInterface $uc_payment_receipt = NULL) {
  $this->payment = $uc_payment_receipt;

  // Make sure the payment is for the specified order.
  if ($this->payment->order_id->target_id != $uc_order
    ->id()) {
    throw new NotFoundHttpException();
  }
  return parent::buildForm($form, $form_state);
}