You are here

public function PaymentGatewayBase::canRefundPayment in Commerce Core 8.2

1 call to PaymentGatewayBase::canRefundPayment()
PaymentGatewayBase::buildPaymentOperations in modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php
Builds the available operations for the given payment.

File

modules/payment/src/Plugin/Commerce/PaymentGateway/PaymentGatewayBase.php, line 445

Class

PaymentGatewayBase
Provides the base class for payment gateways.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function canRefundPayment(PaymentInterface $payment) {
  return in_array($payment
    ->getState()
    ->getId(), [
    'completed',
    'partially_refunded',
  ], TRUE);
}