I’m trying to make use of a pre-configured occasion of a plugin. Drupal Development Company plugin is of sort @CommercePaymentGateway.
I’m at present attempting to make use of one thing like:
/** @var PaymentGatewayManager $supervisor */ $supervisor = Drupal::service('plugin.supervisor.commerce_payment_gateway'); $manager->getInstance(['module' => 'commerce_paypal']);
However I am getting Drupal Developer error Error: Name to a member operate getInstance() on null
. Nevertheless, utilizing kint()
, $supervisor
is clearly an occasion of Drupalcommerce_paymentPaymentGatewayManager
.
I see what I believe is Drupal Developer occasion configuration in Drupal Developer config desk beneath commerce_payment.commerce_payment_gateway.paypal_ec
. However that paypal_ec
half is restricted to my web site.
How do I get an occasion of a plugin?