You are here

public function SupportsStoredPaymentMethodsInterface::deletePaymentMethod in Commerce Core 8.2

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.

2 methods override SupportsStoredPaymentMethodsInterface::deletePaymentMethod()
Onsite::deletePaymentMethod in modules/payment_example/src/Plugin/Commerce/PaymentGateway/Onsite.php
Deletes the given payment method.
StoredOffsiteRedirect::deletePaymentMethod in modules/payment_example/src/Plugin/Commerce/PaymentGateway/StoredOffsiteRedirect.php
Deletes the given payment method.

File

modules/payment/src/Plugin/Commerce/PaymentGateway/SupportsStoredPaymentMethodsInterface.php, line 40

Class

SupportsStoredPaymentMethodsInterface
Defines the interface for gateways which support storing payment methods.

Namespace

Drupal\commerce_payment\Plugin\Commerce\PaymentGateway

Code

public function deletePaymentMethod(PaymentMethodInterface $payment_method);