/**
* {@inheritdoc}
*/
public function getDefaultPaymentMethod(PaymentInterface $subject)
{
/** @var CorePaymentInterface $subject */
Assert::isInstanceOf($subject, CorePaymentInterface::class);
/** @var ChannelInterface $channel */
$channel = $subject->getOrder()->getChannel();
$paymentMethods = $this->paymentMethodRepository->findEnabledForChannel($channel);
if (empty($paymentMethods)) {
throw new UnresolvedDefaultPaymentMethodException();
}
return $paymentMethods[0];
}