You are here

public function Square::deletePaymentMethod in Commerce Square Connect 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/Square.php, line 348

Class

Square
Provides the Square payment gateway.

Namespace

Drupal\commerce_square\Plugin\Commerce\PaymentGateway

Code

public function deletePaymentMethod(PaymentMethodInterface $payment_method) {

  // @todo Currently there are no remote records stored.
  // Delete the local entity.
  $payment_method
    ->delete();
}