You are here

protected function PaymentInformation::noPaymentGatewayErrorMessage in Commerce Core 8.2

Returns an error message in case there are no available payment gateways.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The error message.

2 calls to PaymentInformation::noPaymentGatewayErrorMessage()
PaymentInformation::buildPaneForm in modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php
Builds the pane form.
PaymentInformation::validatePaneForm in modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php
Validates the pane form.

File

modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php, line 445

Class

PaymentInformation
Provides the payment information pane.

Namespace

Drupal\commerce_payment\Plugin\Commerce\CheckoutPane

Code

protected function noPaymentGatewayErrorMessage() {
  if ($this->currentUser
    ->hasPermission('administer commerce_payment_gateway')) {
    $message = $this
      ->t('There are no <a href=":url"">payment gateways</a> available for this order.', [
      ':url' => Url::fromRoute('entity.commerce_payment_gateway.collection')
        ->toString(),
    ]);
  }
  else {
    $message = $this
      ->t('There are no payment gateways available for this order. Please try again later.');
  }
  return $message;
}