예제 #1
0
 public function process()
 {
     $request = file_get_contents('php://input');
     if (empty($request)) {
         die("No request data");
     }
     try {
         $productOrdered = $this->connection->receiveProductOrdered();
         $allCodesFromProduct = \CodesWholesale\Resource\Order::getCodes($productOrdered);
         $orderId = $productOrdered->getOrderId();
         $item = $this->itemRetriever->retrieveItem($orderId);
         $params = array('item' => $item, 'allCodesFromProduct' => $allCodesFromProduct);
         $newKeys = $this->newKeysExtractor->extract($params);
         $this->eventDispatcher->dispatchEvent($newKeys);
     } catch (\Exception $e) {
         die('We found error. Probably this is the result of sending test POSTBACK. If your response status is: 200 OK
          it means that you are successfully connected. Error: ' . $e->getMessage());
     }
 }
예제 #2
0
 public function retrieveItem($orderData)
 {
     return $this->itemRetriever->retrieveItem($orderData);
 }