Search code examples
symfonypayum

Payum + Symfony2 - Add routing parameters to done-url


using latest payum-bundle to create a captureToken i use this code:

$captureToken = $this->get('payum')->getTokenFactory()->createCaptureToken(
    $gatewayName, 
    $payment, 
    'done_xyz' 
);

but what if in my routing the 'done_xyz' requires a mandatory parameter? like

done_xyz:
    path:     /u/{parameter}/done_xyz

i get the error that its missing then, is there any way to include it ?


Solution

  • There is forth argument of createCaptureToken that holds done url's parameters

    This should work:

    $captureToken = $this->get('payum')->getTokenFactory()->createCaptureToken(
        $gatewayName, 
        $payment, 
        'done_xyz', 
        ['parameter' => 'foo']
    );