You are here

public function PayPal::buildLabel in Commerce Core 8.2

Builds a label for the given payment method.

Parameters

\Drupal\commerce_payment\Entity\PaymentMethodInterface $payment_method: The payment method.

Return value

string The label.

Overrides PaymentMethodTypeInterface::buildLabel

File

modules/payment/src/Plugin/Commerce/PaymentMethodType/PayPal.php, line 21

Class

PayPal
Provides the PayPal payment method type.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentMethodType

Code

public function buildLabel(PaymentMethodInterface $payment_method) {
  $args = [
    '@paypal_mail' => $payment_method->paypal_mail->value,
  ];
  return $this
    ->t('PayPal (@paypal_mail)', $args);
}