Sonata\Component\Payment\Debug\DebugPayment::processCallback PHP Method

processCallback() public method

Handle the callback.
public processCallback ( Sonata\Component\Order\OrderInterface $order, string $action ) : Response
$order Sonata\Component\Order\OrderInterface
$action string
return Symfony\Component\HttpFoundation\Response
    public function processCallback(OrderInterface $order, $action)
    {
        $params = array('bank' => $this->getCode(), 'reference' => $order->getReference(), 'check' => $this->generateUrlCheck($order), 'action' => $action);
        $url = $this->router->generate($this->getOption('url_callback'), $params, UrlGeneratorInterface::ABSOLUTE_URL);
        $response = $this->browser->get($url);
        $routeName = 'ok' === $response->getContent() ? 'url_return_ok' : 'url_return_ko';
        $response = new RedirectResponse($this->router->generate($this->getOption($routeName), $params, true), 302, array('Content-Type' => 'text/plain'));
        $response->setPrivate();
        return $response;
    }