<?php
 namespace Stripe; class Quote extends ApiResource { const OBJECT_NAME = 'quote'; use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Retrieve; use ApiOperations\Update; const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; const STATUS_ACCEPTED = 'accepted'; const STATUS_CANCELED = 'canceled'; const STATUS_DRAFT = 'draft'; const STATUS_OPEN = 'open'; public function pdf($readBodyChunkCallable, $params = null, $opts = null) { $opts = \Stripe\Util\RequestOptions::parse($opts); if (null === $opts->apiBase) { $opts->apiBase = Stripe::$apiUploadBase; } $url = $this->instanceUrl() . '/pdf'; $this->_requestStream('get', $url, $readBodyChunkCallable, $params, $opts); } public function accept($params = null, $opts = null) { $url = $this->instanceUrl() . '/accept'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } public function cancel($params = null, $opts = null) { $url = $this->instanceUrl() . '/cancel'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } public function finalizeQuote($params = null, $opts = null) { $url = $this->instanceUrl() . '/finalize'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } public static function allComputedUpfrontLineItems($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/computed_upfront_line_items'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } public static function allLineItems($id, $params = null, $opts = null) { $url = static::resourceUrl($id) . '/line_items'; list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); $obj->setLastResponse($response); return $obj; } } 