RecurringPaymentTransactionStruct example


        return new AsyncPaymentTransactionStruct($orderTransaction$order$returnUrl);
    }

    public function prepared(OrderTransactionEntity $orderTransaction, OrderEntity $order): PreparedPaymentTransactionStruct
    {
        return new PreparedPaymentTransactionStruct($orderTransaction$order);
    }

    public function recurring(OrderTransactionEntity $orderTransaction, OrderEntity $order): RecurringPaymentTransactionStruct
    {
        return new RecurringPaymentTransactionStruct($orderTransaction$order);
    }
}
->expects(static::once())
            ->method('search')
            ->willReturn(new EntitySearchResult('order', 1, new OrderCollection([$order]), null, new Criteria(), Context::createDefaultContext()));

        $stateLoader = $this->createMock(InitialStateIdLoader::class);
        $stateLoader
            ->expects(static::once())
            ->method('get')
            ->with(OrderTransactionStates::STATE_MACHINE)
            ->willReturn('initial_state_id');

        $struct = new RecurringPaymentTransactionStruct($transaction$order);

        $handler = $this->createMock(RecurringPaymentHandlerInterface::class);
        $handler
            ->expects(static::once())
            ->method('captureRecurring')
            ->with($struct, Context::createDefaultContext());

        $registry = $this->createMock(PaymentHandlerRegistry::class);
        $registry
            ->expects(static::once())
            ->method('getRecurringPaymentHandler')
            
$order = $this->orderRepository->search($criteria, Context::createDefaultContext())->first();

        static::assertInstanceOf(OrderEntity::class$order);
        static::assertInstanceOf(OrderTransactionCollection::class$order->getTransactions());
        static::assertCount(1, $order->getTransactions());

        $paymentTransaction = $order->getTransactions()->first();

        static::assertNotNull($paymentTransaction);

        return new RecurringPaymentTransactionStruct($paymentTransaction$order);
    }
}
Home | Imprint | This part of the site doesn't use cookies.