PaymentHandlerRegistry example

$connection = $this->createMock(Connection::class);
        $connection
            ->method('createQueryBuilder')
            ->willReturn($qb);

        $this->connection = $connection;
    }

    public function testPaymentRegistry(): void
    {
        $registry = new PaymentHandlerRegistry(
            $this->registerHandler(SynchronousPaymentHandlerInterface::class),
            $this->registerHandler(AsynchronousPaymentHandlerInterface::class),
            $this->registerHandler(PreparedPaymentHandlerInterface::class),
            $this->registerHandler(RefundPaymentHandlerInterface::class),
            $this->registerHandler(RecurringPaymentHandlerInterface::class),
            $this->connection,
        );

        $sync = $registry->getSyncPaymentHandler($this->ids->get(SynchronousPaymentHandlerInterface::class));
        static::assertInstanceOf(SynchronousPaymentHandlerInterface::class$sync);

        
Home | Imprint | This part of the site doesn't use cookies.