protected function PaymentReferenceBase::getPayment in Payment 8.2
Gets the payment.
Parameters
mixed[] $element:
\Drupal\Core\Form\FormStateInterface $form_state:
Return value
\Drupal\payment\Entity\PaymentInterface
5 calls to PaymentReferenceBase::getPayment()
- PaymentReferenceBase::buildPaymentForm in src/
Element/ PaymentReferenceBase.php - Builds the payment form.
- PaymentReferenceBase::elementValidate in src/
Element/ PaymentReferenceBase.php - Implements form API's element_validate callback.
- PaymentReferenceBase::getEntityFormDisplay in src/
Element/ PaymentReferenceBase.php - Gets the entity form display.
- PaymentReferenceBase::getPluginSelector in src/
Element/ PaymentReferenceBase.php - Gets the plugin selector.
- PaymentReferenceBase::pay in src/
Element/ PaymentReferenceBase.php - Implements form submit handler.
File
- src/
Element/ PaymentReferenceBase.php, line 563
Class
- PaymentReferenceBase
- Provides a base for payment reference elements.
Namespace
Drupal\payment\ElementCode
protected function getPayment(array $element, FormStateInterface $form_state) {
$key = 'payment_reference.element.payment_reference.payment';
if (!$form_state
->has($key)) {
/** @var \Drupal\payment\Entity\PaymentInterface $prototype_payment */
$prototype_payment = $element['#prototype_payment'];
$payment = $prototype_payment
->createDuplicate();
$form_state
->set($key, $payment);
}
return $form_state
->get($key);
}