You are here

function hook_payment_method_alter in Payment 8.2

Alters payment method plugin definitions.

Parameters

array[] $definitions: Keys are plugin IDs. Values are plugin definitions.

1 invocation of hook_payment_method_alter()
PaymentMethodManager::__construct in src/Plugin/Payment/Method/PaymentMethodManager.php
Constructs a new instance.

File

./payment.api.php, line 27
Contains Payment hook documentation.

Code

function hook_payment_method_alter(array &$definitions) {

  // Remove a plugin entirely.
  unset($definitions['foo_plugin_id']);

  // Replace a plugin's class with another.
  $definitions['foo_plugin_id']['class'] = 'Drupal\\foo\\FooPlugin';
}