diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f5fcb6b49..d1614a49b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1105 \ No newline at end of file +v1111 \ No newline at end of file diff --git a/lib/Invoice.php b/lib/Invoice.php index d054acf38..499848796 100644 --- a/lib/Invoice.php +++ b/lib/Invoice.php @@ -271,6 +271,23 @@ public static function update($id, $params = null, $opts = null) const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; const BILLING_SEND_INVOICE = 'send_invoice'; + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the added invoice + */ + public function addLines($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/add_lines'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts @@ -340,6 +357,23 @@ public function pay($params = null, $opts = null) return $this; } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the removed invoice + */ + public function removeLines($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/remove_lines'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts @@ -393,6 +427,23 @@ public static function upcomingLines($params = null, $opts = null) return $obj; } + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the updated invoice + */ + public function updateLines($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/update_lines'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + /** * @param null|array $params * @param null|array|string $opts diff --git a/lib/Service/InvoiceService.php b/lib/Service/InvoiceService.php index 1053b5a8f..a5cbd2228 100644 --- a/lib/Service/InvoiceService.php +++ b/lib/Service/InvoiceService.php @@ -10,6 +10,23 @@ */ class InvoiceService extends \Stripe\Service\AbstractService { + /** + * Adds multiple line items to an invoice. This is only possible when an invoice is + * still a draft. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function addLines($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/add_lines', $id), $params, $opts); + } + /** * You can list all invoices, or list the invoices for a specific customer. The * invoices are returned sorted by creation date, with the most recently created @@ -177,6 +194,23 @@ public function pay($id, $params = null, $opts = null) return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); } + /** + * Removes multiple line items from an invoice. This is only possible when an + * invoice is still a draft. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function removeLines($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/remove_lines', $id), $params, $opts); + } + /** * Retrieves the invoice with the given ID. * @@ -338,6 +372,23 @@ public function updateLine($parentId, $id, $params = null, $opts = null) return $this->request('post', $this->buildPath('/v1/invoices/%s/lines/%s', $parentId, $id), $params, $opts); } + /** + * Updates multiple line items on an invoice. This is only possible when an invoice + * is still a draft. + * + * @param string $id + * @param null|array $params + * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function updateLines($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/update_lines', $id), $params, $opts); + } + /** * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is * similar to deletion, however it only applies to