public function confirmPayment($orderId)
    {
        try {
            $orderId = \intval($orderId);

            if (null !== $order = $this->getOrder($orderId)) {
                $this->getLog()->addInfo(
                    $this->getTranslator()->trans(
                        "Processing confirmation of order ref. %ref, ID %id",
                        array('%ref' => $order->getRef(), '%id' => $order->getId())
                    )
                );

                $event = new OrderEvent($order);

                $event->setStatus(OrderStatusQuery::getPaidStatus()->getId());

                $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);

                $this->getLog()->addInfo(
                    $this->getTranslator()->trans(
                        "Order ref. %ref, ID %id has been successfully paid.",
                        array('%ref' => $order->getRef(), '%id' => $order->getId())
                    )
                );
            }
        } catch (\Exception $ex) {
            $this->getLog()->addError(
                $this->getTranslator()->trans(
                    "Error occured while processing order ref. %ref, ID %id: %err",
                    array(
                        '%err' => $ex->getMessage(),
                        '%ref' => !isset($order) ? "?" : $order->getRef(),
                        '%id' => !isset($order) ? "?" : $order->getId()
                    )
                )
            );

            throw $ex;
        }
    }
public function confirmPayment($orderId)
    {
        try {
            $orderId = \intval($orderId);

            if (null !== $order = $this->getOrder($orderId)) {
                $this->getLog()->addInfo(
                    $this->getTranslator()->trans(
                        "Processing confirmation of order ref. %ref, ID %id",
                        array('%ref' => $order->getRef(), '%id' => $order->getId())
                    )
                );

                $event = new OrderEvent($order);

                $event->setStatus(OrderStatusQuery::getPaidStatus()->getId());

                $this->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event);

                $this->getLog()->addInfo(
                    $this->getTranslator()->trans(
                        "Order ref. %ref, ID %id has been successfully paid.",
                        array('%ref' => $order->getRef(), '%id' => $order->getId())
                    )
                );
            }
        } catch (\Exception $ex) {
            $this->getLog()->addError(
                $this->getTranslator()->trans(
                    "Error occured while processing order ref. %ref, ID %id: %err",
                    array(
                        '%err' => $ex->getMessage(),
                        '%ref' => !isset($order) ? "?" : $order->getRef(),
                        '%id' => !isset($order) ? "?" : $order->getId()
                    )
                )
            );

            throw $ex;
        }
    }
public function confirmPayment ( $ orderId ) { try { $ orderId = \ intval ( $ orderId ) ; if ( null !== $ order = $ this -> getOrder ( $ orderId ) ) { $ this -> getLog ( ) -> addInfo ( $ this -> getTranslator ( ) -> trans ( "Processing confirmation of order ref. %ref, ID %id" , array ( '%ref' => $ order -> getRef ( ) , '%id' => $ order -> getId ( ) ) ) ) ; $ event = new OrderEvent ( $ order ) ; $ event -> setStatus ( OrderStatusQuery :: getPaidStatus ( ) -> getId ( ) ) ; $ this -> dispatch ( TheliaEvents :: ORDER_UPDATE_STATUS , $ event ) ; $ this -> getLog ( ) -> addInfo ( $ this -> getTranslator ( ) -> trans ( "Order ref. %ref, ID %id has been successfully paid." , array ( '%ref' => $ order -> getRef ( ) , '%id' => $ order -> getId ( ) ) ) ) ; } } catch ( \ Exception $ ex ) { $ this -> getLog ( ) -> addError ( $ this -> getTranslator ( ) -> trans ( "Error occured while processing order ref. %ref, ID %id: %err" , array ( '%err' => $ ex -> getMessage ( ) , '%ref' => ! isset ( $ order ) ? "?" : $ order -> getRef ( ) , '%id' => ! isset ( $ order ) ? "?" : $ order -> getId ( ) ) ) ) ; throw $ ex ; } }
Process the confirmation of an order. This method should be  called
once the module has performed the required checks to confirm a valid payment.

@param int $orderId the order ID
@throws \Exception
Process the confirmation of an order . This method should be called once the module has performed the required checks to confirm a valid payment .