You are here

public function PurchaseOrderGateway::deletePaymentMethod in Commerce Purchase Order 8

Deletes the given payment method.

Both the entity and the remote record are deleted.

Parameters

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

Throws

\Drupal\commerce_payment\Exception\PaymentGatewayException Thrown when the transaction fails for any reason.

Overrides SupportsStoredPaymentMethodsInterface::deletePaymentMethod

File

src/Plugin/Commerce/PaymentGateway/PurchaseOrderGateway.php, line 206

Class

PurchaseOrderGateway
Provides the On-site payment gateway.

Namespace

Drupal\commerce_purchase_order\Plugin\Commerce\PaymentGateway

Code

public function deletePaymentMethod(PaymentMethodInterface $payment_method) {

  // There is no remote system.  These are only stored locally.
  $payment_method
    ->delete();
}