billable->request('PUT', sprintf('v1/orders/%s', $this->id), $attributes))) ->setBillable($this->billable); } /** * Checkout given order from the current user. * * @throws RequestRequiresClientIdException * @throws GuzzleException */ public function checkout(string $orderId): self { return (new self($this->billable->request('PUT', sprintf('v1/orders/%s/checkout', $this->id)))) ->setBillable($this->billable); } /** * Revoke given order from the current user. * * @throws RequestRequiresClientIdException * @throws GuzzleException */ public function revoke(string $orderId): self { return (new self($this->billable->request('PUT', sprintf('v1/orders/%s/revoke', $this->id)))) ->setBillable($this->billable); } /** * Delete given order from the current user. * * @throws RequestRequiresClientIdException * @throws GuzzleException */ public function delete(): bool { return $this->billable->request('DELETE', sprintf('v1/orders/%s', $this->id))->success(); } /** * Get order items from given order. * * @param string $orderId The order ID. * @throws RequestRequiresClientIdException * @throws GuzzleException */ public function orderItems(string $orderId): OrderItems { return (new OrderItems($this->billable->request('GET', sprintf('v1/orders/%s/items', $this->id)))) ->setBillable($this->billable) ->setParent($this); } }