I am attempting to use a pre-configured instance of a plugin. The plugin is of type @CommercePaymentGateway.
I am currently trying to use something like:
/** @var PaymentGatewayManager $manager */ $manager = \Drupal::service('plugin.manager.commerce_payment_gateway'); $manager->getInstance(['module' => 'commerce_paypal']);
But I'm getting the error
Error: Call to a member function getInstance() on null. However, using
$manager is clearly an instance of
I see what I think is the instance configuration in the config table under
commerce_payment.commerce_payment_gateway.paypal_ec. But that
paypal_ec part is specific to my site.
How do I get an instance of a plugin?