diff --git a/composer.json b/composer.json index 881f6dc..b81889c 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "homepage": "https://drupal.org/project/commerce_paypal", "license": "GPL-2.0-or-later", "require": { + "php": "^8.0", "drupal/commerce": "^2.19 || ^3", "sainsburys/guzzle-oauth2-plugin": "^3.0" } diff --git a/src/Plugin/Commerce/PaymentMethodType/PayPalCheckout.php b/src/Plugin/Commerce/PaymentMethodType/PayPalCheckout.php index 34094e4..2ddd96b 100644 --- a/src/Plugin/Commerce/PaymentMethodType/PayPalCheckout.php +++ b/src/Plugin/Commerce/PaymentMethodType/PayPalCheckout.php @@ -23,7 +23,7 @@ class PayPalCheckout extends CreditCard { if ($payment_method->hasField('card_type') && !$payment_method->get('card_type')->isEmpty()) { return parent::buildLabel($payment_method); } - return $this->t('PayPal'); + return $payment_method->getPaymentGateway()?->getPlugin()?->getDisplayLabel() ?? $this->t('Paypal'); } }