/** * Check wrapped order for deserialization */ public function testWrappedOrder() { $json = json_decode(file_get_contents(__DIR__ . '/fixtures/wrapped_order.json'), true); $order = new WrappedOrder(); $order->fromArray($json); $order->validate(); }
public function submitOrder(Order $order) { $token = $this->getToken(); $response = $this->request('order/create', array('order' => $order->toArray()), $token->getAccessToken()); $wrappedOrder = new WrappedOrder(); $wrappedOrder->fromArray($response); $wrappedOrder->validate(); return $wrappedOrder; }