public function PaymentMethodManager::createFromOrder in Ubercart 8.4
Returns an instance of the payment method plugin for a specific order.
Parameters
\Drupal\uc_order\OrderInterface $order: The order from which the plugin should be instantiated.
Return value
\Drupal\uc_payment\PaymentMethodPluginInterface A fully configured plugin instance.
File
- payment/
uc_payment/ src/ Plugin/ PaymentMethodManager.php, line 44
Class
- PaymentMethodManager
- Manages discovery and instantiation of payment methods.
Namespace
Drupal\uc_payment\PluginCode
public function createFromOrder(OrderInterface $order) {
return PaymentMethod::load($order
->getPaymentMethodId())
->getPlugin();
}