I need to make payment transaction for an application and I saw JSMPaymentCoreBundle.
I read the documentation of JSMPaymentCoreBundel but I wonder me how I can pass object to the controller detailsAction(Order $order) and completeAction(Order $order).
For example, in the detailAction controller, the redirect response looks like this :
return new RedirectResponse($this->router->generate('payment_complete', array('orderNumber' => $order->getOrderNumber(),)));
For me, we don"t pass the required Order object in param to the completeAction controller below but only orderNumer:
/**
* @Route("/{orderNumber}/complete", name = "payment_complete")
*/
public function completeAction(Order $order){
...
}
I think that if I don't pass an Order object, I'll get error. So what is the best way to do that and how ?
New in development and Symfony, I really want to understand and not simply make a copy/paste.
Any help would be appreciate.
You think you will get error, but did you actually get an error?
The documentation you read for
JSMPaymentCoreBundel
is absolutely right. If you type hint the parameter in your controller action, the route placeholder will be converted to respective object, if found. See the link posted by Evgeniy. You dont even need to useParamConverter