Bonjour,

J'ai installé JMSPaymentCoreBundle et JMSPaymentPaypalBundle.
j'ai suivi ces instructions pour avoir un formulaire de carte de crédit :http://jmsyst.com/bundles/JMSPayment...master/plugins

Mon problème est que je ne comprends pas comment utiliser ce plugin dans le controlleur:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public function detailsAction($id)
    {
        $order = $this->get('order_manager')->load($id);
 
        $form = $this->get('form.factory')->create('credit_card');
 
        if ('POST' === $this->getRequest()->getMethod()) {
            $form->handleRequest($this->getRequest());
 
            if ($form->isValid()) {
                $this->ppc->createPaymentInstruction($instruction = $form->getData());
 
                $order->setPaymentInstruction($instruction);
                $this->em->persist($order);
                $this->em->flush($order);
 
                return new RedirectResponse($this->router->generate('payment_complete', array(
                    'id' => $order->getId(),
                )));
            }
        }
 
        return $this->render('XXXBundle:payment:details.html.twig', array(
            'form'  => $form->createView(),
            'order' => $order
        ));
    }
lors de l'envoi du formulaire, j'obtiens cette erreur:
Catchable fatal error: Argument 1 passed to JMS\Payment\CoreBundle\PluginController\PluginController::createPaymentInstruction() must implement interface JMS\Payment\CoreBundle\Model\PaymentInstructionInterface, array given
Quelqu'un aurait'il un peu de code à partager ? merci.