// a specific handler type was requested
if ($expectedHandlerType !== null && !\
is_a($handler,
$expectedHandlerType, true
)) { return null;
} return $this->handlers
[$handlerIdentifier];
} public function getSyncPaymentHandler(string
$paymentMethodId): ?SynchronousPaymentHandlerInterface
{ $handler =
$this->
getPaymentMethodHandler($paymentMethodId, SynchronousPaymentHandlerInterface::
class);
if (!
$handler instanceof SynchronousPaymentHandlerInterface
) { return null;
} return $handler;
} public function getAsyncPaymentHandler(string
$paymentMethodId): ?AsynchronousPaymentHandlerInterface
{ $handler =
$this->
getPaymentMethodHandler($paymentMethodId, AsynchronousPaymentHandlerInterface::
class);