private function getPaymentMethods(SalesChannelContext
$context, Request
$request, OrderEntity
$order): PaymentMethodCollection
{ $criteria =
new Criteria();
$criteria->
addFilter(new EqualsFilter('afterOrderEnabled', true
));
$routeRequest =
new Request();
$routeRequest->query->
replace($this->requestCriteriaBuilder->
toArray($criteria));
$routeRequest->query->
set('onlyAvailable', '1'
);
$event =
new PaymentMethodRouteRequestEvent($request,
$routeRequest,
$context,
$criteria);
$this->eventDispatcher->
dispatch($event);
$paymentMethods =
$this->paymentMethodRoute->
load( $event->
getStoreApiRequest(),
$this->orderConverter->
assembleSalesChannelContext($order,
$context->
getContext()),
$event->
getCriteria() )->
getPaymentMethods();
$paymentMethods->
sortPaymentMethodsByPreference($context);
return $paymentMethods;
}