Skip to content

Commit

Permalink
Merge pull request #485 from winzou/post-redirect
Browse files Browse the repository at this point in the history
Allow sessionTokenAction to POST redirect
  • Loading branch information
makasim authored Jan 7, 2019
2 parents 63a9baf + 49c8269 commit 26c4ca3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Controller/CaptureController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Payum\Bundle\PayumBundle\Controller;

use Payum\Core\Reply\HttpPostRedirect;
use Payum\Core\Request\Capture;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
Expand All @@ -19,12 +20,18 @@ public function doSessionTokenAction(Request $request)

$request->getSession()->remove('payum_token');

return $this->redirect($this->generateUrl('payum_capture_do', array_replace(
$redirectUrl = $this->generateUrl('payum_capture_do', array_replace(
$request->query->all(),
array(
'payum_token' => $hash,
)
)));
));

if ($request->isMethod('POST')) {
throw new HttpPostRedirect($redirectUrl, $request->request->all());
}

return $this->redirect($redirectUrl);
}

public function doAction(Request $request)
Expand Down

0 comments on commit 26c4ca3

Please sign in to comment.