CodeExplorer OrderPaymentMethodChangedEvent example
$changedOrder =
$this->
loadOrder($order->
getId(),
$salesChannelContext);
$transactions =
$changedOrder->
getTransactions();
if ($transactions === null
|| ($transaction =
$transactions->
get($transactionId)) === null
) { if (Feature::
isActive('v6.6.0.0'
)) { throw OrderException::
orderTransactionNotFound($transactionId);
} throw new UnknownPaymentMethodException($paymentMethodId);
} $event =
new OrderPaymentMethodChangedEvent( $changedOrder,
$transaction,
$context,
$salesChannelContext->
getSalesChannelId() );
$this->eventDispatcher->
dispatch($event);
} private function validateRequest(SalesChannelContext
$salesChannelContext, string
$paymentMethodId): void
{ $paymentRequest =
new Request();