Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Other
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
22 Jun 2016 at 16:36 UTC
Updated:
5 Sep 2016 at 08:44 UTC
Jump to comment: Most recent
Drupal core has various RedirectResponse items that allow us to return a redirect response for any request. However, there is no convention for stopping the current execution stack and immediately redirecting. Core follows this pattern in \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber.
The subscriber listens to KernelEvents::EXCEPTION. If there is a FormAjaxException it considers the request OK and sets the response. This allows AJAX requests to be returned without going through unneeded processes.
We need this to handle offsite payments.
Create a RedirectResponse exception and event subscriber. Check if the exception is ours and redirect as needed.
Comments
Comment #2
mglamanPR: https://github.com/drupalcommerce/commerce/pull/419
Comment #4
bojanz commentedCommitted, thanks!