how to generate url in loadTemplate()

anonimlt

Joined: 2010-02-11
Posts: 26
Posted: Sun, 2010-02-14 18:33

I have to generate a full accept url to pass to the payment service. Later I will need to calculate md5 on this url, so I cannot leave it for generation in the template file. How can I generate this url in the view's loadTemplate function?
I try

Quote:
$verify[1] = $transaction->getDate();
$verify[2] = $transaction->getSecurity();
$form['accepturl'] = $urlGenerator->generateUrl(array('view' => 'checkouttopay.PaymentComplete'), array('forceFullUrl' => true,'verify1'=>$verify[1], 'verify2'=>$verify[2]));

verify does not get added to the url. What is wrong here? Is this possible at all?

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sun, 2010-02-14 22:40

You're putting the verify fields in the wrong place. It should be

$form['accepturl'] = $urlGenerator->generateUrl(
                               array( 'view' => 'checkouttopay.PaymentComplete',
                                      'verify1' => $verify[1],
                                      'verify2' => $verify[2]  ),
                               array('forceFullUrl' => true)      );