Exemplo n.º 1
0
 /**
  * @Route("/intent/{id}/show" , name="donate_admin_reporting_intent_show", defaults={"id" = 0})
  */
 public function intentShowAction(Request $request, Intent $intent)
 {
     $customerId = $intent->getCustomer()->getId();
     $entityMgr = $this->getDoctrine()->getManager();
     $paymentsQuery = $entityMgr->getRepository('DonateCoreBundle:Payment')->getPaymentsListByIntent(['intentId' => $intent->getId()]);
     $otherIntentsQuery = $entityMgr->getRepository('DonateCoreBundle:Intent')->getIntentsListByCustomer(['customerId' => $customerId], 5, $intent->getId());
     $otherIntents = $otherIntentsQuery->getResult();
     $pagination = $this->getPagination($request, $paymentsQuery, 12);
     return $this->render('DonateAdminBundle:Reporting:intentShow.html.twig', ['intent' => $intent, 'pagination' => $pagination, 'customerOtherIntents' => $otherIntents]);
 }
 public function let(Intent $intent)
 {
     $intent->getCreatedAt()->willReturn(new \DateTime('2014-12-22'));
     $intent->getId()->willReturn(144);
     $this->intent = $intent;
     $this->beConstructedWith(self::PREFIX);
 }
 public function it_should_handle_pay(Intent $intent)
 {
     $intent->getStatus()->willReturn(Intent::STATUS_NEW);
     $intent->getId()->willReturn(666);
     $this->em->persist($intent)->shouldBeCalled();
     $this->em->flush()->shouldBeCalled();
     $intent->setStatus('done')->shouldBeCalled();
     $resp = $this->pay($intent)->shouldHaveType('Symfony\\Component\\HttpFoundation\\Response');
 }
Exemplo n.º 4
0
 /**
  * Business Logic to run prior entering any Payment method
  *
  * @since 2.0.0
  * @param  Intent $intent [description]
  * @return [type] [description]
  */
 protected function preHandle(Intent $intent)
 {
     $request = $this->container->get('request');
     $session = $request->getSession();
     $session->set('intentId', $intent->getId());
     // try to see if the locale has been set as a _locale routing parameter
     if ($locale = $request->getLocale()) {
         $session->set('_locale', $locale);
     }
 }
Exemplo n.º 5
0
 /**
  * @{inheritdoc}
  * Generate RUM from a KEY + a MD5sum
  */
 public function generate(Intent $intent)
 {
     //CODECLIENT-WEB-YYYY-MM-DD-ORDERID
     $rum = $this->prefix . '-WEB-' . $intent->getCreatedAt()->format('Y-m-d') . '-' . $intent->getId();
     return strtoupper(str_pad($rum, 35, ' ', STR_PAD_LEFT));
 }
Exemplo n.º 6
0
 /**
  * L'IntentManager gère les présentations à l'API de paiement
  *
  */
 public function it_should_delegate_payment_to_payment_method(Intent $intent, PaymentMethodInterface $pm, Response $response)
 {
     $this->discovery->getMethod('specmethod')->willReturn($pm);
     $intent->getId()->willReturn(144);
     $pm->getTunnel()->willReturn(PaymentMethodInterface::TUNNEL_SPOT);
     $pm->pay($intent)->willReturn($response);
     $intent->getPaymentMethod()->willReturn('specmethod');
     $this->handle($intent)->shouldHaveType('Symfony\\Component\\HttpFoundation\\Response');
     $pm->pay($intent)->shouldHaveBeenCalled();
 }
Exemplo n.º 7
0
 /**
  * Génère un numéro de commande Ogone à partir de l'IntentId
  * @param  Ecedi\Donate\CoreBundle\Entity\Intent $intent
  * @return string
  */
 protected function orderId(Intent $intent)
 {
     return $this->container->getParameter('donate_ogone.prefix') . '-' . $intent->getId();
 }