paymentMethodNotAvailable example



    private function validateRequest(SalesChannelContext $salesChannelContext, string $paymentMethodId): void
    {
        $paymentRequest = new Request();
        $paymentRequest->query->set('onlyAvailable', '1');

        $availablePayments = $this->paymentRoute->load($paymentRequest$salesChannelContextnew Criteria());

        if ($availablePayments->getPaymentMethods()->get($paymentMethodId) === null) {
            if (Feature::isActive('v6.6.0.0')) {
                throw OrderException::paymentMethodNotAvailable($paymentMethodId);
            }

            throw new UnknownPaymentMethodException($paymentMethodId);
        }
    }

    private function tryTransition(OrderEntity $order, string $paymentMethodId, Context $context): bool
    {
        $transactions = $order->getTransactions();
        if ($transactions === null || $transactions->count() < 1) {
            return false;
        }
Home | Imprint | This part of the site doesn't use cookies.