Beispiel #1
0
 public function testSendOrdersToRobin()
 {
     $this->markTestSkipped("This test hits the network, turn it on when you need to fully test the whole package");
     $seoShop = $this->getSeoshop();
     $robin = $this->getRobin();
     $orders = $seoShop->orders(['page' => 1, 'limit' => 1]);
     $robinOrders = new Orders();
     foreach ($orders as $order) {
         $createdAt = $order->createdAt;
         $listView = ListView::make($order->number, $createdAt, $order->status);
         $detailsView = DetailViewMaker::makeDetailViews($order);
         $robinOrders->push(Order::make($order->number, $order->email, $createdAt, $order->priceIncl, $order->getEditUrl(), $listView, $detailsView));
     }
     $result = $robin->orders($robinOrders);
     $this->assertEquals(201, $result->getStatusCode());
 }
Beispiel #2
0
 /**
  * @param $json
  * @return \Psr\Http\Message\ResponseInterface
  */
 public function orders($json)
 {
     $order = $this->order->makeFromArray($json);
     $createdAt = $order->createdAt;
     $listView = ListView::make($order->number, $createdAt, $order->status);
     $orders = Orders::make([\Robin\Api\Models\Order::make($order->number, $order->email, $createdAt, $order->priceIncl, $order->getEditUrl(), $listView, DetailViewMaker::makeDetailViews($order))]);
     return $this->robin->orders($orders);
 }