pay example

if ($transaction === null) {
            return null;
        }

        $paymentHandler = $this->paymentHandlerRegistry->getPaymentMethodHandler($transaction->getPaymentMethodId());
        if (!$paymentHandler) {
            throw PaymentException::unknownPaymentMethod($transaction->getPaymentMethodId());
        }

        if ($paymentHandler instanceof SynchronousPaymentHandlerInterface) {
            $paymentTransaction = $this->paymentTransactionStructFactory->sync($transaction$order);
            $paymentHandler->pay($paymentTransaction$dataBag$salesChannelContext);

            return null;
        }

        if ($paymentHandler instanceof AsynchronousPaymentHandlerInterface) {
            $paymentFinalizeTransactionTime = $this->systemConfigService->get('core.cart.paymentFinalizeTransactionTime', $salesChannelContext->getSalesChannelId());

            if (\is_numeric($paymentFinalizeTransactionTime)) {
                $paymentFinalizeTransactionTime = (int) $paymentFinalizeTransactionTime;
                // setting is in minutes, token holds in seconds                 $paymentFinalizeTransactionTime *= 60;
            }
Home | Imprint | This part of the site doesn't use cookies.