Ejemplo n.º 1
0
 public function finishPayment(Payment $payment, $status)
 {
     try {
         $this->entityManager->beginTransaction();
         $order = $payment->getOrder();
         $payment->setStatus($status);
         $order->setStatus($status === $payment::STATUS_COMPLETE ? $order::STATUS_FINISHED_PAID : $order::STATUS_FINISHED_UNPAID);
         $this->entityManager->persist($order);
         $this->persistPayment($payment);
         $this->eventDispatcher->dispatch("agit.payment.finished", new PaymentEvent($payment));
         $this->entityManager->commit();
     } catch (Exception $e) {
         $this->entityManager->rollback();
         throw $e;
     }
 }
Ejemplo n.º 2
0
 public function fillStatus(PaymentEntity $payment)
 {
     $this->status = self::$availableStatus[$payment->getStatus()];
 }
Ejemplo n.º 3
0
 public function createProcessorUrl(Payment $payment, $action)
 {
     $path = $this->router->generate("order_payment", ["reference" => $payment->getFullCode(), "locale" => $this->localeService->getLocale(), "action" => $action]);
     return $this->urlService->createAppUrl($path);
 }