public function savePv(\Magento\Sales\Api\Data\OrderInterface $order)
    {
        $orderId = $order->getId();
        $state = $order->getState();
        $dateCreated = $order->getCreatedAt();
        $itemsData = $this->getServiceItemsForMageSaleOrder($order);
        /* compose request data and request itself */
        /** @var \Praxigento\Pv\Service\Sale\Save\Request $req */
        $req = new \Praxigento\Pv\Service\Sale\Save\Request();
        $req->setSaleOrderId($orderId);
        $req->setOrderItems($itemsData);
        if ($state == \Magento\Sales\Model\Order::STATE_PROCESSING) {
            $req->setSaleOrderDatePaid($dateCreated);
        }
        $this->srvPvSave->exec($req);
    }
public function savePv(\Magento\Sales\Api\Data\OrderInterface $order)
    {
        $orderId = $order->getId();
        $state = $order->getState();
        $dateCreated = $order->getCreatedAt();
        $itemsData = $this->getServiceItemsForMageSaleOrder($order);
        /* compose request data and request itself */
        /** @var \Praxigento\Pv\Service\Sale\Save\Request $req */
        $req = new \Praxigento\Pv\Service\Sale\Save\Request();
        $req->setSaleOrderId($orderId);
        $req->setOrderItems($itemsData);
        if ($state == \Magento\Sales\Model\Order::STATE_PROCESSING) {
            $req->setSaleOrderDatePaid($dateCreated);
        }
        $this->srvPvSave->exec($req);
    }
public function savePv ( \ Magento \ Sales \ Api \ Data \ OrderInterface $ order ) { $ orderId = $ order -> getId ( ) ; $ state = $ order -> getState ( ) ; $ dateCreated = $ order -> getCreatedAt ( ) ; $ itemsData = $ this -> getServiceItemsForMageSaleOrder ( $ order ) ; /* compose request data and request itself */ /** @var \Praxigento\Pv\Service\Sale\Save\Request $req */ $ req = new \ Praxigento \ Pv \ Service \ Sale \ Save \ Request ( ) ; $ req -> setSaleOrderId ( $ orderId ) ; $ req -> setOrderItems ( $ itemsData ) ; if ( $ state == \ Magento \ Sales \ Model \ Order :: STATE_PROCESSING ) { $ req -> setSaleOrderDatePaid ( $ dateCreated ) ; } $ this -> srvPvSave -> exec ( $ req ) ; }
Collect orders data and call service method to register order PV.

@param \Magento\Sales\Api\Data\OrderInterface $order
@throws \Exception
Collect orders data and call service method to register order PV .